Skip to content
// moflux api — ai gateway

Every model.
One endpoint.

Moflux routes your requests to OpenAI, Anthropic, Gemini, DeepSeek and 40+ more providers through a single OpenAI‑compatible API. Swap models by changing a string — your code, your keys and your billing stay in one place.

0.5× GPT models — limited-time half price $10 free credit on sign-up Free to try — no credit card, no VPN
// no code needed
Here to use AI, not build with it?

Start on your phone. No Codex, API key, or setup steps.

Building with Codex or an API?
$ pip install openai
# Mainland China · Alibaba Cloud base_url="https://api-cn.mofluxapi.com/v1"
# Global · Cloudflare base_url="https://mofluxapi.com/v1"
live routing OpenAI Anthropic Gemini DeepSeek Qwen Mistral +40 moflux ROUTER your app POST /v1 · SSE
gateway operational
OPENAI/ANTHROPIC/GEMINI/DEEPSEEK/QWEN/MISTRAL/LLAMA/GROK/KIMI/DOUBAO/COHERE/AZURE/BEDROCK/VERTEX/
// use with the codex app

Set up the Codex app in minutes.

No coding needed — install the app, paste one line, enter your key. Works on Mac, Windows and Linux.

Your API key is created for you — just copy, paste, done. Or follow the manual steps below.

Prefer to set it up by hand? Show the manual steps
01

Download the Codex app

Codex is OpenAI's AI coding assistant — it can build websites, write scripts and automate tasks for you. Download it free, open the file and install it like any other app.

Not sure which Mac? Anything from 2020 or later is Apple Silicon.

Linux (Ubuntu / Debian): there is no desktop app — Codex runs in the terminal instead. Skip this download; the setup line in step 04 will offer to install it for you.

02

Get your API key

Create an account, then copy your key from the console. It looks like sk-...

Get your API key ->

Registering is free — new accounts get $10 credit, and GPT models are 0.5× half price for a limited time.

03

Open the command window

Mac: press + Space, type Terminal, press Enter.
Windows: press the ⊞ Win key, type PowerShell, press Enter.
Linux: press Ctrl + Alt + T, or open the Terminal app.

04

Paste the setup line

Copy the line for your system and paste it into the window, then press Enter. When it asks, paste your API key.

curl -fsSL https://mofluxapi.com/codex.sh | bash powershell -NoProfile -Command "$p=Join-Path $env:TEMP 'moflux-codex-setup.ps1'; Invoke-WebRequest -UseBasicParsing 'https://mofluxapi.com/codex.ps1' -OutFile $p; Unblock-File -Path $p; & $p" curl -fsSL https://mofluxapi.com/codex.sh | bash

Typed the wrong key? Run the same line again — it lets you replace it. Script blocked or showing an error? Follow the manual setup guide instead.

05

Start Codex

Open the Codex app — or type codex in a new command window. That's it — everything now runs through Moflux.

// having trouble?
Something not working? We've written it all down.
  • Script blocked or showing an error — set it up by hand instead.
  • Can't see the newest model — how to update and pick it.
  • App stuck in English — switch the Codex interface to Chinese.
  • 401 / "invalid key" / signed-in confusion — the common fixes.
Open the setup & FAQ guide -> Step-by-step, in 中文 & English.
// quickstart for developers

Change a string, not your stack.

If your code speaks OpenAI, it already speaks Moflux. Point your SDK at one base URL, then reach any provider's models by name.

$ curl https://mofluxapi.com/v1/chat/completions \
-H "Authorization: Bearer $MOFLUX_API_KEY" \
-d '{"model": "claude-fable-5", "stream": true,
"messages": [{"role":"user","content":"hello"}]}'
 
HTTP/2 200 · routed in 38 ms
data: {"choices":[{"delta":{"content":"Hello"}}]}
data: {"choices":[{"delta":{"content":" from"}}]}
data: {"choices":[{"delta":{"content":" Moflux."}}]}
data: [DONE]
 
# tomorrow: "model": "gpt-5.2" — nothing else changes
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://mofluxapi.com/v1",
    api_key=os.environ["MOFLUX_API_KEY"],
)

stream = client.chat.completions.create(
    model="claude-fable-5",  # or "gpt-5.2", "gemini-3-pro", ...
    messages=[{"role": "user", "content": "hello"}],
    stream=True,
)

for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://mofluxapi.com/v1",
  apiKey: process.env.MOFLUX_API_KEY,
});

const stream = await client.chat.completions.create({
  model: "claude-fable-5", // or "gpt-5.2", "gemini-3-pro", ...
  messages: [{ role: "user", content: "hello" }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
// what the router does

A gateway that earns its place in the request path.

ROUTE

OpenAI-compatible, and then some

Point any OpenAI SDK at /v1 and it just works. Native Claude and Gemini endpoints are there when you want provider-specific features.

BALANCE

Smart load balancing

Weighted routing across multiple upstream channels, with automatic retries and failover the moment a provider degrades.

METER

Token-level billing

Every request metered to the token. Pay-as-you-go quota, transparent per-model pricing, real-time spend — no surprises at the end of the month.

SCOPE

Keys you can hand out

Per-key quotas, model allowlists, expiry dates and IP restrictions. Give your team and your apps keys — not liability.

STREAM

Streaming first

SSE pass-through with minimal gateway overhead. Your tokens arrive as fast as the model emits them.

OBSERVE

Full observability

Request logs, latency and per-model spend, live in the console. When something is slow, you'll know which provider — and when.

// intermission — moflux arcade

While the model thinks, save the city.

A tiny built-in shooter: pilot the Giant of Light and zap the kaiju before they reach the gateway. One insert coin, zero microtransactions.

movespace / tap firedrag on phone
Session best: 0
mofluxarcade POWER
FLUX
DEFENDER

Kaiju are marching on the gateway. You are the last route online.

// get started

Start routing in minutes.

Sign up free, get $10 credit, start routing — GPT models at 0.5× for a limited time.

Get your API key ->