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
SetyoloMode: 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 omittitle, 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
The request returns
202 Accepted immediately and preparation continues in the
background. Relevant response fields are:
- Repeated calls for the same agent and subject are safe.
- No session or conversation history is created.
- Use the same
agentIdandsubjectIdwhen creating the upcoming session.
List sessions
Get a session
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
yoloMode value.
At least one of
title, yoloMode, or metadata is required.
Archive a session
waiting_on_human turn return 409.
Delete a session
waiting_on_human turn return 409.