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
batches.cancel(strbatch_id) -> Batch
POST/batches/{batch_id}/cancel
Create batch
batches.create(BatchCreateParams**kwargs) -> Batch
POST/batches
List batches
batches.list(BatchListParams**kwargs) -> SyncCursorPage[Batch]
GET/batches
Retrieve batch
batches.retrieve(strbatch_id) -> Batch
GET/batches/{batch_id}
ModelsExpand Collapse
class Batch:
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.