Compatibility
OpenAI Batch JSONL, unchanged
Batchrouter accepts the same JSONL format as the OpenAI Batch API. Existing files work as-is.
Input
JSONL
drop in existing files
Endpoints
3
chat · embeddings · responses
Output
JSONL
preserves custom_id
Input format
batch.jsonl
Each line is a JSON object with custom_id, method, url, and body. Supported URLs include /v1/chat/completions, /v1/embeddings, and /v1/responses.
input.jsonl
{"custom_id":"r-1","method":"POST","url":"/v1/chat/completions","body":{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hi"}]}}Output format
output.jsonl
Results return as JSONL with one line per input, preserving your custom_id. Each line contains either a response body or a structured error, matching the OpenAI Batch shape.
result.jsonl
{"id":"resp_01","custom_id":"r-1","response":{"status_code":200,"body":{"choices":[{"message":{"role":"assistant","content":"Hello"}}]}},"error":null}What changes
- Base URL becomes
https://api.batchrouter.dev. - Authorization uses your Batchrouter API key.
- Submission is two steps: quote, then accept — locks the price before any provider work starts.
- Model names are routed across eligible providers — equivalents are quoted automatically.
Already on OpenAI Batch?
Point your existing JSONL at Batchrouter and ship the same file.