Cancel batch (Beta)
Cancel a pending or processing batch job and release any held reservation when the provider confirms cancellation.
id returned by create, list, or status responses. native_batch_id is provider correlation metadata and should not be used in this endpoint unless it is identical to the gateway id.
OpenAI batches can be cancelled while they are still active. Completed, failed, cancelled, or expired batches are already terminal and are not sent to the provider again.
When cancellation succeeds, AI Stats refreshes and persists the terminal state, emits configured async webhook events, and releases held reservation amounts for voided work.Authorizations
Bearer token authentication
Path Parameters
The ID of the batch to cancel.
Response
Batch status response
Provider-native batch id when it differs from the gateway-owned id.
Normalized async lifecycle status for polling, websocket, and webhook consumers.
pending, running, completed, failed, cancelled, expired Coarse batch completion percentage derived from provider request counts when available. Completed batches report 100.
0 <= x <= 100WebSocket URL for subscribing to normalized async job lifecycle updates.
Sanitized async webhook configuration plus delivery state. Secrets are never returned; has_secret indicates whether signed deliveries are enabled. Signed deliveries include x-ai-stats-signature, x-ai-stats-timestamp, x-ai-stats-event-id, x-ai-stats-event-type, x-ai-stats-delivery-key, x-ai-stats-attempt, and x-ai-stats-max-attempts headers.