Retrieve batch

GET/v1/batches/{batch_id}

Retrieve the current state of a batch job, including request_counts and output/error file IDs when available.

Poll until status is a terminal state: completed, failed, expired, or cancelled.

Authentication

Authorization Bearer

Path Parameters

batch_idstringrequired

Batch ID returned by POST /v1/batches.

Response

idstring

Batch ID.

objectstring

batch

endpointstring

/v1/chat/completions

statusenum<string>
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

Output JSONL file when completed.

error_file_idstring

Error JSONL file when present.

usage_billingobject

Aggregated usage billing after finalize (list vs charged amounts).

request_countsobject
request_counts.totalinteger
request_counts.completedinteger
request_counts.failedinteger
created_atinteger

Unix timestamp.

in_progress_atinteger

Unix timestamp when upstream started.

completed_atinteger

Unix timestamp when completed.

failed_atinteger

Unix timestamp when failed.

expired_atinteger

Unix timestamp when expired.

cancelled_atinteger

Unix timestamp when cancelled.

expires_atinteger

Estimated deadline (created + 24h). Platform jobs are not force-stopped at this time.

metadataobject

Stored metadata.

errorsobject

Validation or platform errors when failed.

errors.messagestring

Human-readable error message.

errors.codestring

Machine-readable error code.

errors.typestring

Error category when returned.

errors.stagestring

Processing stage where the error occurred.

errors.upstream_http_statusinteger

Provider HTTP status when the error came from upstream.

errors.upstream_messagestring

Provider error message when available.

Polling guidance

  • Non-terminal: poll every 30–60 seconds, or use webhooks.
  • completed: download output_file_id (and error_file_id if set).
  • failed / expired: inspect errors and error file.

Solicitar

1curl https://api.token360.ai/v1/batches/batch_01abc \
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": "completed",
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": "file_output_xyz",
12  "error_file_id": null,
13  "completion_window": "24h",
14  "request_counts": {
15    "total": 2,
16    "completed": 2,
17    "failed": 0
18  },
19  "created_at": 1710000000,
20  "in_progress_at": 1710000060,
21  "completed_at": 1710003600,
22  "expires_at": 1710086400,
23  "metadata": {
24    "job": "nightly"
25  },
26  "errors": null
27}
¿Ha sido de ayuda?