Migration Guides

Migrate from OpenRouter to Railwail

Compare OpenRouter and Railwail. Both unify multiple AI models behind one API.

Railwail2 min read

Created with AI assistance.

Migrate from OpenRouter to Railwail
01 ยท Key takeaways

TL;DR โ€” Switch in Under 5 Minutes

  • Both APIs are OpenAI-compatible โ€” change baseURL and key
  • Railwail has direct provider contracts (vs OpenRouter's mixed credit-pool approach)

Try it on Railwail

Run Claude Sonnet 4.6

Anthropic$3.60/1M inBilled by actual usage

Anthropic's balanced mid-tier model from February 2026. Best price/performance for production workloads: 5x cheaper than Opus, near-flagship quality.

02

Why Move Off OpenRouter?

OpenRouter is one of the original AI aggregators. It works well for personal projects and US-based teams.

03

Step 1 โ€” Get a Railwail API Key

Sign up at railwail.com and generate a key.

04

Step 2 โ€” Change Base URL

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://railwail.com/api/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.

05

API Endpoint Mapping

OpenRouter endpoint โ†’ Railwail equivalent
OpenRouterRailwailNotes
POST /api/v1/chat/completionsPOST /api/v1/chat/completionsIdentical
GET /api/v1/modelsGET /api/v1/models200+ models
GET /api/v1/generation/{id}GET /api/v1/jobs/{id}Per-call cost lookup
06

Model Mapping

OpenRouter slug โ†’ Railwail slug
OpenRouterLive on RailwailRailwailNotes
openai/gpt-4o$3.00/1M ingpt-4ogpt-4oSame OpenAI model
openai/gpt-4o-mini$0.18/1M ingpt-4o-minigpt-4o-miniSame
anthropic/claude-3.5-sonnet$3.60/1M inclaude-sonnet-4-6claude-sonnet-4-6Successor
anthropic/claude-3.5-haiku$1.20/1M inclaude-haiku-4-5claude-haiku-4-5Successor
google/gemini-2.5-pro$1.50/1M ingemini-2-5-progemini-2.5-proSame
deepseek/deepseek-chat$0.36/1M indeepseek-v4-flashdeepseek-v4-flashSuccessor
deepseek/deepseek-r1$1.584/1M indeepseek-v4-prodeepseek-v4-proSuccessor
07

Why Railwail Over OpenRouter

  • Direct provider contracts on Anthropic, OpenAI, Google (vs OpenRouter's mixed routing)
  • No required HTTP-Referer or X-Title headers
  • Built-in playground for model A/B testing in browser
  • Spend caps, per-key rate limits, audit logs
08

FAQ

Is the model catalog the same?

OpenRouter has ~250 models, Railwail has 200+. 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 does not route or fall back automatically; 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 usage as CSV.

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).

09

Next Steps

  • Sign up at railwail.com
  • Generate an API key
  • Update baseURL to https://railwail.com/api/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
Live

Models in this article

Live prices from Railwail's current rules, October 7, 2026.

  • $3.60 / 1M input tokens$18.00/1M out
    1K in + 500 out tokens: โ‰ˆ $0.0126
    Try
  • GPT-4oOpenAI
    $3.00 / 1M input tokens$12.00/1M out
    1K in + 500 out tokens: โ‰ˆ $0.0090
    Try
  • $0.18 / 1M input tokens$0.72/1M out
    1K in + 500 out tokens: โ‰ˆ $0.00060
    Try
  • Gemini 2.5 ProGoogle DeepMind
    $1.50 / 1M input tokens$12.00/1M out
    1K in + 500 out tokens: โ‰ˆ $0.0075
    Try
  • $1.20 / 1M input tokens$6.00/1M out
    1K in + 500 out tokens: โ‰ˆ $0.0042
    Try
  • $0.36 / 1M input tokens$1.44/1M out
    1K in + 500 out tokens: โ‰ˆ $0.0011
    Try

โ‰ˆ billed by actual tokens or GPU time

Next step

Try Claude Sonnet 4.6 on Railwail

Sign in with Google for 10 free credits (usable 24 hours after sign-up, runs up to 2 credits), or top up from $5.00. Unused balance does not expire.

TopicsOpenRouterMigrationMulti-ModelAPIAggregator