LLM gateway

Every model, one endpoint

Send OpenAI- or Anthropic-format requests to one URL. Orrerie routes each call to Claude, GPT or Qwen3 4B on our own CPUs by the rules you set, falls back when a provider struggles, and shows you what every token cost in credits.

ClassifyPOST /v1/chat/completions "Label 2,000 support tickets by topic"
Routed to Qwen3 4B (local) by rule: task = classify, 184 ms
Gateway overhead p90
23 ms
Served on local CPUs
31%
Fallbacks, 24 h
1,204
Cache hit rate
38%

Drop-in compatible

Change the base URL. Keep your SDK.

The gateway speaks both the OpenAI Chat Completions and Anthropic Messages formats, including streaming, tool calls and vision. Pick a model by name, or let a route decide.

  • Streaming, tool use, JSON mode and images on every provider that supports them
  • Gateway overhead under 30 ms at p90, measured before the provider responds
  • One key, one bill, one log for every model
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.orrerie.ai/v1",
  apiKey: process.env.ORRERIE_KEY,
});

const res = await client.chat.completions.create({
  model: "route:support-default", // or "claude-sonnet-5-5"
  messages: [{ role: "user", content: ticket.body }],
  stream: true,
});
See a routed call

Every response tells you where it went and what it cost

Response headers carry the route, the model that answered, the fallback chain and the credits spent. The same numbers land in Logs and Usage.

zsh: api.orrerie.ailive
curl -si https://api.orrerie.ai/v1/chat/completions -d '{"model":"route:support-default","messages":[...]}'
HTTP/2 200
x-orrerie-route: support-default, rule 1 (task = classify)
x-orrerie-model: orrerie/local:qwen3-4b
x-orrerie-overhead-ms: 19
x-orrerie-credits: 0.31
{ "label": "billing / refund request", "confidence": 0.93 }
curl -si https://api.orrerie.ai/v1/chat/completions -d '{"model":"gpt-6.2-sol","fallback":["claude-sonnet-5-5"]}'
HTTP/2 200
x-orrerie-model: claude-sonnet-5-5
x-orrerie-fallback: gpt-6.2-sol (529 overloaded, 2.1 s)
x-orrerie-credits: 11.8

Models

Big models for hard problems, small local ones for the rest

31% of tokens in our beta workspace ran on local CPUs at a fraction of the cloud price.

ModelRuns onClassCredits per 1M tokens, in / outGood for
Claude Opus 5.5claude-opus-5-5AnthropicF5,200 / 26,000Hard reasoningLong agent runs
Claude Sonnet 5.5claude-sonnet-5-5AnthropicM2,600 / 13,000CodingTool useDefault
Claude Haiku 5.5claude-haiku-5-5AnthropicS130 / 650Fast repliesHigh volume
GPT-6.2 Astragpt-6.2-astraOpenAIF+10,400 / 52,000Frontier reasoning
GPT-6.2 Solgpt-6.2-solOpenAIM2,600 / 13,000General chatVision
GPT-6 Lunagpt-6-lunaOpenAIS130 / 650Cheap and fast
Qwen3 4B (local)orrerie/local:qwen3-4bOrrerie CPUsL200 / 1,000SummarizeClassifyExtract
Embeddings and rerank (local)embed.text, rerank.textOrrerie CPUstiny1 per 50K tokens / 1 per 50 docsRAGSearch
OCR (local)doc.ocr_pdf, doc.ocr_imageOrrerie CPUsmedium2 per pagePDF and image text

1 credit = $0.001. Cloud tokens are billed at the provider's list price plus 30%, with cache and batch discounts passed through; a nightly job checks rates against anthropic.com and openai.com. With your own key (BYOK) there is no token markup: routing costs 0.1 credit per request, and the first 10,000 requests a month are free on paid plans. Local models use the flat rates above; see pricing.

Control

Decide where every request goes, and what happens when it fails

Routing rules

Route by task, prompt length, user tier, cost ceiling or latency target. Rules are versioned, and you can send a share of traffic to a new route before switching.

route support-default
  when task in [classify, extract]  use local:qwen3-4b
  when has_image                   use gpt-6.2-sol
  when plan = enterprise          use claude-opus-5-5
  else                              use claude-haiku-5-5

Fallbacks

If a provider times out, rate-limits or returns an overload error, the call moves to the next model in the chain. Your code sees one response.

1GPT-6.2 SolOverloaded after 2.1 s
2Claude Sonnet 5.5Answered in 1.4 s
3Claude Haiku 5.5Not needed

Bring your own keys

Add your Anthropic or OpenAI key per workspace. Tokens bill to your provider account with no markup; Orrerie charges 0.1 credit per request and still handles routing, caching, fallbacks and logs. Keys are envelope-encrypted and never shown again.

sk-ant-Q7f2Verified

Caching

Exact-match responses are cached per workspace with a TTL you choose, and long shared prompts use the provider’s prompt caching automatically.

Of repeat support prompts in our beta workspace, 38% were served from cache, with no provider call and no tokens billed.

Route your first request in five minutes

Free plan includes 3,000 credits a month: local models, plus 500 credits for small cloud models (Haiku 5.5, GPT-6 Luna). No card needed.