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, resolves the execution path (auto / provider / platform), and queues work.

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

See Batch Jobs for JSONL format, dual execution, 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).

executionstring

auto (default) | provider | platform. auto prefers upstream Batch Infer when available, otherwise platform fan-out.

callback_urlstring

Optional HTTPS URL. POST when the batch reaches completed/failed/cancelled/expired. Overrides the console account webhook. See Webhook docs. Private/loopback URLs are rejected.

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.

execution_preferencestring

Requested path: auto | provider | platform.

executionstring

Resolved path: provider | platform.

fallback_from_providerboolean

True when auto fell back from provider to platform.

input_file_idstring

Input file ID.

client_modelstring

Public model name from the JSONL.

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

Estimated Unix timestamp (created + 24h). Display only on platform execution; jobs are not force-stopped at this time.

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 cannot run as a batch on this account (no eligible route).
batch_routing_unavailableNo active SKU for the model.
missing_execution_api_keyCreate with a session that cannot seal an inference API key Bearer (use an API key Authorization header).

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    "execution": "auto",
9    "callback_url": "https://your-app.example.com/webhooks/batch",
10    "metadata": {"job": "nightly"}
11  }'

Response

JSON
1{
2  "id": "batch_01abc",
3  "object": "batch",
4  "endpoint": "/v1/chat/completions",
5  "status": "validating",
6  "execution_preference": "auto",
7  "execution": "platform",
8  "fallback_from_provider": false,
9  "input_file_id": "file_abc123",
10  "client_model": "gpt-4o-mini",
11  "output_file_id": null,
12  "error_file_id": null,
13  "completion_window": "24h",
14  "request_counts": {"total": 2, "completed": 0, "failed": 0},
15  "created_at": 1710000000,
16  "expires_at": 1710086400,
17  "metadata": {"job": "nightly"}
18}
Was this page helpful?