Migrate from OpenRouter
Moving from OpenRouter?Keep your SDK. Bring your own keys.
Change the base URL and key, set model to a workflow, and your fallbacks, structured output and budget live in one place you can roll back.
- BYOK
- no token markup
- Free plan stops at 25,000 requests/month
2 lines of code + 1 workflow
Keep your OpenAI SDK. On the client line, change the base URL and key. On the request line, set model to the name of a workflow.
Step 0: create a workflow in the console with your primary model and backups. Its name is what you send as model.
Before
import os
from openai import OpenAI
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key=os.environ["OPENROUTER_API_KEY"],
)
resp = client.chat.completions.create(
model="openai/gpt-4o",
extra_body={"models": ["anthropic/claude-sonnet-5", "google/gemini-3.5-flash"]},
messages=[{"role": "user", "content": "Summarize this ticket."}],
)
print(resp.choices[0].message.content)After
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.modelriver.com/v1",
api_key=os.environ["MODELRIVER_API_KEY"],
)
resp = client.chat.completions.create(
model="support_bot", # workflow: gpt-4o + 2 backups
messages=[{"role": "user", "content": "Summarize this ticket."}],
)
print(resp.choices[0].message.content)Before
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://openrouter.ai/api/v1",
apiKey: process.env.OPENROUTER_API_KEY,
});
const resp = await client.chat.completions.create({
model: "openai/gpt-4o",
// OpenRouter extension, not in the OpenAI SDK types
...{ models: ["anthropic/claude-sonnet-5", "google/gemini-3.5-flash"] },
messages: [{ role: "user", content: "Summarize this ticket." }],
});
console.log(resp.choices[0].message.content);After
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.modelriver.com/v1",
apiKey: process.env.MODELRIVER_API_KEY,
});
const resp = await client.chat.completions.create({
model: "support_bot", // workflow: gpt-4o + 2 backups
messages: [{ role: "user", content: "Summarize this ticket." }],
});
console.log(resp.choices[0].message.content);Before
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o",
"models": ["anthropic/claude-sonnet-5", "google/gemini-3.5-flash"],
"messages": [{"role": "user", "content": "Summarize this ticket."}]
}'After
curl https://api.modelriver.com/v1/chat/completions \
-H "Authorization: Bearer $MODELRIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "support_bot",
"messages": [{"role": "user", "content": "Summarize this ticket."}]
}'What maps to what
OpenRouter concepts and where they live in ModelRiver.
| OpenRouter | ModelRiver |
|---|---|
model: "openai/gpt-4o" | model: "support_bot", the name of a workflowYou stop choosing the model per request. The workflow picks it, and changing it does not touch your code. |
models: [...] fallback array | Workflow primary model plus up to 2 backup modelsThree models per workflow. A longer chain has no direct equivalent today. |
@preset/your-slug | A workflow, with Draft and Live releasesBoth are named server-side configs. A workflow keeps a Live version for production while you edit a Draft. |
provider object (order, sort, only, ignore) | No equivalentEach workflow slot names one provider and one model. There is no sorting by price, latency or throughput. |
openrouter/auto | No equivalentYou choose the models in each workflow. ModelRiver does not pick a model for you. |
response_format with a JSON schema in each request | Structured output attached to the workflowNative schema mode for OpenAI, Anthropic, xAI, Mistral and Cohere models. |
| Credits, or your provider keys added to OpenRouter | Your provider keys, stored in the projectEvery call uses your key. Your provider bills you directly. |
Response model shows the model that answered | Response model is the workflow nameRequest logs and the request timeline show which model and provider ran, and the cost estimate. |
Map your config
Your fallbacks, output shape and budget move into one named workflow.
Your current OpenRouter request
{
"model": "openai/gpt-4o",
"models": ["anthropic/claude-sonnet-5", "google/gemini-3.5-flash"],
"response_format": { "type": "json_schema", "json_schema": { "name": "ticket", "schema": { "...": "..." } } },
"messages": [{ "role": "user", "content": "Summarize this ticket." }]
}ModelRiver
The same setup as a ModelRiver workflow
- Primary
- openai/gpt-4o
- Backup 1
- anthropic/claude-sonnet-5
- Backup 2
- google/gemini-3.5-flash
- Structured output
- ticket (JSON schema, saved once)
- Budget
- $50 per day on the primary model
- Release
- Draft → Live, roll back any time
Try it with your keys. The Free plan stops at 25,000 requests a month instead of charging overage. Model usage is billed by your provider on your own keys.
Create a workflow freeWhen to stay where you are
OpenRouter may suit you better if any of these matter most.
You want one balance that pays for every model, without opening an account with each provider.
You pick models per request, use
openrouter/auto, or switch between many models often. ModelRiver needs a workflow created for each setup first.You rely on provider routing: sorting by price, latency or throughput,
only/ignorelists, or routing only to zero-data-retention endpoints.You use free model variants, image or audio models, or the Responses API.
You need SSO, audit logs, OpenTelemetry export. ModelRiver does not offer these yet.
What you gain, what you give up
What you gain
- No token markup and no fee on model usage. Your provider bills tokens on your own key; ModelRiver bills a flat plan by request volume.
- Fallbacks, structured output, input guardrails and budgets live on the workflow, with Draft and Live releases, so a model change is a publish you can roll back, not a code deploy.
- Failover covers streaming: when the primary model returns 429, 5xx, 408 or 404, or the connection drops, the next backup answers, streamed requests included.
- Each request log shows the provider and model that answered, every failover attempt and a cost estimate.
- Send a provider model such as
openai/gpt-4oby mistake and the 404 names the workflow in your project that runs it.
What you give up
- No unified billing or credits. You need an account and API key with each provider you use.
- No per-request model strings and no auto-router. Every call names a workflow you created first.
- A smaller catalog: about 139 models across 13 providers, plus any OpenAI-compatible base URL.
| Topic | OpenRouter | ModelRiver |
|---|---|---|
| How it bills | Prepaid credits with a platform fee on credit purchases. BYOK usage has no fee up to a monthly usage threshold, then a percentage fee. A free tier with daily request limits. Source (opens in a new tab) · checked | Monthly plans by request volume, with no markup on tokens. Model usage is billed by your provider on your own keys. |
Compared, with sources
- OpenRouter charges a platform fee on credit purchases, and a fee on BYOK usage above a monthly threshold. ModelRiver adds no fee on model usage and bills a plan by request volume. Source (opens in a new tab) · checked
- On OpenRouter, fallbacks go in each request's
modelsarray or in a preset. On ModelRiver they are saved on the workflow, next to structured output, input guardrails and budgets. Source (opens in a new tab) · checked - OpenRouter presets keep a version history, and API calls use the latest version. A ModelRiver workflow has a Draft and a Live version, and production calls Live until you publish. Source (opens in a new tab) · checked
- The OpenRouter free tier has a daily request limit. The ModelRiver Free plan allows 25,000 requests a month and stops at the limit. Source (opens in a new tab) · checked
- OpenRouter sells credits that pay for models across its catalog. ModelRiver has no credits: you bring a key for each provider. Source (opens in a new tab) · checked
- OpenRouter accepts any catalog model in each request, and
openrouter/autopicks one for you. ModelRiver accepts only the names of workflows you created. Source (opens in a new tab) · checked - The OpenRouter
providerobject can order, filter and sort providers by price, throughput or latency. Each ModelRiver workflow slot names one provider and one model. Source (opens in a new tab) · checked - The OpenRouter
modelsarray lists fallbacks in priority order. A ModelRiver workflow holds a primary model and up to 2 backups. Source (opens in a new tab) · checked - The OpenRouter catalog spans many providers and includes free model variants. The ModelRiver catalog has about 139 models across 13 providers, plus custom OpenAI-compatible base URLs. Source (opens in a new tab) · checked
- OpenRouter documents a Responses API endpoint. ModelRiver serves chat completions, completions and embeddings only. Source (opens in a new tab) · checked
Steps to move over
- Step 1
Add your provider keys
Add an API key for each provider your current
models[]list uses, for example OpenAI, Anthropic and Google. Keys are encrypted at rest and used only for your requests. - Step 2
Create one workflow per model setup
Name it with letters, digits and underscores, such as
support_bot. Set the first model of yourmodels[]list as primary and the next two as backups. Attach your JSON schema as a structured output and add a budget if you want one. - Step 3
Compare the Draft with what you get today
Run a few prompts you already send to OpenRouter in the Playground, against the Draft, and compare the answers. To wire up your app without provider calls, switch the workflow to Testing mode; switch back to Production before you publish.
- Step 4
Publish the workflow Live
API requests run the Live version, so publish before you switch code. After that,
support_botinmodelbehaves the way a preset name does today. - Step 5
Swap base URL, key and model
Point your OpenAI SDK at
https://api.modelriver.com/v1, use your ModelRiver API key, setmodelto the workflow name and removemodels,providerandresponse_formatfrom the request.base_url="https://api.modelriver.com/v1" api_key=os.environ["MODELRIVER_API_KEY"] model="support_bot" - Step 6
Keep OpenRouter as a fallback for a while
Keep your current gateway configured in your code as a fallback until you're confident, then remove it. A simple pattern: if the ModelRiver call raises, send the same messages to OpenRouter with your old
models[]list. - Step 7
Edit the workflow, not the request
Where you used to edit a
models[]array or a preset, edit the workflow Draft, publish it, and roll back to an earlier revision if the change misbehaves.
Frequently asked questions
Can I keep sending openai/gpt-4o as the model?
No. model takes a workflow name. If you send a provider model, the API returns a 404 that names a workflow in your project using that model, when one exists. Create the workflow first, then send its name.
My models[] list has five models. What happens?
A workflow holds a primary model and up to 2 backups. Keep the three you rely on most, or split traffic across two workflows by use case.
How do I see which backup answered?
The response model field is the workflow name. Request logs and the request timeline show the provider and model that ran each attempt, with a cost estimate.
Do I still pay my providers?
Yes. ModelRiver is BYOK only: each call uses your provider key and your provider bills you for tokens. ModelRiver charges a plan by request volume: Free $0 for 25,000 requests a month, Pro $49/month, Scale $299/month.
Does the OpenRouter provider object have a counterpart?
No. Each workflow slot names one provider and model. If you depend on sorting providers by price or latency, or on only/ignore lists, that is a reason to stay.
Is an OpenRouter preset the same as a workflow?
They are similar: both are named configs on the server. A workflow also has Draft and Live releases, so edits do not reach production until you publish, and you can roll back.
Bring your keys. Keep your SDK.
Start on the Free plan, create a workflow and point your SDK at it.
Send us your models[] request or config.yaml (remove keys first) and we’ll reply with the matching workflow setup. Get help moving
Checked · Report an inaccuracy
Sources
OpenRouter is a trademark of its owner. ModelRiver is not affiliated with, endorsed or sponsored by it.