POST /v1/sessions - Create a new session
POST /v1/sessions
Request Body required
Section titled “Request Body required ”Request to create a session
object
ID of the agent to work in this session (format: agent_{32-hex}).
Example
agent_01933b5a00007000800000000000001Session-level capabilities (additive to agent capabilities). Applied after agent capabilities when building RuntimeAgent.
Per-agent capability configuration
Associates a capability with an agent, including optional per-agent configuration. The config field allows the same capability to behave differently per-agent.
object
Per-agent configuration for this capability (capability-specific)
Reference to the capability ID
The ID of the LLM model to use for this session. Overrides the agent’s default model if specified.
Example
model_01933b5a00007000800000000000001Tags for organizing and filtering sessions.
Example
[ "debugging", "urgent"]Human-readable title for the session.
Example
Debug login issueResponses
Section titled “ Responses ”Session created successfully
Session - instance of agentic loop execution. A session represents a single conversation with an agent.
object
ID of the agent working in this session (format: agent_{32-hex}).
Example
agent_01933b5a00007000800000000000001Session-level capabilities (additive to agent capabilities). Applied after agent capabilities when building RuntimeAgent.
Per-agent capability configuration
Associates a capability with an agent, including optional per-agent configuration. The config field allows the same capability to behave differently per-agent.
object
Per-agent configuration for this capability (capability-specific)
Reference to the capability ID
Timestamp when the session was created.
Timestamp when the session finished (completed or failed).
Unique identifier for the session (format: session_{32-hex}).
Example
session_01933b5a00007000800000000000001LLM model ID to use for this session (format: model_{32-hex}). Overrides the agent’s default model if set.
Example
model_01933b5a00007000800000000000001Organization this session belongs to (format: org_{32-hex}).
Example
org_00000000000000000000000000000001Preview text from the last assistant response (truncated).
Preview text from the first user message (truncated).
Timestamp when the session started executing.
Current execution status of the session.
Tags for organizing and filtering sessions.
Human-readable title for the session.
Timestamp when the session was last updated.
Cumulative token usage for all LLM calls in this session.
object
Number of tokens written to cache (Anthropic-specific)
Number of tokens read from cache (reduces cost)
Number of input/prompt tokens
Number of output/completion tokens
Invalid agent ID
Internal server error