First morning of the season, fifteen minutes before the doors open. Sprocket's monitor has vanished under sticky notes: one API key per provider, and one more about where he left the others.
- Santa
Ho ho ho, doors open! Every toy idea, past every model, by tonight.
- Sprocket
On it! Five SDKs, five keys, five adapters. I've named them Dasher to Comet!
- Tinsel
Keep your OpenAI client. Change three values: the base URL, the key and the model name.
- Sprocket
So trying Anthropic is just... a different string?
- Tinsel
anthropic/claude-haiku-5-5. Same request, same response, so Dasher to Comet can go back to the stables.
- clientYour appOpenAI SDK
- orq.aiAI Routermy.orq.ai/v3/router
- model=model=provideropenai/gpt-6-lunaprovideranthropic/claude-haiku-5-5
How it works
Tinsel’s fix is three values in a client you already have.
- Base URL. Point the OpenAI SDK at
https://my.orq.ai/v3/router. It is the same for every organisation, workspace and project, and it does not vary by region. Self-hosted deployments serve/v3/routerunder their own hostname. - API key. Send your Orq key as
Authorization: Bearer $ORQ_API_KEY. Each key belongs to one project, and its requests are scoped to that project. - Model name. Write it as
provider/model, for exampleopenai/gpt-6-luna. To switch provider, change that string.
Request bodies, response bodies and streaming stay the same. Cost per call and traces work from the first request, with no further code.
Try it with curl
curl -X POST https://my.orq.ai/v3/router/responses \
-H "Authorization: Bearer $ORQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-4-neon",
"input": "Name a reindeer"
}'
Or from the OpenAI SDK
The same prompt on two providers, from one client:
from openai import OpenAI
import os
client = OpenAI(
base_url="https://my.orq.ai/v3/router",
api_key=os.environ["ORQ_API_KEY"],
)
models = ["openai/gpt-6-luna", "anthropic/claude-haiku-5-5"]
for model in models:
response = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Name a reindeer"}],
)
print(model, "->", response.choices[0].message.content)
Save it as two_models.py and run it with uv run --with openai python two_models.py. In Node the option is spelled baseURL, not base_url.
What the base URL serves
Most OpenAI routes work under /v3/router unchanged:
| Route | What for |
|---|---|
POST /chat/completions |
Chat |
POST /responses |
Responses API |
POST /embeddings |
Embeddings |
GET /models |
Model catalogue |
/batches |
Batch jobs. Download results from GET /batches/{batch_id}/results, not the OpenAI files endpoint |
Orq adds its own routes on the same URL, such as POST /rerank, POST /decisions and POST /ocr. Use /v3/router for new work. The older /v2/router/ paths stay published for backward compatibility.
Before the first call
Every model you call must be enabled on the Models page in the AI Gateway. The workspace also needs Orq credits or your own provider key. A call fails while it has neither.
When a call fails
A 404 means the model name is wrong. A 403 with permission_error means the model is not enabled. fallbacks does not help here, because the model is resolved before routing runs.
The Assistants API and fine-tuning are not available. /assistants and /fine_tuning/jobs return 404, so apps built on them cannot move over as they are.
Sending tools to /chat/completions with an OpenAI reasoning model and a reasoning_effort other than none returns 400. Use /responses for that case.
Nice list
- Enable every model your app calls on the Models page, not just the one you used for the first request.
- Check each model id against
GET /v3/router/models. A punctuation difference or a date suffix makes it a different model. - Leave Permissions on All for your first key. A Read only key, or a Restricted key without Responses write access, gets a
403on/v3/router/responses.
Naughty list
- Hunting for a regional or per-workspace base URL.
https://my.orq.ai/v3/routeris the same for every organisation, workspace and project, and it does not vary by region. - Pointing new code at
/v2/router/. Those paths stay only for backward compatibility./v3/routeris the current surface. - Pointing an Anthropic client at
/v3/router. Anthropic SDK code belongs onhttps://my.orq.ai/v3/anthropic. - Moving an app built on the Assistants API or fine-tuning.
/assistantsand/fine_tuning/jobsreturn404.
Elf's challenge
Pick a model from a provider you have never called, from GET /v3/router/models, and add it to your loop. How many lines of your code changed?
Stuck? Ask Tinsel for a hint
One: the model string. A 403 with permission_error means you still have to enable the model on the Models page. A 404 means the name is misspelled.
Christmas crackerHow many keys does it take to open an advent calendar?Pull it for the punchline
One. The model name picks which door opens.