Skip to content
OrbContext
19 pages

API reference

Chat

Streamed, grounded answers and suggested questions.

Get suggested questions

GET/v1/bots/{botId}/suggestionsscope: chat:write

Requires the chat:write scope and access to the requested bot.

Parameters

botId
path · stringrequired
—

Example

curl -X GET '$ORBCONTEXT_API_URL/v1/bots/{botId}/suggestions' \
  -H "Authorization: Bearer $ORBCONTEXT_API_KEY"
Response 200
{
  "questions": [
    "string"
  ]
}

Responses

200400401402403404413415429500503

Starter questions.

Error responses share one shape; see Errors & limits.

Stream a grounded chat answer

POST/v1/chatscope: chat:write

Requires the chat:write scope and access to the requested bot.

Request body · application/json

botId
stringrequired
A bot permitted by this API key. · Min length: 1
message
stringrequired
Your question. Leading and trailing whitespace is trimmed. · Min length: 1 · Max length: 4000
conversationId
string
Optional. Continue a conversation created by this key and bot. · Min length: 1
location
string
Optional. Narrows retrieval to unscoped knowledge plus this location. · Max length: 80
audience
string
Optional. Must be allowed for this key; omitted means public knowledge only. · Max length: 80

Example

curl -N -X POST '$ORBCONTEXT_API_URL/v1/chat' \
  -H "Authorization: Bearer $ORBCONTEXT_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{ "botId": "b_your_bot_id", "message": "How can you help?" }'
Event stream
event: started
data: {"type":"started","conversationId":"c_example","messageId":"m_answer","userMessageId":"m_question"}

event: token
data: {"type":"token","value":"Hello!"}

event: done
data: {"type":"done","conversationId":"c_example","messageId":"m_answer","tokensIn":120,"tokensOut":18,"latencyMs":350}

Responses

200400401402403404413415429500503

SSE frames: started, token, done, error. Parse complete frames across transport chunks. Sources and diagnostics are never included. HTTP errors occur before streaming begins; an error frame after streaming begins terminates the answer. Continuations must use the same key and bot. Streams time out after 120 seconds.

Error responses share one shape; see Errors & limits.