Skip to content

API reference

The BatchRouter API is a single REST surface for routing batch-AI workloads across providers: get a quote, create a batch, then poll or receive results. This page is the reference hub — it covers the base URL and auth, links to the interactive reference and raw spec, and summarizes every public endpoint.

All public endpoints live under /v1.

EnvironmentBase URL
Productionhttps://api.batchrouter.com
Test / staginghttps://test.api.batchrouter.com

Authenticate by sending your API key as a bearer token on every request:

Terminal window
curl https://api.batchrouter.com/v1/auth/account \
-H "Authorization: Bearer $BATCHROUTER_API_KEY"

Keys start with br_live_ (legacy ob_live_ keys still work) and are shown only once at creation. Create one from the dashboard or via POST /v1/auth/account/api-keys, or get an org and key in a single call with POST /v1/auth/agent-register. Keep keys server-side. See Authentication for the full flow.

The interactive reference (Scalar) is generated directly from the live OpenAPI spec, so it is always current — when an endpoint, field, or response shape changes, the reference reflects it immediately. Treat it as the authoritative contract; the summary below is a map, not a substitute.

A compact map of the public endpoints. “Auth” shows whether a request needs your bearer key. Path parameters use {braces}.

MethodPathPurposeAuth
POST/v1/quotes/modelGet a free cost estimate and routing lanes before dispatchingBearer
POST/v1/filesUpload a file (large JSONL or binary input) for use in batch itemsBearer
POST/v1/batchesCreate a batch (inline items or input_file_id); send an Idempotency-KeyBearer
GET/v1/batches/{batchId}Poll a batch’s status (?include_billing_receipt=true optional)Bearer
GET/v1/batches/{batchId}/resultsPage through per-item results (?limit, ?cursor)Bearer
GET/v1/batches/{batchId}/artifact-urlGet a signed URL to download all results (preferred for large batches)Bearer
MethodPathPurposeAuth
GET/v1/catalog/modelsList models with per-provider pricing, capacity, regions, retention, and toolsNone
GET/v1/pricing/feesRead the public fee scheduleNone
MethodPathPurposeAuth
GET/v1/auth/accountRead account details, including credit_balanceBearer
POST/v1/auth/account/api-keysCreate an API key (value shown once)Bearer
POST/v1/auth/agent-registerRegister an org agent-first, no email — returns org_id + key onceNone
PUT/v1/auth/account/delivery-webhookSet the org-level default delivery webhookBearer

BatchRouter also exposes an OpenAI-Batch-compatible surface: point your existing OpenAI batch client’s base URL at BatchRouter and use a br_live_ key. BatchRouter is a routing and aggregation layer, not a passthrough — your batch is quoted, routed across lanes, and delivered through the same pipeline as a native batch. See the OpenAI compatibility guide for the exact paths and client setup.

Errors use standard HTTP status codes with a JSON error body.

StatusMeaningWhat to do
400Validation failed (see error.details.preflight — bad JSONL, unsupported file type, context window exceeded, unsafe webhook URL)Fix the input and retry
401 / 403Missing, invalid, or unauthorized keyCheck your Authorization header
402Insufficient creditsCheck GET /v1/auth/accountcredit_balance; add credits from the billing dashboard