/v1/agent and owns conversation state. For TypeScript, the Agent API SDK surface drives this same resource for you. See the Overview for authentication and request conventions.
The event loop
Start a turn withPOST /v1/agent/chat, then poll GET /v1/agent/chat/{sessionId} until the turn reaches a terminal state. Every response is an event page:
events; they are not separate top-level response fields.
- Apply events in sequence order, and repeat while
has_moreis true or the latest turn state isprocessing. - Stop at
complete,failed,interrupted, orawaiting_action. waitis an integer long-poll duration in milliseconds, bounded to30000. A typical client request useswait=25000.- Keep the cursor opaque. An expired cursor returns
410, and a malformed or cross-session cursor returns400 invalid_cursor; in either case, request the session without a cursor and reconcile the returned event page.
Sessions
Session ownership comes from the authenticated caller. Do not use a wallet address as an ownership key.Action results
Action resolution requires its own permission (agent:actions:resolve) and an idempotency key. Submit only the result produced by the reviewed request — never replace the action payload with caller-authored transaction fields. The request body is { "revision": number, "result": ActionResult }; the response contains the resulting action revision.
Live stream
GET /v1/agent/chat/{sessionId}/stream is an SSE projection over the same event log. It emits three SSE event names:
Reconnect with the last cursor from a
page event. A message event is useful for rendering live text, but it is not a durable cursor.