Chat
Stream Message
Send a message and receive a streaming response via Server-Sent Events (SSE).
POST
Request Body
Same as Send Message — all fields are identical.Target agent ID (ag_*)
User message text
Session ID for conversation memory
Response — Server-Sent Events (SSE)
The response is a stream oftext/event-stream events. Each event is a JSON object on a data: line:
Event Types
| Type | Fields | Description |
|---|---|---|
text | content | Partial text chunk — concatenate all chunks for the full response |
tool_call | name, args | Agent is invoking a tool |
tool_result | name, result | Tool execution result |
done | usage | Stream complete — includes final token usage |
error | message | Error during generation |
Client Example — JavaScript
Client Example — Python
Errors
| Code | Description |
|---|---|
401 | Missing or invalid authentication |
402 | Insufficient balance |
404 | Agent not found |
429 | Rate limit exceeded |

