Skip to main content
GET
Retrieve Batch

Authorizations

Authorization
string
header
required

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

Path Parameters

batch_id
string
required

The batch id: the id the create call returned.

Response

Successful Response

A chat batch.

id
string
required

The batch id.

model
string
required

The model every request runs on, openai/<model>.

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 OpenAI 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.