Skip to content

Cancel a Batch

POST/v1/batches/{batch_id}/cancel

Overview

Stop a batch. Requests that have not started never run and are not charged; provider batches already submitted are cancelled with the provider, and whatever finished before that is kept and charged. The batch moves to cancelling, then cancelled with its result files. Requires llm.write.

Authorization

Authorizationstring · headerRequired

AudioLab API key sent as Bearer <token>. Authentication guide

Parameters

batch_idpath · stringRequired

Responses

200The batch, cancelling or already finished.
application/json
idstringRequired

Example: "batch_abc123"

objectstringRequired
endpointstringRequired
errorsnull
input_file_idstringRequired
completion_windowstringRequired
statusstringRequired

Values: "in_progress""finalizing""completed""expired""cancelling""cancelled"

output_file_idstring | null
error_file_idstring | null
created_atintegerRequired
in_progress_atinteger | null
expires_atinteger | null
finalizing_atinteger | null
completed_atinteger | null
failed_atnull
expired_atinteger | null
cancelling_atinteger | null
cancelled_atinteger | null
request_countsobjectRequired
Show nested fields
totalintegerRequired
completedintegerRequired
failedintegerRequired
metadataobject | null
401Invalid API key.
404Batch not found in this workspace.