Quickstart
Get a key and make your first call in a few minutes.
This page gets you from zero to a working request. The whole change to your existing code is one line: the base URL.
1. Get an API key
- Sign up at /auth/sign-up.
- Open the dashboard and create an API key. It looks like
sk-.... - Keep it somewhere safe. The examples below read it from a
FLUX_API_KEYenvironment variable:
export FLUX_API_KEY="sk-..."
2. Make your first call
Send the prompt to flux-auto and Flux routes it for you.
curl
curl https://api.fluxrouter.ai/v1/chat/completions \
-H "Authorization: Bearer $FLUX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-auto",
"messages": [
{ "role": "user", "content": "Say hello from FluxRouter." }
]
}'
3. Use your existing SDK
You don't switch libraries. Keep your OpenAI or Anthropic SDK and change the base URL to Flux.
OpenAI Python SDK
from openai import OpenAI
client = OpenAI(
api_key="sk-...", # your Flux key
base_url="https://api.fluxrouter.ai/v1", # the one line you change
)
response = client.chat.completions.create(
model="flux-auto",
messages=[{"role": "user", "content": "Say hello from FluxRouter."}],
)
print(response.choices[0].message.content)
OpenAI Node SDK
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.FLUX_API_KEY, // your Flux key
baseURL: "https://api.fluxrouter.ai/v1", // the one line you change
});
const response = await client.chat.completions.create({
model: "flux-auto",
messages: [{ role: "user", content: "Say hello from FluxRouter." }],
});
console.log(response.choices[0].message.content);
Anthropic Python SDK
from anthropic import Anthropic
client = Anthropic(
api_key="sk-...", # your Flux key
base_url="https://api.fluxrouter.ai/anthropic", # the one line you change
)
message = client.messages.create(
model="flux-auto",
max_tokens=1024,
messages=[{"role": "user", "content": "Say hello from FluxRouter."}],
)
print(message.content[0].text)
Anthropic Node SDK
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.FLUX_API_KEY, // your Flux key
baseURL: "https://api.fluxrouter.ai/anthropic", // the one line you change
});
const message = await client.messages.create({
model: "flux-auto",
max_tokens: 1024,
messages: [{ role: "user", content: "Say hello from FluxRouter." }],
});
console.log(message.content[0].text);
Pick a different model
flux-auto routes for you. To pin a model, swap the model value for a tier alias (flux-fast, flux-standard, flux-reasoning, flux-image) or one of the flux-pinned-* aliases. Everything else stays the same.