v1

latestOpenAPI 3.0.2MIT2026-07-24141061.6 KB
Batch

Cancel batch

Cancels a batch that is currently in progress. You can only cancel batches that are in validating or in_progress status. The batch status will change to cancelling for up to 10 minutes before transitioning to cancelled. At that point, partial results (if any) will be available in the output file, and any unfinished requests will be listed in the errors file.

post/batches/{batch_id}/cancel

Path parameters

batch_idstring required

The ID of the batch to cancel.

Response

Success. The Batch object matching the specified ID.

idstring

The batch identifier.

objectstring

The object type, which is always batch.

endpointstring

The endpoint used by the batch.

input_file_idstring

The ID of the input file for the batch.

completion_windowstring

The time frame within which the batch should be processed.

modelstring

The model used by the endpoint.

statusstring

The current status of the batch.

output_file_idstring

The ID of the file containing the outputs of successfully executed requests.

error_file_idstring

The ID of the file containing the outputs of requests with errors.

metadataobject

Set of key-value pairs attached to batch. This can be useful for storing additional information about the batch in a structured format.

created_atstring

RFC 3339 datetime string for when the batch was created.

in_progress_atstring

RFC 3339 datetime string for when the batch started processing.

finalizing_atstring

RFC 3339 datetime string for when the batch started finalizing.

completed_atstring

RFC 3339 datetime string for when the batch was completed.

failed_atstring

RFC 3339 datetime string for when the batch failed.

expected_completion_atstring

RFC 3339 datetime string for when the batch is expected to complete.

cancelling_atstring

RFC 3339 datetime string for when the batch started canceling.

cancelled_atstring

RFC 3339 datetime string for when the batch was canceled.