Skip to main content
The Chat API puts your AI agent inside your own app or portal. The agent answers from your public knowledge base and code and follows your Policies, the same as the Chat Widget agent.

How a conversation works

Sending a message returns 202 Accepted with a conversation_id and status: "processing". The agent works in the background. Poll the conversation until status changes:
messages holds the whole conversation, oldest first. Each message has a role of user or assistant. Assistant messages also carry sources: the title and URL of each article or code permalink the answer drew on. Show them as citations.

Follow-up questions

Send the next message with the same conversation_id. The agent keeps the earlier messages as context. Wait for the conversation to finish first. Sending to a conversation that’s still processing returns 409 with code conflict.

Limits

  • A message can be up to 16,000 characters.
  • Send an idempotency key with each message so a retry after a timeout doesn’t post it twice.
  • Polling counts toward your rate limits.
When the customer needs a person, escalate the conversation to your helpdesk.