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:

SettingOpenRouterAllRoutes
Base URLhttps://openrouter.ai/api/v1https://api.allroutes.ai/v1
API Key prefixsk-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

FeatureOpenRouterAllRoutes
Models availableHundreds100+
OpenAI-compatible APIYesYes
BYOK (Bring Your Own Key)YesYes
BYOK commission5%0% (always free)
Credit expirationCredits expireCredits never expire
Semantic cachingNo3-tier caching (40-80% savings)
PII redactionNoBidirectional PII redaction
Prompt injection detectionNoBuilt-in detection
Compliance profilesNoHIPAA, SOC 2, GDPR, EU AI Act, PCI-DSS, FERPA
Broadcast / observabilityLimited15+ destinations
Smart routing strategiesBasicCost, latency, throughput, A/B testing
PresetsNoNamed configs with version history
PluginsNoWeb search, code interpreter, healing, and more
Self-hosted model supportNoOllama, vLLM, TGI, custom endpoints
Official SDKsNonePython, 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:

ModelIdentifier
GPT-4ogpt-4o
Claude Sonnet 4claude-sonnet-4-20250514
Gemini 2.0 Flashgemini-2.0-flash
Llama 3.1 405Bmeta-llama/llama-3.1-405b-instruct
Mistral Largemistral-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%