Skip to content

Built-in agent

Agent sessions, their events, messages, budget and tool approvals.

On this page

Concepts: Built-in agent

Endpoint summaries come from the OpenAPI document.

GET/v1/agent/sessions

Built-in agent sessions of the team (full sign-in only)

Operation (MCP tool)
listAgentSessions
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectOptionalquerystring
limitOptionalqueryintegermin 1, max 100, default 50

Responses

Responses
StatusDescriptionBody
200OKobject
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/agent/sessions

Start the built-in agent: it builds and publishes a preview version. Spends agent credits up to the budget

Operation (MCP tool)
startAgentSession
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
Idempotency-KeyOptionalheaderstringReplays the first response for 24 hourslength 8–128

Request body

application/jsonobjectRequired

Request body
NameTypeDescription
promptRequiredstringmax length 8000
projectOptionalstringExisting project id or name
budgetCentsOptionalintegermin 50, max 5000

Responses

Responses
StatusDescriptionBody
201StartedAgentSession
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
402ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
409ProblemProblem (RFC 9457)
502ProblemProblem (RFC 9457)
503ProblemProblem (RFC 9457)

GET/v1/agent/sessions/{session}

One agent session

Operation (MCP tool)
getAgentSession
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
sessionRequiredpathstringSession id (`ags_…`)

Responses

Responses
StatusDescriptionBody
200OKAgentSession
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

GET/v1/agent/sessions/{session}/events

Conversation and progress of an agent session, oldest first; pass after=<seq> for new events

Operation (MCP tool)
listAgentEvents
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
sessionRequiredpathstringSession id (`ags_…`)
afterOptionalqueryintegermin 0
limitOptionalqueryintegermin 1, max 200

Responses

Responses
StatusDescriptionBody
200OKobject
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/agent/sessions/{session}/messages

Send a message to the agent

Operation (MCP tool)
sendAgentMessage
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
sessionRequiredpathstringSession id (`ags_…`)

Request body

application/jsonobjectRequired

Request body
NameTypeDescription
textRequiredstringmax length 8000

Responses

Responses
StatusDescriptionBody
200OKAgentSession
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
402ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
409ProblemProblem (RFC 9457)
502ProblemProblem (RFC 9457)

POST/v1/agent/sessions/{session}/interrupt

Stop what the agent is doing

Operation (MCP tool)
interruptAgentSession
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
sessionRequiredpathstringSession id (`ags_…`)

Responses

Responses
StatusDescriptionBody
200OKAgentSession
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
409ProblemProblem (RFC 9457)
502ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/agent/sessions/{session}/budget

Change the session budget; a paused session continues

Operation (MCP tool)
setAgentBudget
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
sessionRequiredpathstringSession id (`ags_…`)

Request body

application/jsonobjectRequired

Request body
NameTypeDescription
budgetCentsRequiredinteger

Responses

Responses
StatusDescriptionBody
200OKAgentSession
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
402ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
409ProblemProblem (RFC 9457)
502ProblemProblem (RFC 9457)

POST/v1/agent/sessions/{session}/confirmations/{event}

Allow or deny a command the agent is waiting on

Operation (MCP tool)
confirmAgentTool
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
sessionRequiredpathstringSession id (`ags_…`)
eventRequiredpathstringPending event id

Request body

application/jsonobjectRequired

Request body
NameTypeDescription
allowRequiredboolean
messageOptionalstringmax length 500

Responses

Responses
StatusDescriptionBody
200OKAgentSession
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
409ProblemProblem (RFC 9457)
502ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.