Cancel batch

POST/v1/batches/{batch_id}/cancel

Request cancellation of an in-flight batch. The batch moves to cancelling and Token360 calls the upstream cancel API when possible. Terminal state becomes cancelled when upstream confirms.

Already terminal batches (completed, failed, expired, cancelled) return the current object unchanged.

Authentication

Authorization Bearer

Path Parameters

batch_idstringrequired

Batch ID to cancel.

Response

idstring

Batch ID.

objectstring

batch

endpointstring

/v1/chat/completions

statusenum<string>

Usually cancelling or cancelled.

input_file_idstring

Input file ID.

output_file_idstring

Output JSONL file when already completed.

error_file_idstring

Error JSONL file when present.

completion_windowstring

24h

request_countsobject

total, completed, failed counts when available.

request_counts.totalinteger

Total number of requests in the batch.

request_counts.completedinteger

Number of completed requests.

request_counts.failedinteger

Number of failed requests.

created_atinteger

Unix timestamp.

cancelled_atinteger

Unix timestamp when cancellation is complete.

expires_atinteger

Unix timestamp deadline.

metadataobject

Stored metadata.

Request

1curl -X POST https://api.token360.ai/v1/batches/batch_01abc/cancel \
2  -H "Authorization: Bearer sk-your-api-key"

Response

JSON
1{
2  "id": "batch_01abc",
3  "object": "batch",
4  "endpoint": "/v1/chat/completions",
5  "status": "cancelling",
6  "input_file_id": "file_abc123",
7  "output_file_id": null,
8  "error_file_id": null,
9  "completion_window": "24h",
10  "request_counts": null,
11  "created_at": 1710000000,
12  "expires_at": 1710086400,
13  "metadata": {
14    "job": "nightly"
15  }
16}
Was this page helpful?