Skip to content

Cancel Run

POST
/api/v3/projects/{project_id}/runs/{run_id}/cancel
curl --request POST \
--url https://example.com/api/v3/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel \
--header 'Content-Type: application/json' \
--data '{ "reason": "example" }'

Cancel a cancellable run and every pending checkpoint in one transaction.

project_id
required
Project Id
string format: uuid
run_id
required
Run Id
string format: uuid
X-Admin-Key
Any of:
string
Media typeapplication/json
RunCancelRequestV3
object
reason
Any of:
string
<= 500 characters
Examplegenerated
{
"reason": "example"
}

Successful Response

Media typeapplication/json
RunDetailResponseV3
object
agent_id
Any of:
string format: uuid
completed_at
Any of:
string format: date-time
cost_usd
Cost Usd
number
0
created_at
required
Created At
string format: date-time
current_approval_id
Any of:
string
error_message
Any of:
string
events
Events
Array<object>
RunEventResponseV3
object
created_at
required
Created At
string format: date-time
event_type
required
Event Type
string
id
required
Id
string format: uuid
payload
Payload
object
key
additional properties
any
sequence
required
Sequence
integer
status
required
Status
string
summary
Any of:
string
id
required
Id
string format: uuid
input_tokens
Input Tokens
integer
0
latency_ms
Latency Ms
integer
0
model_used
Any of:
string
output_tokens
Output Tokens
integer
0
project_id
required
Project Id
string format: uuid
request_metadata
Request Metadata
object
key
additional properties
any
response_id
Any of:
string
result
Result
object
key
additional properties
any
runtime_mode
required
Runtime Mode
string
session_id
Any of:
string format: uuid
started_at
Any of:
string format: date-time
status
required
Status
string
steps
Steps
Array<object>
RunStepResponseV3
object
attempt
Attempt
integer
default: 1 >= 1
completed_at
Any of:
string format: date-time
content_available
Content Available
boolean
created_at
required
Created At
string format: date-time
duration_ms
Any of:
integer
error_message
Any of:
string
guardrail_decisions
Guardrail Decisions
Array<object>
object
key
additional properties
any
id
required
Id
string format: uuid
input_summary
Input Summary
object
key
additional properties
any
metadata
Metadata
object
key
additional properties
any
name
required
Name
string
output_summary
Output Summary
object
key
additional properties
any
parent_span_id
Any of:
string
sequence
required
Sequence
integer
span_id
Any of:
string
started_at
Any of:
string format: date-time
status
required
Status
string
step_type
required
Step Type
string
surface
required
Surface
string
timing
RunTimingV3

Unambiguous active, wait, and end-to-end timing for one run.

object
active_ms
Active Ms
integer
0
approval_wait_ms
Approval Wait Ms
integer
0
end_to_end_ms
End To End Ms
integer
0
memory_ms
Memory Ms
integer
0
model_ms
Model Ms
integer
0
queue_wait_ms
Queue Wait Ms
integer
0
skill_ms
Skill Ms
integer
0
time_to_first_token_ms
Any of:
integer
tool_ms
Tool Ms
integer
0
trace_content_status
Trace Content Status
string
default: unavailable
trace_id
Any of:
string
user_id
Any of:
string format: uuid
Example
{
"cost_usd": 0,
"input_tokens": 0,
"latency_ms": 0,
"output_tokens": 0,
"steps": [
{
"attempt": 1,
"content_available": false
}
],
"timing": {
"active_ms": 0,
"approval_wait_ms": 0,
"end_to_end_ms": 0,
"memory_ms": 0,
"model_ms": 0,
"queue_wait_ms": 0,
"skill_ms": 0,
"tool_ms": 0
},
"trace_content_status": "unavailable"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}