Cancel batch
Cancels an in-progress batch. The batch will be in status cancelling
for up to 10 minutes, before changing to cancelled
, where it will have partial results (if any) available in the output file.
Path parameters
-
The ID of the batch to cancel.
POST
/batches/{batch_id}/cancel
curl \
-X POST https://api.openai.com/v1/batches/{batch_id}/cancel \
-H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
"id": "string",
"object": "batch",
"endpoint": "string",
"errors": {
"object": "string",
"data": [
{
"code": "string",
"message": "string",
"param": "string",
"line": 42
}
]
},
"input_file_id": "string",
"completion_window": "string",
"status": "validating",
"output_file_id": "string",
"error_file_id": "string",
"created_at": 42,
"in_progress_at": 42,
"expires_at": 42,
"finalizing_at": 42,
"completed_at": 42,
"failed_at": 42,
"expired_at": 42,
"cancelling_at": 42,
"cancelled_at": 42,
"request_counts": {
"total": 42,
"completed": 42,
"failed": 42
},
"metadata": {}
}