Chat & Streaming
Send messages to an agent via REST or SSE and understand the event stream.
Synchronous chat
POST
/api/chatX-Agent-Access-TokenSingle JSON response after the full turn completes (LLM + tool calls).
curl -X POST http://127.0.0.1:8000/api/chat \
-H "Content-Type: application/json" \
-H "X-Agent-Access-Token: pa_..." \
-d '{
"agent_id": "agent-uuid",
"message": "Compare gas on Arbitrum vs Base",
"conversation_id": null
}'SSE streaming (recommended)
POST
/api/chat/streamX-Agent-Access-TokenServer-Sent Events stream with token deltas, tool calls, and final message.
Event sequence:
start— turn begantext_delta— incremental assistant texttool_calls_start/tool_call/tool_result— tool executionfinal— completed message with chain_calls metadataerror— failure before close
Keepalive SSE comments (: keepalive) flush every ~15s during long tool gathers so proxies do not drop the connection.
Conversations
GET /api/conversations?agent_id=...— list threadsGET /api/conversations/{id}/messages— historyDELETE /api/conversations/{id}— remove threadGET /api/conversations/{id}/stream— live tx confirmations
Request body fields
agent_id(required)message(required)conversation_id(optional — omit to start new)connected_wallet_address(optional — user wallet context)