Agents

Run an agent

POST /v1/agents/{agent_id}/sessions
Permission
write:sessions
Tokens
API key, CLI user token, Sandbox token

Start a one-shot session from a saved Claude Code agent. Supply input when it declares an input schema; otherwise supply prompt. Send exactly one.

Path parameters

agent_idstringrequired
{
"budget": float,
"prompt": str
}

Request

budgetnumber

Tighten this run's spend cap, in US dollars. May only lower the agent's own session budget; a higher number, or one above the organization's ceiling, is a 400.

inputobject

The typed payload for an agent that declares input.json_schema. Required when the agent declares a schema; rejected when it does not. Validated against the schema and rendered through input.message, or as formatted JSON if no template is set. The rendered message must be non-empty. Cannot be combined with prompt.

metadatadefault {}object

Arbitrary string key/value metadata stored on the session.

promptstring

The initial user message, passed verbatim to Claude. Required when the agent declares no input.json_schema; rejected when it does. Must contain non-whitespace text and cannot be combined with input.

Response

sessionSessionrequired

The session.

On this page

No Headings
Schedule a demo