Skip to main content
A session is a conversation you can keep appending events to. Compared with passing session_id to POST /v1/agents/run yourself, the sessions API lets you create, inspect, replay, and interrupt it explicitly.
Creating a session provisions no sandbox and costs nothing. The sandbox is provisioned on the first event, and billing follows events — not the existence of a session.

Create a session

string
required
Agent (Expert) identifier.
string
Session title. Defaults to “New Chat”.
string
Environment id. Resolved at every run, so editing the environment takes effect on the next event.
curl

Send an event (SSE)

string
default:"user.message"
Only user.message is supported today; anything else returns 400.
string
required
Message content.
string
Model override. Defaults to the platform model.
string[]
Up to 20 file ids returned by Files.
The response is an SSE stream with exactly the same event vocabulary as Invoke an Expert — both endpoints run through one shared execution path.
curl

Replay history

Returns the persisted user and assistant messages:
An unknown after cursor replays from the beginning rather than returning an empty page — empty would be indistinguishable from “caught up”. limit maxes out at 200.

Interrupt a run

Asks the runtime to stop generating. This is idempotent: interrupting a session with nothing running still succeeds, because the intent (“stop”) is already satisfied.

Other operations

Errors

Next steps

Environments

Define sandbox runtime and dependencies

Manage Agents

Create and publish Experts via API