Create a batch
Changed onCreates a batch of requests that run asynchronously against a single endpoint (/v1/chat/completions, /v1/responses, /v1/messages, /v1/embeddings, /v1/audio/speech, /v1/images/generations). Returns 202 with status: "validating". Poll GET /batches/{id} for progress and results. See the Batch API Quickstart.
Request
- Base URLhttps://openrouter.ai/api/v1
- AuthHTTP bearer
Request body
Batch submit request body.
HTTPS URL that receives a batch.completed, batch.failed, batch.cancelled or batch.expired webhook event when the batch reaches a terminal status. Must appear before requests in the request body.
A batch input file or table in your own storage, named in place of requests. Available to allowlisted callers on Google Vertex BYOK endpoints only.
Batch provider routing preferences. Only provider.only and provider.allow_fallbacks are supported.
The batch requests. Send exactly one of requests or input; requests must be the last field in the request body.
Example request
{
"input": {
"uri": "gs://my-bucket/batches/input.jsonl"
},
"provider": {
"only": [
"google-vertex"
]
}
}Response
Batch payload durably persisted and queued for asynchronous validation and provider submission (status: "validating").
Unix timestamp after which the assigned provider no longer completes unfinished requests. Derived from the provider's documented batch window, so it can exceed created_at plus completion_window (Google Vertex can take up to 96 hours). null when the provider documents no hard expiry.
The output location of a batch submitted with input, whose results are null. Returned only by GET /batches/{id}, once the batch has ended and the provider reported an output folder or table. Batch lists and responses for a batch with an unpaid charge leave it out.
Provider OpenRouter assigned to run the batch, using the same name as the provider field of sync responses.
Example response
{
"output": {
"uri": "gs://my-bucket/openrouter-batch/output/org_abc/batch_123/batch_123/prediction-model-2026-01-01T00:00:00.000000Z"
},
"results": [
{
"error": {
"error_type": "rate_limit_exceeded"
},
"response": {
"body": {
"alignment": {
"calls": [
{
"call": 1,
"outcome": "allowed",
"rules": [
{
"applicable": true,
"broken": false,
"probability": 0.04
}
]
}
]
},
"choices": [
{
"finish_reason": "stop",
"message": {
"annotations": [
{
"file": {
"content": [
{
"text": "Quarterly revenue grew 12%.",
"type": "text"
}
],
"hash": "abc123",
"name": "report.pdf"
},
"type": "file"
}
],
"reasoning_details": [
{
"summary": "The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...",
"type": "reasoning.summary"
}
]
}
}
],
"openrouter_metadata": {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"generation_time": 2016,
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
},
"safeguard_results": [
{
"status": {
"tool_uses": {
"call_abc": {
"explanation": "[Data Exfiltration]",
"outcome": "flagged",
"type": "evaluated"
},
"call_def": {
"outcome": "not_flagged",
"type": "evaluated"
}
},
"type": "available"
},
"type": "dangerous_tool_use"
}
]
}
}
}
],
"usage": {
"cache_creation": {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 100
},
"cost_details": {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
},
"iterations": [
{
"cache_creation": null,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"input_tokens": 50,
"output_tokens": 25,
"type": "compaction"
}
],
"speed": "standard"
}
}Changes
- info
added the new
Celerisenum value to the request propertyprovider/only/items/anyOf[#/components/schemas/ProviderName]
- info
- info
added the new
LangChainenum value to the request propertyprovider/only/items/anyOf[#/components/schemas/ProviderName]
- info