Skip to main content
A session is a conversation with an agent. It records the production agent version at creation time and is scoped to a subjectId, your stable identifier for the person, team, organization, workspace, or other entity the agent should remember. Session statuses are idle, running, waiting_on_human, and archived. waiting_on_human means the active turn requires a response such as tool approval or clarification. Default session listing excludes archived sessions.

Create a session

Creating a session consumes one conversation from the agent’s per-user allowance. The default is 5 conversations per stable subjectId per fixed 60-second window. Reuse the same subjectId for the same authenticated user; do not generate a new value for each session. See Rate limits. Session creation resolves and records the agent’s production version. Publishing a newer version does not affect new sessions until you promote it.

Preview the newest version

Set preview: true when your local application needs to test the newest unpromoted agent version end to end:
A preview session remains pinned to that version while normal sessions continue following production. Your application can use its existing event stream and custom-tool handler to execute real local tool code before promotion. Use a separate development subjectId so preview activity does not share a subject sandbox with production traffic.

Run a development tag

Use a development tag when local testing needs a stable name instead of always selecting the newest version:
The tag is resolved once during session creation. Moving or deleting the tag does not change existing sessions. Use a development-only subjectId so tagged sessions do not replace a production subject’s sandbox when their versions differ. If role is omitted, the session uses the agent version’s top-level tools configuration. If role is provided and the recorded agent version does not define that role, session creation returns 400 validation_error.

YOLO mode

Set yoloMode: true when a session should run without stopping for tool approval prompts. YOLO mode only auto-accepts tools whose resolved permission policy is always_ask; tools configured as always_deny or disabled with enabled: false are still denied before execution. Use it for trusted autonomous sessions where your product has already collected broad consent. Leave it unset or false when users should approve sensitive actions interactively.

Automatic titles

If you omit title, the agent automatically generates a short, descriptive title from the first exchange once the session’s first turn completes, and stores it on the session’s title. A title you provide here — or set later via update — is authoritative and is never overwritten. To react to the generated title in real time, watch for the session.title_updated event on the session’s event stream.

Prewarm an agent

Starts preparing an agent for a subject before a session exists. Otherwise, runtime acquisition begins with the session’s first turn. Prewarming always prepares the production version. Call it as soon as you know a conversation is likely to start — for example when the user opens your chat UI — then create the session as usual.
The request returns 202 Accepted immediately and preparation continues in the background. Relevant response fields are:
Prewarming is an idempotent hint, so it is always safe to call:
  • Repeated calls for the same agent and subject are safe.
  • No session or conversation history is created.
  • Use the same agentId and subjectId when creating the upcoming session.

List sessions

Get a session

Returns the session state, recorded agent version, metadata, timestamps, and the latest usage snapshot when the agent has completed at least one turn. Session usage aggregates token counts, model calls, and estimated cost across completed turns. It also stores context_max so UIs can show aggregate tokens as a percentage of the model context window. Per-turn context and latency are emitted on terminal events in the event stream for direct export to Langfuse or another observability backend.

Update a session

Updates the session title, YOLO mode, and/or metadata. The next approval decision reads the latest yoloMode value.
At least one of title, yoloMode, or metadata is required.

Archive a session

Archives an inactive session so it no longer appears in default session lists. Already archived sessions return the session response unchanged. Sessions with a running or waiting_on_human turn return 409.

Delete a session

Permanently deletes an inactive session and its event history. Sessions with a running or waiting_on_human turn return 409.
Response:

Endpoint summary

Errors

Last modified on August 19, 2026