Overview
Submit, list, poll, and delete asynchronous batches of inference requests. See https://openrouter.ai/docs/batch-quickstart.Available Operations
- list - List batches
- createBatches - Create a batch
- delete - Delete a batch
- getBatches - Get a batch
list
Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page’slast_id as after. List items omit results. Use GET /batches/{id} to get them. See the Batch API Quickstart.
Example Usage
Standalone function
The standalone function version of this method:Parameters
Response
Promise<operations.ListBatchesResponse>Errors
createBatches
Creates a batch of requests that run asynchronously against a single endpoint (/v1/chat/completions, /v1/responses, /v1/messages, /v1/embeddings, /v1/audio/speech). Returns 202 with status: "validating". Poll GET /batches/{id} for progress and results. See the Batch API Quickstart.
Example Usage: chatCompletions
Standalone function
The standalone function version of this method:Example Usage: messages
Standalone function
The standalone function version of this method:Example Usage: providerPinned
Standalone function
The standalone function version of this method:Example Usage: responses
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.BatchObject>Errors
delete
Deletes a batch in a terminal status (completed, failed, expired, or cancelled) and its stored requests and results. Batches still in progress return 409. Billing and usage records are kept. See the Batch API Quickstart.
Example Usage
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.BatchDeletedObject>Errors
getBatches
Returns a batch with its status and request counts. Batches in a terminal status includeresults. Failed batches report the reason in error.message. See the Batch API Quickstart.