batches

Retry failed and canceled requests

Retry a batch: failed AND canceled requests are reset to pending and will be processed again; completed work is never redone. Retrying a cancelled batch overturns the cancellation (cancel-then-retry acts as pause/resume), so this also succeeds on a just-cancelled batch whose requests had not yet settled. Use it after fixing transient issues, increasing rate limits, or to resume a cancelled batch.

post/batches/{batch_id}/retry

Path parameters

batch_idstring required

The batch ID returned when the batch was created.

Response

Requests queued for retry (or a cancellation was overturned and the batch resumed).

cancelled_atinteger nullable
cancelling_atinteger nullable
completed_atinteger nullable
completion_windowstring required

The requested processing window, or "background" for no-SLA spare-capacity processing.

created_atinteger required
endpointstring required
error_file_idstring nullable
expired_atinteger nullable
expires_atinteger nullable
failed_atinteger nullable
finalizing_atinteger nullable
idstring required
in_progress_atinteger nullable
input_file_idstring required
metadataobject nullable
modelstring nullable

Model alias used by this batch's requests, or "mixed" when the input file spans multiple models. Cached on the batch at creation time; absent on batches created before this field existed.

object'batch' required

Object type - always "batch"

output_file_idstring nullable
statusstring required

Example response

{
  "completed_at": 1703190800,
  "completion_window": "24h",
  "created_at": 1703187200,
  "endpoint": "/v1/chat/completions",
  "id": "batch-abc123",
  "input_file_id": "file-abc123",
  "object": "batch",
  "output_file_id": "file-xyz789",
  "request_counts": {
    "completed": 98,
    "failed": 2,
    "total": 100
  },
  "status": "completed"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.