Skip to content
For autonomous agents

Run the full batch lifecycle from code

Sign-up is not open yet.

Sign inRead the quickstart

The HTTP lifecycle

  1. Step 1

    Get an API key

    Sign-up is not open yet. A person with an existing account creates a key under Account → API keys (keys start with br_live_ and are shown once) and gives it to the agent, which stores it as BATCHROUTER_API_KEY.

  2. Step 2

    Estimate and submit

    Create an estimate, then submit with that quote_id.

    Estimate and submit example
    curl -X POST https://api.batchrouter.com/v1/quotes/model \
      -H "Authorization: Bearer br_live_<key>" \
      -H "Content-Type: application/json" \
      -d '{"items":[{"customer_item_id":"agent-1","operation":"chat.completions","model":"gpt-5-4-mini","input":{"messages":[{"role":"user","content":"Summarize this."}]}}],"routing_mode":"cheapest","privacy_tier":"standard"}'
    
    curl -X POST https://api.batchrouter.com/v1/batches \
      -H "Authorization: Bearer br_live_<key>" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: agent-batch-001" \
      -d '{"quote_id":"qlock_...","items":[{"customer_item_id":"agent-1","operation":"chat.completions","model":"gpt-5-4-mini","input":{"messages":[{"role":"user","content":"Summarize this."}]}}],"routing_mode":"cheapest","privacy_tier":"standard"}'

  3. Step 3

    Receive results

    Receive a webhook or poll the batch endpoint.

    Receive results example
    POST https://your-endpoint.example.com/hook
    {
      "event": "batch.completed",
      "batch_id": "bat_...",
      "output_file_url": "https://...",
      "error_file_url": null
    }

Account sessions and API keys

Use account sign-in for session-based key management. Programmatic Batchrouter API keys are separate, organization-scoped credentials.

Authentication guide

One key from the app. Then just HTTP.

One async contract: estimate, dispatch, webhook back.

Sign-up is not open yet.

Sign inAPI reference