Skip to main content
POST
Cancel an agent run

Headers

x-api-key
string
required

Path Parameters

id
string
required

The run id.

Response

The run.

An agent run.

completed_at
string | null

When the run reached a terminal state. Unset until then.

created_at
string
default:""

When the run was created, as an ISO 8601 timestamp.

id
string
default:""

Unique run id.

object
string
default:""

Object type, always "agent.run".

output
null | object

The run's output. Its members are unset until the run completes.

request
null | object

The request the run was created with.

started_at
string | null

When the run started. Unset while pending.

status
enum<string>
default:pending

Where the run is in its lifecycle.

Available options:
pending,
running,
completed,
failed,
cancelled
stop_reason
null | enum<string>

Why the run stopped. Set once the run reaches a terminal state.

Available options:
finished,
budget_reached,
timeout,
cancelled,
invalid_output,
internal_error