Chat9
APIChat

Chat

Chat endpoint (PUBLIC — no JWT, uses X-API-Key). Returns RAG-generated answer with source documents. Errors: 401 (invalid/missing API key), 422 (invalid question), 503 (OpenAI unavailable). Honors the optional `Idempotency-Key` header: a retry within 24h replays the original response instead of re-running the LLM pipeline.

POST
/chat
/chat

Request Body

application/jsonRequired

question
Required
Question

User question

Maximum length: 1000

session_idSession Id

Optional session ID; auto-generated if not provided

bot_public_idBot Public Id

Optional bot to address. If omitted (or empty), the tenant's default bot is used. Must belong to the authenticated tenant and be active.

Header Parameters

X-API-KeyX-Api-Key

X-Browser-LocaleX-Browser-Locale

curl -X POST "https://api.getchat9.live/chat" \
  -H "X-API-Key: string" \
  -H "X-Browser-Locale: string" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "string",
    "session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82",
    "bot_public_id": "string"
  }'

Successful Response

{
  "text": "string",
  "session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82",
  "chat_ended": false,
  "ticket_number": "string",
  "source_documents": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "tokens_used": 0
}