From OpenRouter to FlowModels.
OpenRouter speaks the same format, so the move is mainly about the base URL, the key, how model IDs are written and the fields for fallback routes.
What changes
The base URL, the key and the model name. Everything else stays, as long as you do not use any of the fields in the table below.
| Setting | Before | On FlowModels |
|---|---|---|
| Base URL | https://openrouter.ai/api/v1 |
https://api.flowmodels.one/v1 |
| Key | OPENROUTER_API_KEY |
FLOWMODELS_API_KEY |
| Model name | google/gemini-3.7-flash |
gemini/gemini-3.7-flash |
The code before and after
client = OpenAI(
- base_url="https://openrouter.ai/api/v1",
- api_key=os.environ["OPENROUTER_API_KEY"],
+ base_url="https://api.flowmodels.one/v1",
+ api_key=os.environ["FLOWMODELS_API_KEY"],
)
response = client.chat.completions.create(
- model="google/gemini-3.7-flash",
+ model="gemini/gemini-3.7-flash",
messages=[{"role": "user", "content": "Hello!"}],
- extra_headers={"HTTP-Referer": "https://example.com", "X-Title": "My product"},
- extra_body={"models": ["openai/gpt-5-mini"], "provider": {"sort": "price"}},
)
No automatic failover.
FlowModels calls exactly the model you name. On a 429 or 503 from the provider, the API retries the same call at most twice, and then you get the error with its code. If your service should fall back to another model, your code decides that.
Fields that behave differently
What the chosen model supports decides. The fields it accepts are listed under supported_parameters in GET /v1/models.
| Field | Behavior on FlowModels |
|---|---|
models, route, provider, transforms, plugins |
FlowModels does not evaluate these OpenRouter fields. Remove them so your code does not depend on them. |
Model IDs |
The prefix is the provider of this API: x-ai/… becomes xai/…, google/… becomes gemini/…, and versions may be written differently. Check every ID on the models page or in GET /v1/models. |
Suffixes such as :nitro or :online |
The catalog does not know such model names, and they end in 404 model_not_found. On models that support it, you turn on web search with web_search: true. |
reasoning |
On /v1/chat/completions the field is called reasoning_effort, on /v1/responses it is reasoning.effort. The levels a model knows are listed under capabilities.reasoning_levels. |
usage |
You get usage in the response body without any further field; when streaming, with stream_options.include_usage in the last event. |
HTTP-Referer, X-Title |
FlowModels does not evaluate these headers. You can remove them. |
What to check after the move
-
The new key is in
FLOWMODELS_API_KEY, andGET /v1/modelslists your model. -
A call without streaming returns
choices[0].message.contentas expected. -
With
stream: truethe events arrive; withstream_options.include_usagethe usage is in the last event. -
Tool calls and
response_formatwork with exactly the model you use. -
Your error handling separates
429 insufficient_quota(credit exhausted) from429 rate_limit_exceeded,429 concurrent_requests_exceededand503 provider_overloaded. - The request log in your dashboard shows the model, tokens and cost of the call.
-
Your application itself reacts to
502 routing_execution_failedand503 provider_overloadedif it has to keep running without a fallback route.