Only models whose catalog entry has
supports_batching: true can be batched. Today
these are OpenAI models (for example openai/gpt-5.4, openai/gpt-4o-mini). Check the
flag in GET /v1/models. Any other model returns 400 model_not_supported_for_batching.
Batches always run on Mesh’s platform credentials, never on your BYOK keys.Workflow
- Prepare a request bundle
- Create a batch with
POST /v1/batches - Poll
GET /v1/batches/{batch_id}— results are included inline once complete
1 & 2. Create the batch
Pass your requests inline — no separate file upload required.- curl
- Node.js SDK
- Python SDK
- Go SDK
- Java SDK
Request item fields
Each entry inrequests supports:
The batch create call also accepts an optional
metadata object (arbitrary key-value pairs) alongside completion_window.
Limits
- A batch may not mix models — all requests must target the same model, or the create call returns
400 mixed_models. - You can have at most 10 batches in a non-terminal state at once; an eleventh returns
429 batch_limit_exceeded.
3. Poll and read results
Poll untilstatus is a terminal value. When completed, the response includes a results array — no separate file download needed.
results; they come back in a separate
errors_detail array, each entry carrying its custom_id and the error. Both
arrays are only returned once the batch is completed.
Common statuses:
validatingin_progressfinalizingcompletedfailedcancellingcancelledexpired
Notes
- All requests in a batch must use the same model.
- Batch jobs are best for throughput, not low-latency interactive use.
- Use
GET /v1/batchesto list recent batches andPOST /v1/batches/{batch_id}/cancelto cancel one. - Results are matched by
custom_id— the output order is not guaranteed.
Batch statuses
Cancelling a batch
cancelling and eventually cancelled. Partial results may still be available.
Listing batches
after (batch ID) and limit (1–100, default 20) query parameters.
List rows are a summary: id, status, model, file IDs and timestamps. They
don’t carry request_counts or results; fetch a batch by ID for those.
When to use batching
- Large-scale data processing — summarizing, classifying, or translating thousands of documents
- Overnight jobs — non-urgent workloads that can run during off-peak hours
- Throughput without client-side orchestration — submit thousands of requests in one call. Batch requests are billed at the model’s standard (on-demand) rates, not a discounted batch rate