Batchrouter
Quickstart

Your first batch in 10 minutes

Sign up, create an API key, submit a JSONL batch, and receive results by webhook.

~10 min
6 steps
JSONL · webhook
  1. 1
    step 1 / 6

    Create an account

    Sign up and verify your email. Each new workspace ships with free credits so you can try the platform end-to-end before topping up.

  2. 2
    step 2 / 6

    Create an API key

    From the dashboard, go to Account → API keys and create a key. Store it as BATCHROUTER_API_KEY in your environment — keys are shown once.

  3. 3
    step 3 / 6

    Prepare a JSONL batch

    Each line is a single request. The format mirrors the OpenAI Batch input file, so existing JSONL works without conversion.

    batch.jsonl
    {"custom_id":"r-1","method":"POST","url":"/v1/chat/completions","body":{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Summarize: ..."}]}}
    {"custom_id":"r-2","method":"POST","url":"/v1/chat/completions","body":{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Summarize: ..."}]}}
  4. 4
    step 4 / 6

    Get a locked quote

    Upload the file to /v1/batches/quote. You receive a price across eligible provider lanes, locked for 10 minutes.

    shell
    curl https://api.batchrouter.dev/v1/batches/quote \
      -H "Authorization: Bearer $BATCHROUTER_API_KEY" \
      -F "file=@batch.jsonl"
  5. 5
    step 5 / 6

    Submit the batch

    Accept the quote to submit. Batchrouter routes to the cheapest eligible provider, retries transient failures, and notifies your webhook on completion.

    shell
    curl https://api.batchrouter.dev/v1/batches \
      -H "Authorization: Bearer $BATCHROUTER_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"quote_id":"qt_...","webhook_url":"https://example.com/hooks/batchrouter"}'
  6. 6
    step 6 / 6

    Receive results

    Your endpoint receives a signed batch.completed event with a download URL for the output JSONL. Verify the signature, then process the rows.

Where to next?

Dive into the API surface or wire up signed webhooks.