SendDocumentation Index
Fetch the complete documentation index at: https://agent37.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
stream: true on a message and the response comes back as Server-Sent Events. Each event is named, so you can render text, reasoning, and tool activity live. Events arrive in order, and the terminal response.completed event carries the final output_text and usage.
Events
| Event | Payload |
|---|---|
response.created | { id, instance_id, session_id } |
response.reasoning.delta | { text }, a chunk of the agent’s thinking |
response.output_text.delta | { text }, a chunk of the visible answer |
response.tool_call.started | { tool, label } |
response.tool_call.completed | { tool, duration_ms } |
response.tool_call.failed | { tool, error }, the run continues |
response.completed | { output_text, usage }, terminal success |
response.failed | { error: { code, message } }, terminal error |
These events are the same whatever agent the instance runs (Hermes, Claude Code, Codex, OpenClaw). They are the streaming contract, not a per-agent detail, so your client code doesn’t change when you switch agents.
Reconnect safely. If a stream drops, reconnect to
GET /v1/responses/{id}/stream. It replays a snapshot of everything so far, then resumes live, so the answer is never lost.Parse the stream
Read the response body, split on the SSE frame boundary, and branch on each event’sevent: line. Stop when you see a terminal event.
node
Next steps
Send a message
Every field on the core call, plus the response shape.
Build a chat app
Stream every reply into a per-user chat.