One-shot reply (stateless — no memory)
POST
https://server.heyrik.com/api/v1/chat/completeHeaders
AuthorizationstringRequiredUse Bearer $HEYRIK_API_KEY with an account-scoped API key. Keep the key on your server.
Parameters 3
Fields documented for this operation. See the request example for placement and structure.
agent_idstringRequiredThe agent to answer (from POST /agents). `agency_id` also accepted.
messagestringA single user message — the simplest form.
messagesobject[]OR the full turn history you want considered: [{ role: "user" | "assistant", content }]. Use this to give context, since nothing is remembered between calls. Send one of message or messages.
Response
Explore the example values. This is not a complete response schema.
dataobjectExplore 3 properties
replystringExample "We are open Monday to Saturday, 9:00 AM to 6:00 PM."
credits_chargednumberExample 1
balance_creditsnumberExample 4975
POST/chat/complete
cURL
curl -X POST https://server.heyrik.com/api/v1/chat/complete \
-H "Authorization: Bearer $HEYRIK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agc_9f2a1c30",
"message": "What are your timings?"
}'Response example
JSON
{
"data": {
"reply": "We are open Monday to Saturday, 9:00 AM to 6:00 PM.",
"credits_charged": 1,
"balance_credits": 4975
}
}Illustrative examples · No live request is sent
