Chat Streaming V2
Streaming chat endpoint with paragraph-level citations.
Event Format: The response is a stream of newline-delimited JSON events with type discriminators.
Event Types:
metadata: Sent once at start with conversation/message/response IDsparagraph: Response paragraphs with inline citations (sent as generated)thinking: Thinking steps (only if report_progress=true)done: Completion marker
Example Stream:
metadata: {"type":"metadata","conversation_id":"...","message_id":"...","response_id":"..."}
thinking: {"type":"thinking","step":"Searching for relevant documents..."}
paragraph: {"type":"paragraph","text":"Alice is 32 years old.","citations":[...],"links":[]}
paragraph: {"type":"paragraph","text":"She works at AODocs.","citations":[...],"links":[...]}
done: {"type":"done"}
Client Implementation:
Parse each line by splitting on the prefix (metadata:, paragraph:, etc.) and
parsing the JSON. Use the type field for type-safe handling.
Progressive Rendering: Paragraphs are sent as soon as they’re generated, enabling progressive UI updates with inline citations.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The domain of the customer
"example.com"
Body
V2 Chat request model with deprecated fields removed.
Changes from V1:
- Removed library_id (use library_ids)
- Removed document_id (use document_ids)
- Removed view_params (not needed in v2)
- Removed filters (handled internally)
- Removed use_header_prefix (streaming format changed)
The message to be sent to the assistant
The id of the agent to scope this chat request
The conversation ID of the chat message. If not provided, a new conversation will be created.
Answer the question in the context of these libraries
Answer the question in the context of these documents
Answer the question in the context of the view
Timezone of the user. If not provided we use UTC timezone. Format: offset from UTC, in minutes (JavaScript getTimezoneOffset)
Disable tools that can modify documents for this request
Response
Successful Response