Cancel a batch inference run
Request cancellation and return the current run state. Active work may report stopping before canceled. Returns 409 during payment, billing review, or output writing. Finished runs are returned unchanged.
Authorizations
Enter ApiKey <your-api-key> in Authorization, including the ApiKey prefix. In cURL and Python samples, <api-key> means this full value. The TypeScript SDK adds the prefix for you.
Path Parameters
ID of the batch inference run, with prefix bir..
^bir\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Body
The body is of type object.
Response
Updated Batch Inference Run
A batch inference run with its quote, progress, charge, and output location.
Reason the run is blocked: funds to reserve the budget, payment to settle usage, or billing_review for staff review; otherwise null.
funds, payment, billing_review Settled charge in US dollars as a decimal string, or null before a charge is recorded.
^(0|[1-9][0-9]*)(\.[0-9]+)?$Time the batch inference run was created, as an ISO 8601 timestamp.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$Dataset ID with prefix ds..
^ds\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Failure or cancellation details, or null when no error is recorded.
ID of the batch inference run, with prefix bir..
^bir\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Current status or billing explanation, or null when none is available.
How each row is processed. Defaults to single_turn: one model call per row, with the answer written as text. More modes may be added, so branch on type.
The model to use: a catalog base model or a model version in this project containing a LoRA adapter or full weights. More model types may be added, so branch on type.
- Option 1
- Option 2
Dataset and field where this run writes completions.
Latest generation progress while running or stopping; null in other states or when progress is unavailable.
Project ID with prefix pp..
^pp\.[0-9a-f]{8}-[0-9a-f]{4}-[7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$Price quote for confirmation, or null before a quote is ready.
Output counts and token usage, or null before results are available.
Generation settings used for each model call.
Run state from input preparation through confirmation, execution, and output writing; stopping is cancellation in progress, blocked requires action, and completed, failed, or canceled are terminal.
preparing, awaiting_confirmation, queued, running, writing_outputs, stopping, blocked, completed, failed, canceled Time the batch inference run was last updated, as an ISO 8601 timestamp.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$