Batches

Create a batch job

POST
/batches

Create a new batch job with the given input file and endpoint

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

endpoint*string

The endpoint to use for batch processing. Each line of the uploaded input file is dispatched against this endpoint.

  • /v1/chat/completions — chat completion batches
  • /v1/audio/transcriptions — audio transcription batches (e.g. openai/whisper-large-v3)
  • /v1/audio/translations — audio translation batches

Value in

  • "/v1/chat/completions"
  • "/v1/audio/transcriptions"
  • "/v1/audio/translations"
input_file_id*string

ID of the uploaded input file containing batch requests

completion_window?string

Time window for batch completion (optional)

priority?integer

Priority for batch processing (optional)

model_id?string

Model to use for processing batch requests

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/batches" \  -H "Content-Type: application/json" \  -d '{    "endpoint": "/v1/chat/completions",    "input_file_id": "string"  }'
{  "job": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "user_id": "string",    "input_file_id": "string",    "file_size_bytes": 0,    "status": "VALIDATING",    "job_deadline": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "endpoint": "string",    "progress": 0,    "model_id": "string",    "output_file_id": "string",    "error_file_id": "string",    "error": "string",    "completed_at": "2019-08-24T14:15:22Z"  },  "warning": "string"}