Skip to main content
POST
Create Session
Every request requires ?beta=true.

Authorizations

X-Api-Key
string
header
default:sk-ant-local-default
required

OMA workspace API key.

Headers

anthropic-version
string
anthropic-beta
string

Query Parameters

beta
enum<boolean>
required

Selects the beta API contract for this endpoint. Must be true.

Available options:
true

Body

application/json

Request parameters for creating a session.

agent
required

Agent identifier. Accepts the agent ID string, which pins the latest version for the session, or an agent object with both id and version specified.

Example:

"agent_011CZkYpogX7uDKUyvBTophP"

environment_id
string
required

ID of the environment defining the container configuration for this session.

Required string length: 1 - 128
Example:

"env_011CZkZ9X2dpNyB7HsEFoRfW"

title
string | null

Human-readable session title.

Maximum string length: 500
Example:

"Order #1234 inquiry"

metadata
object

Arbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

resources
object[]

Resources (e.g. repositories, files) to mount into the session's container.

Mount a GitHub repository into the session's container.

Example:
vault_ids
string[]

Vault IDs for stored credentials the agent can use during the session.

initial_events
object[]

Initial events to send to the session at creation, processed in order. Supports user.message and user.define_outcome events. Maximum 50 events.

Parameters for sending a user message to the session.

Example:
budget
object

Enforced spend ceiling for the session. Omit to create an uncapped session. Every model the session can run — the agent's model and each callable agent's model — must have a public list price, or the request is rejected with reason model_not_budgetable.

Response

Successful response (OK)

A Managed Agents session.

type
enum<string>
required
Available options:
session
Example:

"session"

id
string
required
Example:

"sesn_011CZkZAtmR3yMPDzynEDxu7"

status
enum<string>
required

SessionStatus enum

Available options:
rescheduling,
running,
idle,
terminated
Example:

"idle"

created_at
string<date-time>
required

A timestamp in RFC 3339 format

Example:

"2026-03-15T10:00:00Z"

updated_at
string<date-time>
required

A timestamp in RFC 3339 format

Example:

"2026-03-15T10:00:00Z"

environment_id
string
required
Example:

"env_011CZkZ9X2dpNyB7HsEFoRfW"

title
string | null
required
Example:

"Order #1234 inquiry"

metadata
object
required
Example:
agent
object
required

Resolved agent definition for a session. Snapshot of the agent at session creation time.

Example:
resources
object[]
required
Example:
Example:
vault_ids
string[]
required

Vault IDs attached to the session at creation. Empty when no vaults were supplied.

Example:
outcome_evaluations
object[]
required

Per-outcome evaluation state. One entry per define_outcome event sent to the session.

Example:
usage
object
required

Cumulative token usage for the session.

Example:
stats
object
required

Timing statistics for the session.

Example:
archived_at
string<date-time> | null
required

When the session was archived. Null if not archived.

Example:

null

budget
object | null
required

The session's enforced spend ceiling, or null when no budget is set.

Example:

null

deployment_id
string | null

Deployment ID when the session was created from a deployment reference. Null otherwise.