Cancel a batch

Cancel an in-progress OpenAI-compatible batch. Already completed requests are not affected.

Path parameters

batch_idstringRequired
Batch ID.

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY for API key auth.

X-Data-Respan-ParamsstringOptional

Base64-encoded JSON object of Respan request parameters. Legacy X-Data-Keywordsai-Params is still accepted.

Request

This endpoint expects an object.

Response

Batch cancellation initiated.
idstring
Batch ID.
statusenum
objectstring
endpointstring
input_file_idstring
output_file_idstring or null
Output file ID, available when the batch completes.
error_file_idstring or null
Error file ID, when provider errors are available.
completion_windowstring
created_atinteger
Unix timestamp.
in_progress_atinteger or null
expires_atinteger or null
finalizing_atinteger or null
completed_atinteger or null
failed_atinteger or null
expired_atinteger or null
cancelling_atinteger or null
cancelled_atinteger or null
request_countsobject
metadatamap from strings to any
errorsany or null
Provider error details, when available.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error