Cancel a batch

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

Authentication

AuthorizationBearer

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

Path parameters

batch_idstringRequired
Batch ID.

Headers

X-Data-Respan-ParamsstringOptional

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

Query parameters

provider_idstringRequired

Provider route with customer-owned credentials, for example openai or parasail.

Request

This endpoint expects an object.

Response

Batch cancellation initiated.
idstring
Batch ID.
statusenum
objectstringOptional
endpointstringOptional
input_file_idstringOptional
output_file_idstring or nullOptional
Output file ID, available when the batch completes.
error_file_idstring or nullOptional
Error file ID, when provider errors are available.
completion_windowstringOptional
created_atintegerOptional
Unix timestamp.
in_progress_atinteger or nullOptional
expires_atinteger or nullOptional
finalizing_atinteger or nullOptional
completed_atinteger or nullOptional
failed_atinteger or nullOptional
expired_atinteger or nullOptional
cancelling_atinteger or nullOptional
cancelled_atinteger or nullOptional
request_countsobjectOptional
metadatamap from strings to anyOptional
errorsany or nullOptional
Provider error details, when available.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error