TL;DR — Switch in Under 5 Minutes
- Both APIs are OpenAI-compatible — change baseURL and key
- Railwail mirrors all major models OpenRouter offers (GPT-4o, Claude, Gemini, Llama, Mistral, DeepSeek)
- Railwail is EU-hosted with EUR billing — OpenRouter is US-default with USD
- Railwail has direct provider contracts (vs OpenRouter's mixed credit-pool approach)
- Cleaner pricing — per-model line items, no per-request overhead beyond FX
Why Move Off OpenRouter?
OpenRouter is one of the original AI aggregators. It works well for personal projects and US-based teams. The gaps for EU production teams: USD billing without VAT receipts, US-default routing, opaque pricing on some models (markup is applied silently), and no EU-only routing guarantee. Railwail addresses each of these — same OpenAI-compatible surface, but with EU residency, EUR invoices, and transparent per-token pricing.
Step 1 — Get a Railwail API Key
Sign up at railwail.com and generate a key.
Sponsored
Access 100+ AI Models with One API Key
GPT-4o, Claude, Gemini, Llama, Flux, DALL-E and more — all through a single, OpenAI-compatible endpoint. No more juggling multiple providers.
Step 2 — Change Base URL
TypeScript / JavaScript
Before (OpenRouter):
import OpenAI from "openai";
const or = new OpenAI({
apiKey: process.env.OPENROUTER_API_KEY,
baseURL: "https://openrouter.ai/api/v1",
defaultHeaders: {
"HTTP-Referer": "https://your-app.com",
"X-Title": "My App",
},
});
const res = await or.chat.completions.create({
model: "anthropic/claude-3.5-sonnet",
messages: [{ role: "user", content: "Hello" }],
});After (Railwail):import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.RAILWAIL_API_KEY,
baseURL: "https://api.railwail.com/v1",
});
const res = await client.chat.completions.create({
model: "claude-sonnet-4-6",
messages: [{ role: "user", content: "Hello" }],
});The OpenRouter-specific HTTP-Referer and X-Title headers are not needed — Railwail tracks usage per API key in the dashboard.Python
from openai import OpenAI
client = OpenAI(
api_key=os.environ["RAILWAIL_API_KEY"],
base_url="https://api.railwail.com/v1",
)
resp = client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "Hello"}],
)cURL
curl https://api.railwail.com/v1/chat/completions \
-H "Authorization: Bearer $RAILWAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "Hello"}]
}'API Endpoint Mapping
OpenRouter endpoint → Railwail equivalent
| OpenRouter | Railwail | Notes |
|---|---|---|
| POST /api/v1/chat/completions | POST /v1/chat/completions | Identical |
| POST /api/v1/completions | POST /v1/completions | Legacy |
| GET /api/v1/models | GET /v1/models | 275+ models |
| GET /api/v1/auth/key | GET /v1/keys/current | Key metadata |
| GET /api/v1/generation/{id} | GET /v1/usage/{id} | Per-call cost lookup |
Model Mapping
OpenRouter slug → Railwail slug
| OpenRouter | Railwail | Notes |
|---|---|---|
| openai/gpt-4o | gpt-4o | Same OpenAI model |
| openai/gpt-4o-mini | gpt-4o-mini | Same |
| anthropic/claude-3.5-sonnet | claude-sonnet-4-6 | Latest Sonnet |
| anthropic/claude-3.5-haiku | claude-haiku-4-6 | Latest Haiku |
| google/gemini-2.5-pro | gemini-2.5-pro | Same |
| meta-llama/llama-3.3-70b-instruct | llama-3.3-70b-instruct | Same |
| mistralai/mistral-large | mistral-large-2411 | Same |
| deepseek/deepseek-chat | deepseek-v3 | Same |
| deepseek/deepseek-r1 | deepseek-r1 | Same |
| x-ai/grok-2 | grok-2 | Same |
Sponsored
Test Any AI Model Instantly
Our built-in playground lets you compare models side by side. Find the perfect model for your use case in minutes, not days.
Pricing Comparison (per 1M tokens, May 2026)
Same upstream model, Railwail in EUR vs OpenRouter in USD
| Model | OpenRouter (USD) | Railwail (EUR) | Notes |
|---|---|---|---|
| gpt-4o input | $2.50 | EUR 2.30 | OpenAI passthrough on both |
| claude-sonnet-4-6 input | $3.00 | EUR 2.76 | Anthropic passthrough on both |
| claude-sonnet-4-6 output | $15.00 | EUR 13.80 | Same |
| gemini-2.5-pro input | $1.25 | EUR 1.15 | Google passthrough on both |
| llama-3.3-70b-instruct | $0.59 | EUR 0.54 | Open-source pricing parity |
| deepseek-v3 input | $0.49 | EUR 0.45 | Same |
Both aggregators charge close to the upstream provider's list price. Railwail's EUR billing eliminates the 1.5-2% FX margin many EU customers pay on USD invoices via their bank.
Why Railwail Over OpenRouter
- EU hosting with Frankfurt-region inference for low EU latency
- EUR billing with VAT receipts — clean accounting for EU entities
- Direct provider contracts on Anthropic, OpenAI, Google (vs OpenRouter's mixed routing)
- No required HTTP-Referer or X-Title headers
- Transparent per-token pricing — no hidden markup on rare models
- Built-in playground for model A/B testing in browser
- Spend caps, per-key rate limits, audit logs
FAQ
Is the model catalog the same?
OpenRouter has ~250 models, Railwail has ~275. The major frontier models are mirrored on both. Long-tail community fine-tunes may only be on one or the other — check railwail.com/models?search=<model> first.
What about OpenRouter's auto-routing and fallback?
Railwail supports explicit fallback rules in the dashboard (e.g. 'route Claude → GPT-4o on 5xx'). Auto-routing across providers based on cost/latency is on the roadmap; for now you pick the model per call.
Can I keep my OpenRouter credits?
OpenRouter credits are non-transferable. Run both providers in parallel during the migration — use up your OpenRouter balance while ramping up Railwail traffic.
Are usage statistics exportable?
Yes. Railwail dashboard exports per-model, per-key usage as CSV or via the /v1/usage API.
What about prompt caching?
Anthropic prompt caching (cache_control) and OpenAI prompt caching are both forwarded transparently. You get the same discount upstream.
Does it support structured output (json_schema)?
Yes. response_format with json_schema works for any model that supports it upstream (GPT-4o, Claude, Gemini, Llama 3.3).
Sponsored
Pay Only for What You Use
Transparent per-token pricing with no monthly minimums. Start with free credits and scale as you grow.
Next Steps
- Sign up at railwail.com
- Generate an API key
- Update baseURL to https://api.railwail.com/v1
- Translate slugs (drop the provider/ prefix)
- Read the reference at railwail.com/docs
- Browse models at railwail.com/models
- Compare pricing at railwail.com/pricing
- View providers at railwail.com/providers