View as Markdown
Copy Markdown
Open in Claude
Open in ChatGPT
Batches
Create Batch
post/v1/messages/batches
List Batches
get/v1/messages/batches
Retrieve Batch
get/v1/messages/batches/{batch_id}
Cancel Batch
patch/v1/messages/batches/{batch_id}/cancel
ModelsExpand Collapse
BatchJob = object { id, agent_id, background, 15 more }
BatchJob = object { id, agent_id, background, 15 more }
id: string
id: string
The human-friendly ID of the Job
agent_id: optional string
agent_id: optional string
The agent associated with this job/run.
background: optional boolean
background: optional boolean
Whether the job was created in background mode.
callback_error: optional string
callback_error: optional string
Optional error message from attempting to POST the callback endpoint.
callback_sent_at: optional string
callback_sent_at: optional string
Timestamp when the callback was last attempted.
formatdate-time
callback_status_code: optional number
callback_status_code: optional number
HTTP status code returned by the callback endpoint.
callback_url: optional string
callback_url: optional string
If set, POST to this URL when the job completes.
completed_at: optional string
completed_at: optional string
The unix timestamp of when the job was completed.
formatdate-time
created_at: optional string
created_at: optional string
The unix timestamp of when the job was created.
formatdate-time
created_by_id: optional string
created_by_id: optional string
The id of the user that made this object.
Accepts one of the following:
"job"
"run"
"batch"
last_updated_by_id: optional string
last_updated_by_id: optional string
The id of the user that made this object.
metadata: optional map[unknown]
metadata: optional map[unknown]
The metadata of the job.
The status of the job.
Accepts one of the following:
"created"
"running"
"completed"
"failed"
"pending"
"cancelled"
"expired"
The reason why the job was stopped.
Accepts one of the following:
"end_turn"
"error"
"llm_api_error"
"invalid_llm_response"
"invalid_tool_call"
"max_steps"
"no_tool_call"
"tool_rule"
"cancelled"
"requires_approval"
total_duration_ns: optional number
total_duration_ns: optional number
Total run duration in nanoseconds
ttft_ns: optional number
ttft_ns: optional number
Time to first token for a run in nanoseconds
updated_at: optional string
updated_at: optional string
The timestamp when the object was last updated.
formatdate-time
BatchesMessages
List Messages For Batch
get/v1/messages/batches/{batch_id}/messages