OpenRouter alternative
中文Switch from OpenRouter to OpenLux in one line
OpenLux serves the same OpenAI-compatible API as OpenRouter, plus the Anthropic Messages API. In most projects you change the base URL, swap the API key and rename the model. Your SDK, prompts, streaming and tool calls stay as they are.
Three things to change
- 1
Create an OpenLux API key
Sign up, open API keys in the console and create a key. Pick a group for the key: the group sets the price and which models the key can call. Each group is listed on the pricing page.
- 2
Change the base URL
Replace
https://openrouter.ai/api/v1withhttps://api.openlux.ai/v1. For Anthropic-format clients such as Claude Code, replacehttps://openrouter.ai/apiwithhttps://api.openlux.ai. - 3
Rename the model
Drop the
vendor/prefix:openai/gpt-5.5becomesgpt-5.5. Claude models also use hyphens instead of dots in the version:anthropic/claude-sonnet-5.5becomesclaude-sonnet-5-5.
To check the key and URL, call GET https://api.openlux.ai/v1/models with the key. A model list back means both are right; a 401 means the key is wrong or missing.
Base URL for each API format
| API format | OpenRouter | OpenLux |
|---|---|---|
| OpenAI Chat Completions | https://openrouter.ai/api/v1 | https://api.openlux.ai/v1 |
| Anthropic Messages (Claude Code, Anthropic SDK) | https://openrouter.ai/api | https://api.openlux.ai |
| API key header | Authorization: Bearer | Authorization: Bearer, or x-api-key for the Anthropic format |
Do not add /v1 to the Anthropic base URL: Claude Code and the Anthropic SDK append /v1/messages themselves. OpenLux also serves the OpenAI Responses API (/v1/responses) and the Gemini native format.
Before and after, for each SDK and tool
Red lines are your OpenRouter setup, green lines are what replaces them. The copy button copies the OpenLux version.
OpenAI SDK — Python
from openai import OpenAI client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key="<OPENROUTER_API_KEY>", base_url="https://api.openlux.ai/v1", api_key="<OPENLUX_API_KEY>",) response = client.chat.completions.create( model="anthropic/claude-sonnet-5.5", model="claude-sonnet-5-5", messages=[{"role": "user", "content": "Hello"}],)print(response.choices[0].message.content)OpenAI SDK — Node.js / TypeScript
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://openrouter.ai/api/v1", apiKey: process.env.OPENROUTER_API_KEY, baseURL: "https://api.openlux.ai/v1", apiKey: process.env.OPENLUX_API_KEY,}); const completion = await client.chat.completions.create({ model: "openai/gpt-5.5", model: "gpt-5.5", messages: [{ role: "user", content: "Hello" }],});console.log(completion.choices[0].message.content);cURL
curl https://openrouter.ai/api/v1/chat/completions \ -H "Authorization: Bearer $OPENROUTER_API_KEY" \curl https://api.openlux.ai/v1/chat/completions \ -H "Authorization: Bearer $OPENLUX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-3.8-flash", "model": "gemini-3.8-flash", "messages": [{"role": "user", "content": "Hello"}] }'Anthropic SDK — Python
import anthropic client = anthropic.Anthropic( base_url="https://openrouter.ai/api", auth_token="<OPENROUTER_API_KEY>", base_url="https://api.openlux.ai", api_key="<OPENLUX_API_KEY>",) message = client.messages.create( model="claude-sonnet-5-5", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}],)print(message.content[0].text)Claude Code
export ANTHROPIC_BASE_URL="https://openrouter.ai/api"export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"export ANTHROPIC_BASE_URL="https://api.openlux.ai"export ANTHROPIC_AUTH_TOKEN="<OPENLUX_API_KEY>"export ANTHROPIC_API_KEY=""claudeLangChain — Python
from langchain_openrouter import ChatOpenRouterfrom langchain_openai import ChatOpenAI llm = ChatOpenRouter(model="anthropic/claude-sonnet-5.5")llm = ChatOpenAI( model="claude-sonnet-5-5", base_url="https://api.openlux.ai/v1", api_key="<OPENLUX_API_KEY>",)print(llm.invoke("Hello").content)Vercel AI SDK
import { createOpenRouter } from "@openrouter/ai-sdk-provider";import { createOpenAICompatible } from "@ai-sdk/openai-compatible";import { generateText } from "ai"; const openrouter = createOpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });const openlux = createOpenAICompatible({ name: "openlux", baseURL: "https://api.openlux.ai/v1", apiKey: process.env.OPENLUX_API_KEY,}); const { text } = await generateText({ model: openrouter("anthropic/claude-sonnet-5.5"), model: openlux("claude-sonnet-5-5"), prompt: "Hello",});Cline / Kilo Code settings
API Provider: OpenRouterAPI Provider: OpenAI CompatibleBase URL: https://api.openlux.ai/v1API Key: <OPENLUX_API_KEY>Model ID: claude-sonnet-5-5Model IDs: OpenRouter to OpenLux
OpenLux model names have no vendor prefix. Popular models side by side; the full list with prices is on the pricing page.
| OpenRouter model ID | OpenLux model name |
|---|---|
| anthropic/claude-opus-5.5 | claude-opus-5-5 |
| anthropic/claude-sonnet-5.5 | claude-sonnet-5-5 |
| anthropic/claude-haiku-5.5 | claude-haiku-5-5 |
| anthropic/claude-fable-5.2 | claude-fable-5-2 |
| anthropic/claude-opus-4.8 | claude-opus-4-8 |
| anthropic/claude-sonnet-4.6 | claude-sonnet-4-6 |
| openai/gpt-6.2-astra | gpt-6.2-astra |
| openai/gpt-6.2-sol | gpt-6.2-sol |
| openai/gpt-6.1-sol | gpt-6.1-sol |
| openai/gpt-5.5 | gpt-5.5 |
| openai/gpt-5.4-mini | gpt-5.4-mini |
| openai/gpt-4o-mini | gpt-4o-mini |
| google/gemini-3.8-flash | gemini-3.8-flash |
| google/gemini-3.1-pro-preview | gemini-3.1-pro-preview |
| google/gemini-3.5-flash-lite | gemini-3.5-flash-lite |
| deepseek/deepseek-v4.1-flash | deepseek-v4.1-flash |
| deepseek/deepseek-v4-pro | deepseek-v4-pro |
| x-ai/grok-4.7 | grok-4.7 |
| moonshotai/kimi-k3 | kimi-k3 |
| z-ai/glm-5.3 | glm-5.3 |
| qwen/qwen3.8-flash | qwen3.8-flash |
OpenRouter IDs are from its public model list (checked November 26, 2026). OpenLux names are models on sale when this page was built.
OpenRouter routing options on OpenLux
provider.sortworks: for example,"provider": {"sort": "price"}sends the request over the cheapest route. OpenRouter'sthroughputandlatencyvalues are not recognised; add the:nitrosuffix for the fastest route instead.- The
:floor(cheapest route),:nitro(fastest route) and:stable(route with the best success rate) model suffixes work, for exampleclaude-opus-5-5:floor. - OpenLux does not act on the
modelsfallback list,route,transforms, or otherproviderfields such asorder,only,ignoreandallow_fallbacks. When a route fails, OpenLux retries the request on another route for the same model by itself.
What OpenLux does not do
No Batch API
OpenRouter's
:batchmodel variants and Batch API have no OpenLux counterpart. Every request is a normal real-time request.No bring-your-own-key
You cannot attach your own provider keys. Every request is billed from your OpenLux balance.
No router or free models
There is no
openrouter/auto,openrouter/freeor:freevariant. Pick a model by name, and use:flooror:nitroif you want OpenLux to choose the route by price or speed.Only one OpenRouter routing field
provider.sortand the routing suffixes are read; the other OpenRouter-only request fields listed above are not.
Billing differences
OpenRouter (from its own documentation, checked November 26, 2026)
OpenLux
- Prepaid balance, charged per request by the tokens used.
- Price = the model's price × the ratio of the group on your API key. Groups differ in price and stability, and each group's description is on the pricing page.
- Top up by card, Apple Pay, Google Pay or stablecoins.
- Every request appears in the usage log with its model, tokens and charge.
For a worked cost example with Claude Code, read OpenRouter alternative for Claude Code and GPT: fees and prices compared.
Frequently asked questions
Is OpenLux a drop-in replacement for OpenRouter?
For code that calls the OpenAI-compatible Chat Completions API, mostly yes: change the base URL and key, and rename the model. Messages, streaming and tool calls use the same request format. OpenLux has no Batch API, no bring-your-own-key and no router models.
Can I use my OpenRouter API key on OpenLux?
No. Create an OpenLux key in the console under API keys. OpenRouter keys only work on OpenRouter.
Do I have to change my model names?
Yes. Drop the vendor/ prefix, and for Claude models use hyphens in the version: anthropic/claude-opus-5.5 becomes claude-opus-5-5. See the table above or the pricing page for exact names.
What replaces openrouter/auto?
OpenLux has no router model. Name the model you want. To let OpenLux pick the cheapest or fastest route for that model, add :floor or :nitro, or send provider.sort.
Does provider routing still work?
provider.sort works, for example {"sort": "price"}. Other provider fields, the models fallback list and transforms are not used. Failed requests are retried on another route for the same model automatically.
How do I point Claude Code at OpenLux?
Set ANTHROPIC_BASE_URL=https://api.openlux.ai and ANTHROPIC_AUTH_TOKEN to your OpenLux key. Do not add /v1: Claude Code appends /v1/messages itself.
Does OpenLux have a Batch API or bring-your-own-key?
No. All requests are real-time and billed from your OpenLux balance.
How do I see what a request cost?
Open the usage log in the console. Each request is listed with its model, tokens and charge.
Related
Move your first request in five minutes
Create an account, make a key, change one line.
Create a free account