Agentic SSE Stream
Endpoint:POST /api/chat/conversations/:id/messages/agentic
The response uses Content-Type: text/event-stream. Each line follows the SSE format:
Request body
| Field | Type | Notes |
|---|---|---|
content | string | The user message |
model | string | Optional model override |
provider | string | Optional provider override |
showThinking | boolean | Stream thinking/reasoning blocks |
maxSteps | number | 1-200, default depends on effort |
maxBudget | number | Token budget (min 1000) |
effort | string | low | medium | high | max |
Event Types
user_message
Sent immediately with the saved user message.
session:start
Agent session initialized.
thinking:start / thinking:update / thinking:end
Reasoning process events (when showThinking: true and the model supports extended thinking).
step:start / step:complete
Each autonomous step the agent takes.
tool:call
tool:result
summary
complete
message_saved
error
TIMEOUT is sent when the 3-minute session timeout is reached.
Streaming Completions (SSE)
ForPOST /api/chat/completions with "stream": true, each chunk is:
JavaScript Example
Related
- Chat API - Send messages and trigger agentic execution
- Agent Sessions API - Monitor and cancel sessions
- Tools Overview - Tools the agent emits during execution
- Security Overview - Tool approval and execution policies