Skip to main content
A session is a conversation with an agent. It records the latest 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 always resolves and records the agent’s latest version. Historical versions cannot be selected for a new session. 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. Session creation also begins this preparation automatically, but calling this endpoint earlier can reduce first-response latency. 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 July 29, 2026