Batches

Create batch

Creates an OpenAI-compatible batch job.

post/v1/batches

Request

  • Base URL: https://api.tokenlab.sh
  • URL: https://api.tokenlab.sh/v1/batches
  • Auth: HTTP bearer

Headers

X-TokenLab-Delivery-Policy'auto' | 'verified' | 'official'

Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Verified first and may switch once to Official only before output, request acceptance, or persistent resource creation.

Request body

input_file_idstring required
endpoint'/v1/chat/completions' | '/v1/embeddings' required
completion_window'24h' required
metadataobject

Response

Batch created

idstring required
object'batch' required
endpoint'/v1/chat/completions' | '/v1/embeddings' required
errorsobject nullable
input_file_idstring required
completion_window'24h' required
status'validating' | 'queued' | 'in_progress' | 'finalizing' | 'completed' | 'failed' | 'cancelling' | 'cancelled' | 'expired' required
output_file_idstring nullable
error_file_idstring nullable
created_atinteger required
in_progress_atinteger nullable
expires_atinteger nullable
finalizing_atinteger nullable
completed_atinteger nullable
failed_atinteger nullable
expired_atinteger nullable
cancelling_atinteger nullable
cancelled_atinteger nullable
metadataobject nullable

Example response

{
  "id": "batch_abc123"
}

Changes

No recorded changes to this operation across all 1 revision of this API.