Skip to main content
POST
Create Batch

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

file
file | null

The requests, JSONL: at most 5000 lines and 100 MB. Each line is {"custom_id", "method": "POST", "url": "/v1/chat/completions", "body"}, body a chat completion body whose model is openai/<model>, anthropic/<model>, mistral/<model>, amazon/<model>@eu or vertex/<model>@eu, the same on every line. An Amazon Bedrock batch needs at least 100 lines (AWS's minimum per job) and its line takes messages of text, max_tokens, temperature, top_p and stop only. A Vertex AI line takes the same fields and a batch has no minimum. An Anthropic line states no n, logprobs, response_format or cache_control, and its custom_id is 1 to 64 letters, digits, hyphens or underscores. A Mistral line takes messages (role and text content only), max_tokens, temperature, top_p, stop, n, presence_penalty, frequency_penalty and response_format. Required in a multipart request; a JSON request names an uploaded file in input_file_id instead.

metadata
string | null

A JSON object of up to 14 string pairs attached to the batch. The keys eden_batch_id and eden_request_id are reserved.

webhook_receiver
string | null

URL notified once the batch has finished and settled.

Response

Successful Response

A chat batch.

id
string
required

The batch id.

model
string
required

The model id every line of the batch named, as written: openai/<model>, anthropic/<model>, mistral/<model>, amazon/<model>@eu or vertex/<model>@eu, or an alias of it.

status
enum<string>
required

Where the batch is in its lifecycle.

Available options:
validating,
in_progress,
finalizing,
completed,
failed,
expired,
cancelling,
cancelled
created_at
integer
required

When the batch was created, Unix seconds.

object
string
default:batch

Always batch.

Allowed value: "batch"
endpoint
string
default:/v1/chat/completions

The endpoint every request of the batch calls.

request_counts
BatchRequestCounts · object

How many requests have finished, refreshed every few minutes.

metadata
Metadata · object | null

The key/value pairs given at create.

finished_at
integer | null

When the batch finished and settled, Unix seconds.

cost
string | null

What the batch billed, in US dollars, once it finished; null before. Each request that succeeded bills its tokens at the model's batch rates; a failed one, or one that never ran, bills zero. A request that succeeded with no token count bills an estimate at the same rates: its prompt tokens, the output its response shows and a reasoning allowance, the output never above the most the request could produce. A request the provider counts as completed with no result line bills the same estimate with no output shown. When the results cannot be read, every request that may have run bills that estimate.

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
error
string | null

Why the batch failed, when it did.

results_available
boolean
default:false

Whether GET /v3/batches/{batch_id}/results is sure to serve this batch, read from the stored batch with no call to the provider: it has finished, was created at the provider, its recorded provider status is ended, and it was created less than 30 days ago, less one hour (29 days on Anthropic, which keeps results for 29 days: jobs.results_promised_until); past it this reads false, and the results route still tries and answers 410 once the results are gone. False while the batch runs, and for a batch that ended before the provider accepted it. A batch settled past its deadline before the provider ended it reads false, and the results route checks the provider live and can still serve it.