Switch from OpenRouter in one line.
client = OpenAI( base_url="https://openrouter.ai/api/v1", base_url="https://rapidrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"], api_key=os.environ["RAPIDROUTER_API_KEY"],)# everything else stays as it isOne URL and a key. The rest stays.
- Base URL
https://rapidrouter.ai/api/v1 - A Rapid Router key, read from
RAPIDROUTER_API_KEY - Model ids, messages, tools, streaming and the
providerobject unchanged - The Anthropic SDK takes
https://rapidrouter.ai/api, without /v1
Run your test suite before you move production traffic: the response is the OpenAI shape on both sides, so a difference shows up there, not in front of a customer.
# pip install openai (the HTTP client package; every request goes to Rapid Router)
import os
from openai import OpenAI
client = OpenAI(
base_url="https://rapidrouter.ai/api/v1", # was https://openrouter.ai/api/v1
api_key=os.environ["RAPIDROUTER_API_KEY"], # was OPENROUTER_API_KEY
)
r = client.chat.completions.create(
model="openai/gpt-5",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)What maps 1:1. As you send it today.
vendor/modelMost OpenRouter ids work as sent. A Claude id written with a dot is read as ours: anthropic/claude-sonnet-4.5 runs as anthropic/claude-sonnet-4-5. A short list of other OpenRouter names map to the same release here, such as deepseek/deepseek-chat to deepseek-ai/deepseek-v3.
providerAll seven fields are read: order, only, ignore, allow_fallbacks, sort (price, throughput or latency, as a string or { by }), max_price (prompt and completion, in dollars per million tokens) and require_parameters.
:free :floor :nitro :online:floor sorts routes by price, :nitro by throughput, :online runs a web search first, and :free uses the free tier on models that offer it.
stream: trueServer-sent events in the OpenAI chunk shape. The last chunk carries usage with its cost, without asking for it through stream_options.
tools tool_choice parallel_tool_callsPassed to OpenAI-compatible providers as sent, and translated to Anthropic's tool format on Claude routes.
Tool calling →response_formatjson_object and json_schema. On Claude routes it runs as a forced tool call, so JSON mode works there too. The response-healing plugin repairs JSON that fails to parse.
{ type: "file" }The file content part, with file_data or file_url, on every chat model: Google and Anthropic models read the PDF itself, the others get its extracted text.
transforms: ["middle-out"] plugins: [{ id: "web" }]Middle-out drops messages from the middle of an over-long conversation so it fits the context window. The web plugin runs a search before the model answers; each search is billed.
Message transforms →HTTP-Referer X-TitleRecorded with every request. An app that sends both from a public domain, with at least 10 requests in 30 days, is listed on our Apps page.
App attribution →usage.cost GET /generation?id=Every chat completion names the provider that served it and carries usage.cost in dollars./generation returns total_cost and the token counts of a past request.
GET /modelspricing.prompt and pricing.completion as dollars per token, and context_length, next to our own per-million fields.
What differs. Read this before you switch.
models routeNot read: send one model per request and drop both fields. When a provider fails, the request already moves to the next provider serving the same model. A preset can name backup models; the first one with a working route is used.
data_collection zdr quantizationsDropped without effect. Zero data retention, and whether providers that may train on prompts can serve you, are account settings here, under Settings, Data & privacy, and apply to every request.
order only ignoreTake the provider names on our Providers page. A name we do not route to matches nothing, so an only list made of those leaves no route and the request answers 503.
500+ models, fewer than OpenRouter lists at the time of writing. An id with no same-version model here answers 404 model_not_found; we never swap in a neighbouring version. A model we do not carry can be asked for through support.
:freeModels that cost us nothing upstream are free to you: 50 requests a day per account, 1,000 a day once your paid usage reaches $10. Everything else, including older ids that end in :free, is billed at the provider price. :free on a model with no free route answers 400 model_not_free.
Tokens are billed at the provider list price, the same price per token as on OpenRouter. Our platform fee of 5% is charged once, when you buy credits, plus a 4% currency margin when you pay in rupees.
Pricing →Work here too: add them in your dashboard. A request served on your key is billed 5% of what it would have cost on ours.
Bring your own keys →@preset/slug presetRead the same way, but a preset belongs to an account: create yours here before you switch.
Presets →GET /creditsAnswers in our own shape, balance_usd and the latest transactions, so a script that reads your balance needs its field names changed.
The body carries { "error": { "code", "message" } } with a word for the code, such as model_not_found, and the number on the HTTP status. The OpenAI SDKs raise them as usual.
Where this page mentions OpenRouter, it reflects their public documentation at the time of writing; their product moves too, so check their site for the current state.
Same tokens, same price. Paid in rupees.
Top up in rupees with UPI or a card.
Your GSTIN goes on the invoice, so a GST-registered company can claim the GST as input tax credit.
The catalog shows every model in rupees, so finance reads one currency.
Support from a person, in your timezone.
Change the URL, then run your tests.
Create a key, point one service at https://rapidrouter.ai/api/v1, and compare the answers. Every new account starts with a free daily allowance on eligible models, so the first requests cost nothing.
Common questions.
How do I switch from OpenRouter to Rapid Router?
Will my OpenRouter model ids work?
Is Rapid Router cheaper than OpenRouter?
Can I pay in rupees?
Does Rapid Router have a free tier?
Can I move one service at a time?
Does the Anthropic SDK work?
Row by row, with the fees: Rapid Router vs OpenRouter.
Every endpoint and field: the docs.