Cancel a Batch
POST
/v1/batches/{batch_id}/cancelOverview
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.
Parameters
batch_idpath · stringRequiredResponses
200The batch, cancelling or already finished.
application/json
idstringRequiredExample: "batch_abc123"
objectstringRequiredendpointstringRequirederrorsnullinput_file_idstringRequiredcompletion_windowstringRequiredstatusstringRequiredValues: "in_progress""finalizing""completed""expired""cancelling""cancelled"
output_file_idstring | nullerror_file_idstring | nullcreated_atintegerRequiredin_progress_atinteger | nullexpires_atinteger | nullfinalizing_atinteger | nullcompleted_atinteger | nullfailed_atnullexpired_atinteger | nullcancelling_atinteger | nullcancelled_atinteger | nullrequest_countsobjectRequiredShow nested fields
totalintegerRequiredcompletedintegerRequiredfailedintegerRequiredmetadataobject | null