The letter reader speaks OpenAI, the toy sorter speaks Anthropic, and each has its own key, its own bill and its own provider. Santa wants one front door before the evening post.
- Santa
One front door for the whole workshop, by the evening post! And nobody learns a new language.
- Sprocket
Two apps, two SDKs! I'll rewrite the toy sorter in OpenAI by morning. And the letter reader in Anthropic, to be fair!
- Tinsel
Rewrite nothing. Give each SDK a new base URL and an Orq key.
- Santa
So the toy sorter can ask a GPT model? Splendid. I always want a second opinion on the naughty list.
- Tinsel
Fluently. Write the model as
provider/model_idand either SDK can ask anyone in the catalog.
- openai sdkLetter reader/v3/routeranthropic sdkToy sorter/v3/anthropic
- orq.aiAI Routerone key · one catalog
- provideropenai/gpt-6.2-solprovideranthropic/claude-sonnet-5-5
How it works
Tinsel’s migration changes three values per SDK: the base URL, the key and the model name. The AI Router accepts three wire formats: OpenAI Chat Completions, OpenAI Responses and Anthropic Messages.
- Base URL. The OpenAI SDK points at
https://my.orq.ai/v3/router. That one base URL serves both/chat/completionsand/responses. The Anthropic SDK points athttps://my.orq.ai/v3/anthropicand appends/v1/messageson its own. - Key. Use your Orq API key as the SDK key. The Anthropic endpoint accepts it as
Authorization: Beareror asx-api-key, the header the Anthropic SDK sends by default. - Model. Set
modelto a catalog id likeanthropic/claude-haiku-5-5. The same catalog applies to every endpoint, so any dialect can reach any provider. The model must be enabled on the Models page; otherwise the call returns403permission_error. - Same pipeline. All three run through one pipeline, so fallbacks, budgets, guardrails and traces apply to each. On
/v3/anthropic, fallbacks come from Routing Rules, not the request body. Your SDK gets back the response shape it expects.
Try it with curl
The Anthropic endpoint, calling an OpenAI model:
curl -X POST https://my.orq.ai/v3/anthropic/v1/messages \
-H "Authorization: Bearer $ORQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6.2-sol",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Say hello in three languages."}
]
}'
Or from the OpenAI SDK
One client speaks both OpenAI dialects. The Responses API can also keep state on the server:
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ["ORQ_API_KEY"],
base_url="https://my.orq.ai/v3/router",
)
# Chat Completions, with a Claude model
chat = client.chat.completions.create(
model="anthropic/claude-haiku-5-5",
messages=[{"role": "user", "content": "Name three reindeer."}],
)
print(chat.choices[0].message.content)
# Responses, continued on the server
first = client.responses.create(
model="openai/gpt-6-luna",
input="My wish is a red sled.",
)
follow_up = client.responses.create(
model="openai/gpt-6-luna",
previous_response_id=first.id,
input="What was my wish?",
)
print(follow_up.output_text)
Which API to use
| You want | Use |
|---|---|
| Existing OpenAI code, a classic messages flow | Chat Completions |
| Server-side state, built-in web search, reasoning with tools | Responses |
Existing Anthropic code, Claude cache_control breakpoints passed through unchanged |
Anthropic Messages |
Chat Completions sends the full history on every call. Responses can chain turns with previous_response_id. store defaults to true; with store: false there is nothing to continue from.
Gotchas
Fallbacks on the Anthropic endpoint. The request body’s fallbacks field is ignored there. Configure fallbacks for /v3/anthropic through Routing Rules.
Reasoning with tools. Sending tools to /chat/completions with an OpenAI reasoning model and a reasoning_effort other than none returns 400. Use /responses for that.
Not carried over. The Assistants API and fine-tuning are not part of the router: /assistants and /fine_tuning/jobs return 404.
Nice list
- Call any catalog model from either SDK, not only its own provider's. Set
modelto aprovider/model_idsuch asopenai/gpt-6.2-sol. - Mark long, stable prompts with Claude
cache_controlbreakpoints on/v3/anthropic. They pass through unchanged. - Pass
previous_response_idon the Responses API instead of resending the whole history. The earlier response must have been stored.
Naughty list
- Rewriting a working app in the other SDK just to reach a new provider. Change the base URL, the key and
modelinstead: three lines, not a rewrite. - Sending
fallbacksin the body to/v3/anthropic. That endpoint ignores the field: configure its fallbacks through Routing Rules. - Leaving out
modelon a Responses continuation. The model from the earlier turn is not reused, so set it every time. - Adding Claude
cache_controlbreakpoints and then calling a GPT model. On a non-Anthropic model they are ignored, not rejected: no error, and no cache.
Elf's challenge
Swap dialects: ask anthropic/claude-haiku-5-5 through the OpenAI SDK, then openai/gpt-6.2-sol through the Anthropic SDK. Where does the answer text live in each response?
Stuck? Ask Tinsel for a hint
chat.choices[0].message.content from Chat Completions, msg.content[0].text from Messages. The endpoint you call sets the response shape, not the model's provider.
Christmas crackerWhy did the Anthropic SDK start getting answers from GPT?Pull it for the punchline
New address, same accent.