Create batch

POST/v1/batches

Create an asynchronous batch job from a previously uploaded JSONL input file (purpose=batch). Token360 validates the file, ensures a single body.model across all lines, pins one provider route, and queues upstream submission.

MVP supports only endpoint=/v1/chat/completions and completion_window=24h.

See Batch Jobs for JSONL format and constraints.

Authentication

Authorization Bearer

Request Body

input_file_idstringrequired

File ID from POST /v1/files with purpose=batch.

endpointstring

Must be /v1/chat/completions (default if omitted).

completion_windowstring

Must be 24h (default if omitted).

callback_urlstring

Optional HTTPS URL for terminal-state webhook. Overrides account default batch webhook when set.

metadataobject

Optional key/value metadata stored on the batch object.

Response

idstring

Batch ID (batch_ prefix).

objectstring

batch

endpointstring

/v1/chat/completions

statusstring

validating, then in_progress, etc.

input_file_idstring

Input file ID.

output_file_idstring

Set when completed.

error_file_idstring

Set when partial failures or errors are written.

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.

expires_atinteger

Unix timestamp (created + 24h).

metadataobject

Echo of request metadata.

Common errors

batch_multiple_modelsMore than one distinct body.model in the input file.
batch_invalid_jsonlMalformed line or invalid fields.
batch_model_not_supportedModel has no batch-capable provider route.
batch_routing_unavailableNo active SKU for the model.

Request

1curl -X POST https://api.token360.ai/v1/batches \
2  -H "Authorization: Bearer sk-your-api-key" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "input_file_id": "file_abc123",
6    "endpoint": "/v1/chat/completions",
7    "completion_window": "24h",
8    "metadata": {"job": "nightly"}
9  }'

Response

JSON
1{
2  "id": "batch_01abc",
3  "object": "batch",
4  "endpoint": "/v1/chat/completions",
5  "status": "validating",
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": {"job": "nightly"}
14}
Was this page helpful?