Migrate fromOpenRouter to AnonRouter
Both are OpenAI-compatible, so the move is a base URL and a key. Everything below is what our migration bench actually observed, request by request, through the official OpenAI SDKs: what ports unchanged, what is quietly ignored, and the short list that has to change.
from openai import OpenAI client = OpenAI( api_key=os.environ["ANONROUTER_API_KEY"], base_url="https://api.anonrouter.ai/v1",) client.chat.completions.create( model="anthropic/claude-sonnet-5", messages=[{"role": "user", "content": "Hello"}],)2 lines
The base URL and the key
Same slugs
creator/model ids resolve on both
Built for privacy
The code is public
Every component inside the attested enclave that can touch prompt or response plaintext is Apache 2.0 on GitHub. A privacy claim about a closed service is only ever a statement of intent.
Nothing is retained
Prompts and responses are never written to disk, and there is no router-side content logging switch that could be enabled later. The usage metadata we keep exists to settle your balance.
You can check it yourself
Pull the enclave's hardware attestation with the open-source SDK and compare it against the published build, so you confirm which code is handling your prompt rather than taking our word for it.
Or hand the whole thing
to your agent
One prompt carries the entire procedure below. Paste it into Claude Code, Codex, or Cursor, review the diff it produces, and you are done.
Four steps, and one of them is optional
No call, no migration plan to request. This is the whole procedure.
- 1
Create a compatibility-scoped key
In the dashboard, create an API key with compatibility mode enabled. That is the scope the OpenAI-compatible surface checks, and it is what lets an unmodified OpenAI SDK authenticate. A private account does not need an email address.
terminal# Dashboard -> API keys -> Create key -> enable compatibility export ANONROUTER_API_KEY=ar_... - 2
Point the SDK at AnonRouter
Swap the base URL and the key. Nothing else in the client construction changes, and both official OpenAI SDKs behave identically here.
javascriptimport OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.ANONROUTER_API_KEY, baseURL: "https://api.anonrouter.ai/v1" }); - 3
Check your model ids against the catalog
Public ids are creator/model slugs on both services, so overlapping models keep the same id. Anything you reach for that we have not added yet returns model_not_found rather than silently routing somewhere else. List what your key can actually call before you cut over.
terminalcurl https://api.anonrouter.ai/v1/models \ -H "Authorization: Bearer $ANONROUTER_API_KEY" - 4
Set a privacy floor, if you want one
This is the part with no OpenRouter equivalent. Routing filters to eligible privacy levels before it selects for capability or cost, and fails closed when nothing qualifies rather than falling back to a weaker route. minimum_privacy is an extension on the provider object you may already be sending.
json{ "model": "/auto", "messages": [{ "role": "user", "content": "Hello" }], "provider": { "minimum_privacy": "private", "allow_fallbacks": true } }
Port matrix
Every difference, accounted for
Replayed request by request through both official OpenAI SDKs against a live stack, verified August 7, 2026. Anything listed as working was observed working.
Works unchanged
Byte-for-byte the calls you already make.
- OpenAI SDK chat completions, streaming and non-streaming
- models.list
- stream_options.include_usage
- Tool-calling round trips
- response_format with json_schema
- reasoning_effort, reasoning.effort, and reasoning.enabled = false
- provider.order and provider.allow_fallbacks
- The :nitro and :floor model variants
- /auto routing
- Overlapping creator/model slugs, including openai/gpt-4o and anthropic/*
- The OpenAI error envelope and typed SDK exceptions
- Inline usage.cost on non-streaming responses
Accepted and ignored
Sent without error, with no effect. Safe to leave in your payload while you cut over.
- HTTP-Referer and X-Title headers
- transforms and route
- usage.include
- plugins
- n, logprobs, and logit_bias
- Legacy functions and function_call, which are stripped
Must change
Rejected with an error rather than ignored, so nothing changes behaviour behind your back.
provider.data_collection and provider.quantizations
Remove them. OpenRouter-only provider subkeys are rejected with a 400 rather than ignored, so a silent behaviour change is impossible.
reasoning.max_tokens and reasoning.exclude
Remove them, or use reasoning.effort. Both return a 400.
:free, :online, and :thinking model suffixes, and openrouter/auto
Use the plain slug, or /auto for automatic routing. The suffixed forms return model_not_found.
The models: [] fallback array
Use provider.order, or the compatibility broker path. On the direct path this returns models_fallback_unsupported_here.
Why switch
What you get on the other side
Source of the code handling prompts
AnonRouter
Yes. Apache 2.0, including every component that can touch plaintext.
OpenRouter
No. The gateway that receives your prompts is closed source.
Verifying the privacy claim
AnonRouter
Yes. Pull the enclave attestation with the SDK and check it against the published build.
OpenRouter
No. There is nothing to attest against, so the policy is the guarantee.
Prompt and response storage at the router
AnonRouter
Never. There is no content-logging switch to enable later.
OpenRouter
Possible. Content logging ships as an account setting, off by default.
Router-side use of inputs
AnonRouter
None. No training and no durable prompt categorization.
OpenRouter
Yes, by arrangement. A 1% discount is offered for data use, and prompts may be sampled.
End-to-end encrypted routes
AnonRouter
Yes, wherever the provider runs an enclave. The router holds no key.
OpenRouter
No. Prompts arrive at the gateway in plaintext.
Identity separated from request content
AnonRouter
Yes. A ticket flow splits account identity, plaintext, and provider credentials.
OpenRouter
No. One proxy, and every request stays attributable to your account.
Privacy floor on automatic routing
AnonRouter
Yes. /auto stays inside a privacy boundary and fails closed when nothing qualifies.
OpenRouter
No. Their docs state routing rules do not change based on a provider's retention policy.
Account without an email address
AnonRouter
Yes. Private accounts open with a recovery phrase instead of an inbox.
OpenRouter
No. Registration is required to get a key.
Platform fee
AnonRouter
5% with a $0.75 minimum during the launch promotion.
OpenRouter
Higher. 5.5% with a $0.80 minimum.
Migrating from OpenRouter
Change the base URL and go
Prepaid credits, no contract, and nothing to uninstall if you want to run both routers side by side first.

