Skip to main content
POST
Stream chat

Authorizations

Authorization
string
header
required

Session token (snat_…) minted by POST /v1/token. Carries the organization and the end user; safe in a browser.

Body

application/json
messages
array

The conversation, in AI SDK UIMessage format: [{ "role": "user", "parts": [{ "type": "text", "text": "..." }] }]. Send the whole exchange you want the agent to see; with a threadId the stored history is loaded too, so the new turn is usually the only entry. May be empty only on an approval continuation.

Example:
approval
object

Approve or decline a tool call that paused the previous stream

Example:
agentId
string

Agent id — runs the agent's active published version

Example:

"6f1c0f4e-2b7a-4a51-9a2f-0c9d1b3e5a10"

agentVersionId
string

Optional override: run a specific agent version (e.g. preview a draft or an earlier published version) instead of the active one

Example:

"b3f7a2c8-5d19-4e6b-8f02-1a4c9e7d3b55"

copilotId
string

Network id to route through (alternative to agentId)

Example:

"a5e91c07-3f24-4b68-9d15-8c72e0b4a396"

threadId
string

Conversation thread id

Example:

"thread_2f81c04a"

context
string[]

Additional context messages to provide to the agent.

Example:
variables
object

Values for {{variable}} placeholders in the agent's prompt blocks. Scalars (string, number, boolean) or arrays of them. A dot path up to 3 segments may be sent nested or as a dotted key — { "user": { "language": "FR" } } and { "user.language": "FR" } both fill {{user.language}}. This is the shape GET /v1/copilots/{id} and GET /v1/agents/{id} return under variables: fill in the leaves you have and send the object back. A null leaf is ignored (the placeholder falls back to its own default), so leaving one unfilled is the same as omitting it. Display-only — never used for authorization or identity. Reserved: now.*. Entries with an unsupported key or value are dropped, not rejected: a display-only field must not fail a chat turn.

Example:
trigger
enum<string>

AI SDK trigger type

Available options:
submit-message,
regenerate-message
tools
object

AI SDK client-side tools

Example:
metadata
object

AI SDK session metadata

Example:
use_routing
boolean
default:true

Default true. When the request targets an orchestrator agent, routing picks whether to stream the orchestrator (multi-step / synthesis) or a single subagent directly (domain-specific ask). No effect when the resolved agent is not an orchestrator. Pass false to disable.

suggest_followups
boolean
default:true

Default true. After the answer finishes streaming, a small model proposes up to 3 questions the user could ask next, emitted as a data-followups chunk for the client to render as chips. Costs one extra model call per turn and holds the stream open slightly longer — pass false to disable. Only applies to copilotId requests: an agentId run has no UI to render chips into, so suggestions never run there.

Response

AI SDK v6 UIMessageStream response

The response is of type string.