Skip to main content
Create a session bound to an agent. Sessions accumulate turns, items, memory fragments, and subagent state across their lifetime. Post events to a session to run a turn.

Endpoint

Authentication

Authorization: Bearer <api_key> or Authorization: ApiKey <api_key>.

Request body

string
required
Identifier of the agent to bind this session to.
object
Free-form metadata stored with the session.

Response

string
Session identifier.
string
Always agent.session.
string
Bound agent identifier.
string
Session status, typically active.
object
Metadata provided at creation.
integer
Unix seconds.

Example