Run network
Runs the network against messages. When the network has more than one agent, routing picks which one answers (send use_routing: false to take the default agent instead); the data-handoff entry in data says which one it was. Returns the finished turn as JSON: text is the answer, toolCalls what the agent called on the way, data the custom parts. This is the same run POST /v1/chat performs — same routing, memory, tools, usage accounting and cost — with the stream collected server-side, so it responds only when the turn is complete and takes as long as the turn takes. Use /v1/chat when you want tokens as they are generated. Pass the returned threadId back to continue the conversation.
Authorizations
Session token (snat_…) minted by POST /v1/token. Carries the organization and the end user; safe in a browser.
Path Parameters
Network (copilot) id.
"a5e91c07-3f24-4b68-9d15-8c72e0b4a396"
Body
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.
Approve or decline a tool call that paused the previous stream
Conversation thread id
"thread_2f81c04a"
Additional context messages to provide to the agent.
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.
AI SDK trigger type
submit-message, regenerate-message AI SDK client-side tools
AI SDK session metadata
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.
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
The finished turn
The conversation this turn belongs to — the one you sent, or the one created for you. Send it back on the next call to continue.
Correlation id for this run; the join key for its traces and cost.
The agent's answer.
Reasoning text, when the model emitted any. Absent otherwise.
The tools the agent called, in order, each with its input and either its output or the error it failed with.
Custom parts the run emitted: data-handoff (which agent a network routed to), data-tool-workflow (workflow step progress), and data-tool-call-approval — that last one means the run PAUSED for human approval rather than finishing. Call again with approval and the same threadId to continue it.
Errors the run reported. A turn can fail after it began answering, so this can be non-empty alongside text — and the status is still 200, because the same failure over /v1/chat happens long after the headers.