Migrating from OpenRouter
Step-by-step guide to switching from OpenRouter to AllRoutes with a feature comparison and pricing advantages.
Overview
Migrating from OpenRouter to AllRoutes takes under 5 minutes. Both services use the OpenAI-compatible API format, so the switch is a two-line code change: update the base URL and swap your API key.
Step-by-Step Migration
1. Create an AllRoutes Account
Sign up at allroutes.ai and generate an API key from the dashboard. Keys are prefixed with allroutes_sk_.
2. Update Your Base URL
Replace the OpenRouter base URL with the AllRoutes endpoint:
| Setting | OpenRouter | AllRoutes |
|---|---|---|
| Base URL | https://openrouter.ai/api/v1 | https://api.allroutes.ai/v1 |
| API Key prefix | sk-or-... | allroutes_sk_... |
3. Update Your Code
Python
# Before (OpenRouter)
from openai import OpenAI
client = OpenAI(
api_key="sk-or-...",
base_url="https://openrouter.ai/api/v1",
)
# After (AllRoutes)
from allroutes import AllRoutesClient
client = AllRoutesClient(api_key="allroutes_sk_...")
# Or use the OpenAI SDK directly
from openai import OpenAI
client = OpenAI(
api_key="allroutes_sk_...",
base_url="https://api.allroutes.ai/v1",
)
Node.js
// Before (OpenRouter)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-or-...",
baseURL: "https://openrouter.ai/api/v1",
});
// After (AllRoutes)
import AllRoutes from "@allroutes/sdk";
const client = new AllRoutes({ apiKey: "allroutes_sk_..." });
// Or use the OpenAI SDK directly
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "allroutes_sk_...",
baseURL: "https://api.allroutes.ai/v1",
});
cURL
# Before
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer sk-or-..."
# After
curl https://api.allroutes.ai/v1/chat/completions \
-H "Authorization: Bearer allroutes_sk_..."
4. Transfer Your Provider Keys (BYOK)
If you have provider API keys configured in OpenRouter, add them to AllRoutes in the dashboard under Settings > Provider Keys. AllRoutes supports 9 providers.
5. Test and Verify
Run your existing test suite. The request and response formats are identical -- no other code changes are needed.
Feature Comparison
| Feature | OpenRouter | AllRoutes |
|---|---|---|
| Models available | Hundreds | 100+ |
| OpenAI-compatible API | Yes | Yes |
| BYOK (Bring Your Own Key) | Yes | Yes |
| BYOK commission | 5% | 0% (always free) |
| Credit expiration | Credits expire | Credits never expire |
| Semantic caching | No | 3-tier caching (40-80% savings) |
| PII redaction | No | Bidirectional PII redaction |
| Prompt injection detection | No | Built-in detection |
| Compliance profiles | No | HIPAA, SOC 2, GDPR, EU AI Act, PCI-DSS, FERPA |
| Broadcast / observability | Limited | 15+ destinations |
| Smart routing strategies | Basic | Cost, latency, throughput, A/B testing |
| Presets | No | Named configs with version history |
| Plugins | No | Web search, code interpreter, healing, and more |
| Self-hosted model support | No | Ollama, vLLM, TGI, custom endpoints |
| Official SDKs | None | Python, Node.js, Go |
Pricing Advantage
BYOK: 0% vs 5%
OpenRouter charges a 5% commission on requests made with your own provider keys. AllRoutes charges 0% commission on BYOK requests, always. If you spend $10,000/month through your own keys, that is $500/month in savings.
Credits Never Expire
AllRoutes credits have no expiration date. Buy credits when prices are favorable and use them whenever you need. OpenRouter credits expire after a set period.
Transparent Pricing
AllRoutes passes through provider pricing with a small, fixed platform fee only when using AllRoutes-managed keys. The fee is displayed on every model in the dashboard and API.
Model Name Compatibility
AllRoutes uses the same model identifiers as OpenRouter for most models:
| Model | Identifier |
|---|---|
| GPT-4o | gpt-4o |
| Claude Sonnet 4 | claude-sonnet-4-20250514 |
| Gemini 2.0 Flash | gemini-2.0-flash |
| Llama 3.1 405B | meta-llama/llama-3.1-405b-instruct |
| Mistral Large | mistral-large-latest |
For a full mapping, see the Models API.
Rollback Plan
Since both services use the OpenAI-compatible format, you can roll back to OpenRouter at any time by reverting the base URL and API key. No data migration is required.
See Also
- Quick Start -- get running on AllRoutes in 5 minutes
- OpenAI SDK Drop-in -- reuse your existing OpenAI code with one line change
- BYOK Guide -- configure provider keys for 0% commission
- Smart Routing -- optimize cost, latency, and reliability
- Caching -- a feature OpenRouter lacks; can save 40-80%