Skip to main content
The Agent resource lives at /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 with POST /v1/agent/chat, then poll GET /v1/agent/chat/{sessionId} until the turn reaches a terminal state. Every response is an event page:
Messages, tool activity, actions, errors, and lifecycle changes are entries in events; they are not separate top-level response fields.
  • Apply events in sequence order, and repeat while has_more is true or the latest turn state is processing.
  • Stop at complete, failed, interrupted, or awaiting_action.
  • wait is an integer long-poll duration in milliseconds, bounded to 30000. A typical client request uses wait=25000.
  • Keep the cursor opaque. An expired cursor returns 410, and a malformed or cross-session cursor returns 400 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.
Last modified on September 2, 2026