Documentation

One endpoint. Every model.

Iudex Route is one OpenAI-compatible URL that automatically routes each request to the cheapest model — across Claude, Gemini, GPT, Grok, DeepSeek, Llama, and more — that can actually answer it. You write your code once; we pick the model.

Quickstart

Three steps. About sixty seconds.

  1. Sign up at iudexroute.com/signup (1 month free — no card).
  2. Create a key in Dashboard → API keys. Copy it — we only show it once.
  3. Drop it into the snippet below.
from openai import OpenAI

client = OpenAI(
    base_url="https://api.acbm.ai/v1",
    api_key="acbm_…",   # the key you just created
)

resp = client.chat.completions.create(
    model="auto",       # let Iudex Route pick the right model
    messages=[{"role": "user", "content": "Summarize the EU AI Act in 3 bullets."}],
)
print(resp.choices[0].message.content)

That's it. Your request just got scored, routed to the cheapest model that can handle it (could be Claude, Gemini, GPT — depends on the question), and logged on your Usage page.

Why does the code use the OpenAI SDK?

Short answer: the OpenAI library is just the wire format. Your actual request can run on Claude, Gemini, Grok, DeepSeek, or Llama.

The OpenAI chat-completions protocol became the de facto standard — every modern client library speaks it. So Iudex Route accepts it too. You keep using the SDK you already know; we route the request to whichever provider answers best for the price.

Same trick works in TypeScript, Go, Ruby, curl — anywhere that can hit an HTTP endpoint with a Bearer token.

Where does the key live?

Anywhere that can make an HTTPS request with a Bearer header. Iudex Route logs every call against the key that made it, so the dashboard works the same regardless of where the snippet runs.

BACKEND

Your API server

Store the key in an env var (ACBM_API_KEY), use it from your Node/Python/Go service. Best for production apps that serve end users.

PERSONAL AGENT

Your laptop / a script

Drop the key into a .env file your agent reads, or export it in your shell. Perfect for a single-user research assistant.

CLI / NOTEBOOK

curl, Jupyter, one-offs

Inline the key or set OPENAI_API_KEY plus OPENAI_BASE_URL so existing tools pick it up.

Whichever you choose, your dashboard at /app/usage shows every call in real time — no SDK setup, no instrumentation, no extra step. Each routed request streams straight into the charts the moment it completes.

One key = one usage feed. If you want to separate experiments from production, make two keys — they each get their own line in the dashboard.

Authentication

Every request needs a Bearer token in the Authorization header:

Authorization: Bearer acbm_…

Keys are stored as SHA-256 hashes — we never see the raw value after creation. If you lose a key, revoke it and make a new one. There's no recovery flow on purpose.

Chat completions

The request body matches OpenAI's. Iudex Route adds two optional fields that change how routing happens:

  • model: "auto" — let the router pick. Recommended for most use cases.
  • domain_tag: "code" | "math" | "chat" | … — a hint that helps the difficulty scorer calibrate (e.g. code is usually harder than chat).

Want a specific provider? Pass its model name and we route straight through:

# Force Claude Sonnet
client.chat.completions.create(model="claude-sonnet-4-6", messages=[...])

# Force Gemini Pro
client.chat.completions.create(model="gemini-2.5-pro", messages=[...])

# Force GPT-5
client.chat.completions.create(model="gpt-5", messages=[...])

# Pin to a tier (router still picks which model within the tier)
client.chat.completions.create(model="acbm/t3", messages=[...])

The response is OpenAI-shaped with one extra block — acbm — that tells you what just happened:

{
  "id": "chatcmpl_…",
  "model": "claude-sonnet-4-6",
  "choices": [...],
  "usage": { "prompt_tokens": 412, "completion_tokens": 188 },
  "acbm": {
    "tier": "T3",
    "difficulty_score": 0.72,
    "difficulty_category": "hard",
    "provider": "anthropic",
    "verification_depth": "shallow",
    "cost_usd": 0.0041
  }
}

Models & providers

Iudex Route currently routes across seven providers. Pass model="auto" and forget about them, or target one directly using the model name on the right.

ProviderModels you can target
Anthropic (Claude)claude-haiku-4-5 · claude-sonnet-4-6 · claude-opus-4-7
Google (Gemini)gemini-2.5-flash-lite · gemini-2.5-flash · gemini-2.5-pro
OpenAI (GPT)gpt-4.1-nano · gpt-4.1-mini · gpt-5 · gpt-5-pro
xAI (Grok)available via router
DeepSeekavailable via router
Groqavailable via router
Together (Llama, Qwen, …)available via router

New models land here as providers ship them — usually within a week of release. You don't have to change your code; the router picks them up automatically.

The tier ladder

Every request gets a difficulty score (0–1). That score maps to one of five tiers. Cheap models handle easy work; the heavy hitters only get called when they're actually needed.

TierUsed forModelsCost / query
T0cached / templated answersserved from cache~$0
T1easy lookups, classificationclaude-haiku-4-5 · gemini-2.5-flash-lite · gpt-4.1-nano$0.01–0.05
T2standard chat, summarizationgpt-4.1-mini · gemini-2.5-flash$0.05–0.30
T3reasoning, code, long contextclaude-sonnet-4-6 · gpt-5 · gemini-2.5-pro$0.30–2.00
T4hardest reasoning, agentsclaude-opus-4-7 · gpt-5-pro · gemini-2.5-pro (deep think)$2.00–15.00

Pin a tier by passing model="acbm/t3" (or t0–t4). Useful when you already know the workload's difficulty and want to skip scoring.

Tracking usage

You don't have to do anything. Every request your key makes shows up on the Usage page within a second of completing — same dashboard whether the call came from your production backend, a notebook on your laptop, or a long-running agent.

What you see, live:

  • Daily spend and rolling 30-day total
  • Per-tier query distribution (so you can see how often the cheap tiers are catching work)
  • Latency and country of origin per request
  • The exact provider + model the router picked for each call

Need the data outside the dashboard? Every event lives in Postgres with your user_id on it. Pro plan adds CSV / Parquet exports; Scale adds a webhook on every event so you can pipe it into your own analytics warehouse.

Looking at the dashboard during a load test? Leave it open — it updates in place. No refresh.

Python SDK (optional)

If you'd rather not configure the OpenAI client, there's a tiny wrapper that hides the base URL and surfaces the acbm envelope as first-class fields:

pip install acbm

from acbm import ACBM
client = ACBM(api_key="acbm_…")     # or set ACBM_API_KEY
resp = client.chat("Summarize the EU AI Act in 3 bullets.")

print(resp.text)
print(resp.tier, resp.cost_usd, resp.difficulty_score)
# T2  0.00084  0.31

Errors & limits

Standard HTTP status codes. Anything 5xx that comes from an upstream provider isn't billed.

  • 401 — your key is invalid or has been revoked. Make a new one.
  • 402 — you've used up your monthly quota. Upgrade your plan, or wait for the 1st of the month.
  • 429 — short-burst rate limit. Back off and retry with jitter.
  • 502 — an upstream provider failed (OpenAI, Anthropic, etc.). We log it but don't charge you.

Limits: 256 KB request body, 64 messages per request, 200,000 characters total content.

Docs — Iudex Route