Cancel batch

POST/v1/batches/{batch_id}/cancel

Request cancellation of an in-flight batch. The batch moves to cancelling, then cancelled.

  • Platform execution: Token360 stops remaining fan-out work locally. Successful lines already written may still be billed (usage_billing).
  • Provider execution: Token360 also calls the upstream cancel API when possible.

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

executionstring

Resolved path: provider | platform.

usage_billingobject

Aggregated usage billing when lines have been settled.

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.

Solicitar

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

Respuesta

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