Migrate from OpenRouter
Move from OpenRouter to FluxRouter. Both are OpenAI-compatible gateways, so it's a base URL, key, and model swap.
OpenRouter and FluxRouter are both OpenAI-compatible gateways, so migrating is the same kind of swap you'd do between any two OpenAI-compatible endpoints. You change three things:
- Base URL to
https://api.fluxrouter.ai/v1 - API key to your Flux key (
sk-...from the dashboard) - Model to
flux-auto(or a specificflux-*id)
The OpenAI SDK, the endpoints, and the request and response JSON stay the same.
Get a Flux key
Sign up at /auth/sign-up, open the dashboard, and create an API key. It looks like sk-.... The examples below read it from a FLUX_API_KEY environment variable.
Migrate the Python SDK
Before (OpenRouter)
from openai import OpenAI
client = OpenAI(
api_key="sk-or-...",
base_url="https://openrouter.ai/api/v1",
)
response = client.chat.completions.create(
model="anthropic/claude-sonnet-4-5",
messages=[{"role": "user", "content": "Say hello."}],
)
print(response.choices[0].message.content)
After (FluxRouter)
from openai import OpenAI
client = OpenAI(
api_key="sk-...", # your Flux key
base_url="https://api.fluxrouter.ai/v1", # changed base URL
)
response = client.chat.completions.create(
model="flux-auto", # let Flux route, or pin a flux-* id
messages=[{"role": "user", "content": "Say hello."}],
)
print(response.choices[0].message.content)
Migrate the Node SDK
Before (OpenRouter)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OPENROUTER_API_KEY,
baseURL: "https://openrouter.ai/api/v1",
});
const response = await client.chat.completions.create({
model: "anthropic/claude-sonnet-4-5",
messages: [{ role: "user", content: "Say hello." }],
});
console.log(response.choices[0].message.content);
After (FluxRouter)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.FLUX_API_KEY, // your Flux key
baseURL: "https://api.fluxrouter.ai/v1", // changed base URL
});
const response = await client.chat.completions.create({
model: "flux-auto", // let Flux route, or pin a flux-* id
messages: [{ role: "user", content: "Say hello." }],
});
console.log(response.choices[0].message.content);
Mapping model ids
On OpenRouter you pass provider-prefixed model ids like anthropic/claude-sonnet-4-5 or openai/gpt-4o. On Flux you pass a Flux alias instead:
flux-auto(recommended): Flux routes each request to a sensible model for the prompt, so you usually don't hand-pick a model at all. This is the main difference in day-to-day use, with OpenRouter you choose the model, withflux-autoFlux chooses for you.- A
flux-pinned-*id when you want a specific backing model every time. List them withGET https://api.fluxrouter.ai/v1/models. - A tier alias (
flux-fast,flux-standard,flux-reasoning,flux-image) to target a speed and capability tier.
What stays the same
- The OpenAI SDK and its method names.
- The endpoints:
/v1/chat/completions,/v1/responses,/v1/models. - Auth header style:
Authorization: Bearer sk-.... - The request and response JSON, including streaming, tool calls, and structured outputs.
Next steps
- Models: every model alias and how
flux-autoand pinning work. - Routing and pricing: the pricing lanes and how requests are priced.