Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Batches

Create large batches of API requests to run asynchronously.

Cancel batch
Batch batches().cancel(BatchCancelParamsparams = BatchCancelParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/batches/{batch_id}/cancel
Create batch
Batch batches().create(BatchCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/batches
List batches
BatchListPage batches().list(BatchListParamsparams = BatchListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/batches
Retrieve batch
Batch batches().retrieve(BatchRetrieveParamsparams = BatchRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/batches/{batch_id}
ModelsExpand Collapse
class BatchError:
class BatchRequestCounts:

The request counts for different statuses within the batch.

class BatchUsage:

Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. Only populated on batches created after September 7, 2025.