POST

Authorizations

x-api-key
string
header
required

Body

application/json
agent
required

The agent the session runs: its aprf_ ID (its latest version), {"type": "agent", "id", "version"} to pin a version, or {"type": "agent_with_overrides", ...}, whose model, system and skills replace the agent's for this session only. Its tools and mcp_servers may only be [] (clear the list for this session); any other list is refused.

environment_id
string
required

ID of the environment the session runs in: an env_ environment, or an mch_ machine environment the agent may use. An unknown or archived environment is refused.

budget
object

Not supported on BMA: A non-null value is refused with 400 unsupported_session_option.

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.

initial_events
object[]

Not supported on BMA: A non-empty list is refused with 400 unsupported_session_option.

Send the first user.message to the session's events after creating it.

Parameters for sending a user message to the session.

metadata
object

Key-value strings stored with the session and returned as sent: at most 16 pairs, keys of 1 to 64 characters, values of at most 512 characters.

resources
object[]

What to mount in the session, at most 100 entries: file resources (an uploaded file, mounted below /mnt/session/uploads/) and memory_store resources (mounted at /mnt/memory/<store name>). A github_repository resource is refused with 400 unsupported_session_option.

Not supported on BMA: A github_repository resource is refused with 400 unsupported_session_option.

Mount a GitHub repository into the session's container.

title
string | null

Human-readable title. Omitted or null leaves the session untitled; an untitled session may be titled automatically after its first answered turn.

vault_ids
string[]

Vaults (vlt_ IDs) whose credentials the session's agent uses, at most 50, distinct, first vault first. Each must exist in the workspace and not be archived.

Response

The created session, idle and with no events yet.

A Managed Agents session.

id
string
required

ID of the session (ses_ followed by 26 lowercase base32 characters).

agent
object
required

The agent the session runs, snapshotted when the session was created: the agent version with the session's own model and system overrides and its skills with every version resolved. It never changes afterwards.

archived_at
string | null
required

When the session was archived (RFC 3339, UTC); null while it is not archived.

budget
object | null
required

Always null on BMA, which does not support session budgets.

created_at
string
required

When the session was created (RFC 3339, UTC, up to microsecond precision).

environment_id
string
required

ID of the environment the session runs in (env_, or mch_ for a machine environment); an empty string when the session was created without one.

metadata
object
required

The session's key-value metadata, {} when it has none.

outcome_evaluations
object[]
required

Always an empty list on BMA, which does not support outcomes.

resources
object[]
required

What the session mounts, in the order it was mounted: file and memory_store resources. BMA never mounts github_repository resources.

A resource mounted in a session: a file or a memory_store. BMA never mounts github_repository resources.

stats
object
required

Timing statistics in seconds. active_seconds: the time the session's turns ran, less the time they waited for a tool confirmation or custom tool result; time queued behind an earlier turn is not counted. duration_seconds: the time since the session was created, frozen when it terminated or was archived.

status
enum<string>
required

idle (no turn runs, also while the agent waits for a tool confirmation or custom tool result), running (a turn is queued or runs) or terminated (archived). BMA never reports rescheduling.

Available options:
rescheduling,
running,
idle,
terminated
title
string | null
required

The session's title; null while it has none. An untitled session may be titled automatically after its first answered turn.

type
string
required

Always session.

Allowed value: "session"
updated_at
string
required

When the session last changed (RFC 3339, UTC, up to microsecond precision).

usage
object
required

Cumulative usage of the session's model requests, updated when a turn ends: token counts, cache creation tokens and the list cost in US cents.

vault_ids
string[]
required

Vaults (vlt_ IDs) the session was created with, in order; empty when none.

deployment_id
string | null

The deployment whose run created the session; null for sessions created through this API.