Skip to main content
POST
Python

Authorizations

Authorization
string
header
required

An Onecortex API key, oc_live_..., from API keys in the dashboard, or an access token, oc_oat_..., that an app received when a person allowed it to use one agent.

Path Parameters

agentId
string
required

The agent's ID, from its page in the dashboard.

Example:

"agt_01K0000000000000000000000"

Body

application/json

At most 1 MB. Carries a prompt, a resume, or both. Any other field reaches the agent unchanged, as params.

prompt
string

The input to the agent. Required unless the request carries resume.

sessionId
string

Your key for a conversation. Calls with the same one reach the same running instance. Generated when absent.

Required string length: 1 - 256
stream
boolean

True for server sent events. Absent, the Accept header decides.

messages
object[]

The conversation as you hold it, for an agent that reads history.

resume
object[]

The answer to a run that paused with an interrupt, on the same sessionId. Answers every interrupt, by its ID.

Minimum array length: 1
metadata
object

Anything the agent should see, at most 4 KB as JSON. Reaches the agent in params.

Response

The run completed, or paused with an interrupt. JSON, or a stream of events.

status
enum<string>
required
Available options:
completed,
interrupted,
failed
result
string
required

The whole reply. On a failed run, the text sent before it failed.

events
object[]
required

The tool calls, tool results and steps, in order. Text is in result.

One event of a run. Every event carries v, which is 1, and type.

sessionId
string
required
agentId
string
required
versionNumber
integer
required
requestId
string
required
durationMs
integer
required
interrupts
object[]

Present when status is interrupted. What the agent paused to ask.

error
object

Present when status is failed.

Last modified on October 1, 2026