# RouterPlex — complete documentation for LLMs You are reading the full documentation of RouterPlex, an OpenAI-compatible AI gateway. Use it to write code against the RouterPlex API or to configure IDEs, agents, and tools for a user. Key facts: - Base URL: https://api.routerplex.com/v1 (drop-in replacement for the OpenAI API). - Authentication: "Authorization: Bearer " — keys are created at https://routerplex.com/dashboard/keys. - Model IDs are used verbatim (e.g. gpt-5.5, claude-opus-4-8, gemini-3.1-pro) — no provider prefix, except in tools that require an "openai/" prefix to select the wire format (Aider, OpenHands). - The Anthropic-compatible /v1/messages format supports all 37 chat models. Set ANTHROPIC_BASE_URL=https://api.routerplex.com; the Anthropic SDK or Claude Code appends /v1/messages. - Never hardcode API keys in code you produce; read them from an environment variable and ask the user to supply theirs. - When configuring a tool for a user, prefer creating a dedicated key with a budget for that tool. --- # Introduction _Getting started — What RouterPlex is and how it fits into your stack._ RouterPlex is a multi-model API with both OpenAI-compatible and Anthropic-compatible request formats. One key, one balance — every model we serve, from GPT and Claude to Gemini, DeepSeek, Kimi and Qwen. > **OpenAI base URL:** `https://api.routerplex.com/v1` > > **Anthropic base URL:** `https://api.routerplex.com` — the Anthropic SDK appends `/v1/messages`. ## How it works 1. You create an account and verify your email. 2. You can run one bounded live route proof from the [dashboard](https://routerplex.com/dashboard/evaluate) before paying. It uses a fixed server-side prompt; no card, API key, or balance is required. 3. Top up from $5, create an API key in the [dashboard](https://routerplex.com/dashboard/keys), and point any OpenAI-compatible SDK, IDE, or agent at `https://api.routerplex.com/v1`. 4. You pick a model by its ID (for example `gpt-5.5`, `claude-opus-4-8`, `gemini-3.1-pro`) — same request shape for all of them. 5. Every paid request deducts its exact token cost from your prepaid balance. No subscription required. ## What's supported | Capability | Status | | --- | --- | | Chat completions (`/v1/chat/completions`) | All 37 chat models | | Streaming (SSE) | Supported | | Function calling / tools | Supported, model-dependent | | Vision (image inputs) | Supported, model-dependent | | JSON mode / structured output | Supported, model-dependent | | Image generation (`/v1/images/generations`) | Supported — `gpt-image-2` | | Responses API (`/v1/responses`) | Supported for Codex custom providers | | Model list (`/v1/models`) | Supported | | Anthropic-compatible `/v1/messages` format | All 37 chat models — use the Anthropic SDK or point [Claude Code](/claude-code) straight at RouterPlex | ## Where to go next - [Quickstart](/quickstart) — first request in under a minute. - [Anthropic Messages](/anthropic-messages) — call any chat model with the Anthropic SDK and wire format. - [IDEs & editors](/cursor) and [Agents & CLIs](/claude-code) — use RouterPlex inside Cursor, VS Code, Zed, OpenClaw, OpenCode, Codex CLI, Aider and more. - [Models](/models) — the live catalog with per-token pricing. --- # Quickstart _Getting started — Verify the route, create a key, and send your first request._ 1. [Create an account](https://routerplex.com/sign-up) and verify your email. 2. Optional: run the one bounded live route proof in the [dashboard](https://routerplex.com/dashboard/evaluate). It uses a fixed prompt and does not require a card, API key, or balance. 3. Top up your balance — pay-as-you-go starts at $5, by card or crypto. No subscription required. 4. In the dashboard, open [API Keys](https://routerplex.com/dashboard/keys) and create a key. Copy it immediately — it's shown only once. 5. Store the key in your shell: ```bash export ROUTERPLEX_API_KEY="sk-..." ``` 6. Make your first request: ```bash curl https://api.routerplex.com/v1/chat/completions \ -H "Authorization: Bearer $ROUTERPLEX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.5", "messages": [{"role": "user", "content": "Hello!"}] }' ``` Swap `"gpt-5.5"` for any ID in the [model catalog](/models) — same endpoint, same request shape. ## With the OpenAI SDK ```python import os from openai import OpenAI client = OpenAI( base_url="https://api.routerplex.com/v1", api_key=os.environ["ROUTERPLEX_API_KEY"], ) response = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Explain HTTP in one line"}], ) print(response.choices[0].message.content) ``` No code at all? Try models in the [playground](https://routerplex.com/dashboard/playground) first. --- # Authentication _Getting started — API keys, headers, and key hygiene._ Every request needs your RouterPlex API key. OpenAI-compatible clients normally send it as a bearer token: ```text Authorization: Bearer sk-... ``` Anthropic-compatible clients normally send the same key in `x-api-key`: ```text x-api-key: sk-... ``` Both authentication styles work on `/v1/messages`. Use the default header produced by your SDK. Keys are created and managed in the [dashboard](https://routerplex.com/dashboard/keys). ## Key hygiene - Treat keys like passwords: server-side only, never in browser code or public repos. - Give each app, IDE, or agent its **own key** with its own [budget and model allowlist](/keys-budgets) — an agent gone wild can't drain your whole balance. - If a key leaks, delete it in the dashboard. Revocation is immediate. - Prefer environment variables (`ROUTERPLEX_API_KEY`) over hardcoding. --- # Chat completions _API reference — OpenAI-compatible chat completions for every chat model._ `POST https://api.routerplex.com/v1/chat/completions` The endpoint uses the OpenAI Chat Completions request and response shape, so the official SDKs work by changing the base URL and API key. ```python import os from openai import OpenAI client = OpenAI( base_url="https://api.routerplex.com/v1", api_key=os.environ["ROUTERPLEX_API_KEY"], ) response = client.chat.completions.create( model="gemini-3.5-flash", messages=[{"role": "user", "content": "Explain HTTP in one line"}], ) print(response.choices[0].message.content) ``` ```typescript import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.routerplex.com/v1", apiKey: process.env.ROUTERPLEX_API_KEY, }); const response = await client.chat.completions.create({ model: "deepseek-v4-pro", messages: [{ role: "user", content: "Explain HTTP in one line" }], }); console.log(response.choices[0].message.content); ``` ## Advanced parameters Function calling, tool use, JSON mode, and vision inputs work the same way as with OpenAI — pass `tools`, `response_format`, or image content parts as usual: ```python response = client.chat.completions.create( model="claude-sonnet-4-6", messages=[{"role": "user", "content": "What's the weather in Paris?"}], tools=[{ "type": "function", "function": { "name": "get_weather", "parameters": { "type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"], }, }, }], ) ``` Support for tools/vision/JSON mode varies by model — frontier models (GPT, Claude, Gemini) support all three. --- # Anthropic Messages _API reference — Use Anthropic's SDK and /v1/messages format with every chat model._ `POST https://api.routerplex.com/v1/messages` RouterPlex accepts Anthropic's Messages API request format and returns Anthropic-format responses for every chat model in the catalog — Claude, GPT, Gemini, DeepSeek, Kimi, Qwen, and more. The same RouterPlex key and prepaid balance work across both API formats. > **Anthropic SDK base URL:** `https://api.routerplex.com` — do not append `/v1`; the SDK adds `/v1/messages` itself. ## curl ```bash curl https://api.routerplex.com/v1/messages \ -H "x-api-key: $ROUTERPLEX_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{ "model": "gpt-5.4", "max_tokens": 256, "messages": [{"role": "user", "content": "Explain HTTP in one line"}] }' ``` `Authorization: Bearer $ROUTERPLEX_API_KEY` also works if your HTTP client already uses bearer authentication. ## Python SDK ```python import os from anthropic import Anthropic client = Anthropic( base_url="https://api.routerplex.com", api_key=os.environ["ROUTERPLEX_API_KEY"], ) message = client.messages.create( model="gemini-3.5-flash", max_tokens=256, messages=[{"role": "user", "content": "Explain HTTP in one line"}], ) print(message.content[0].text) ``` ## TypeScript SDK ```typescript import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ baseURL: "https://api.routerplex.com", apiKey: process.env.ROUTERPLEX_API_KEY, }); const message = await client.messages.create({ model: "deepseek-v4-pro", max_tokens: 256, messages: [{ role: "user", content: "Explain HTTP in one line" }], }); console.log(message.content); ``` ## Streaming Set `stream: true` or use the Anthropic SDK's streaming helper. RouterPlex returns Anthropic SSE events such as `message_start`, `content_block_delta`, and `message_stop`, including when the selected model is not a Claude model. ## Which format should I use? | Client | Base URL | Format | | --- | --- | --- | | OpenAI SDKs and OpenAI-compatible tools | `https://api.routerplex.com/v1` | `/v1/chat/completions` | | Anthropic SDK and Claude Code | `https://api.routerplex.com` | `/v1/messages` | Both formats reach the same 37 chat models and deduct from the same balance. `gpt-image-2` is image-generation only and uses [`/v1/images/generations`](/images), not a chat endpoint. Tool use, vision, thinking, and structured-output support still depend on the selected model. --- # Streaming _API reference — Server-sent events, token by token._ Set `stream: true` to receive tokens as server-sent events, exactly like the OpenAI API: ```python stream = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Write a haiku"}], stream=True, ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="", flush=True) ``` ```typescript const stream = await client.chat.completions.create({ model: "gpt-5.5", messages: [{ role: "user", content: "Write a haiku" }], stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` Streams stay open for up to 10 minutes — enough for long reasoning-model outputs. --- # Image generation _API reference — OpenAI-compatible image generation with gpt-image-2._ `POST https://api.routerplex.com/v1/images/generations` OpenAI-compatible image generation. Images are returned base64-encoded and billed by token (prompt text in, image tokens out). ```python import base64 import os from openai import OpenAI client = OpenAI( base_url="https://api.routerplex.com/v1", api_key=os.environ["ROUTERPLEX_API_KEY"], ) result = client.images.generate( model="gpt-image-2", prompt="A lighthouse on a cliff at dusk, watercolor", size="1024x1024", quality="medium", # low | medium | high ) with open("lighthouse.png", "wb") as f: f.write(base64.b64decode(result.data[0].b64_json)) ``` - Sizes: `1024x1024`, `1536x1024`, `1024x1536`. - Higher quality uses more output tokens. - Try it without code in the [playground](https://routerplex.com/dashboard/playground). ## Response and storage The generated image arrives in the response as base64 data rather than a permanent hosted URL. Decode it and store the resulting file in your own application or object store. RouterPlex does not turn generation responses into a public media library. ## Cost and failure checks Image cost depends on the output tokens used by the requested size and quality, so test the smallest acceptable settings before running a batch. Give image jobs a dedicated [key budget](/keys-budgets) to cap retries or loops. A 401 means the key is missing or invalid; a 400 usually points to an unsupported size, quality, or malformed prompt payload; a 429 should be retried with backoff. --- # Models _API reference — Listing models and picking IDs._ `GET https://api.routerplex.com/v1/models` List the models your key can use (also OpenAI-compatible): ```bash curl https://api.routerplex.com/v1/models \ -H "Authorization: Bearer $ROUTERPLEX_API_KEY" ``` The [live catalog](https://routerplex.com/models) shows current per-token pricing and context windows for all 38 models. It and `GET /v1/models` are the source of truth if the snapshot below differs. ## Model IDs Model IDs are used verbatim in the `model` field — case-sensitive, no `openai/`-style prefix. The full list: | Model ID | Provider | Context | Type | | --- | --- | --- | --- | | `claude-fable-5` | Anthropic | 1M | chat | | `claude-opus-5` | Anthropic | 1M | chat | | `claude-sonnet-5` | Anthropic | 1M | chat | | `claude-opus-4-8` | Anthropic | 1M | chat | | `claude-opus-4-7` | Anthropic | 1M | chat | | `claude-opus-4-6` | Anthropic | 1M | chat | | `claude-sonnet-4-6` | Anthropic | 1M | chat | | `claude-haiku-4-5` | Anthropic | 256K | chat | | `gpt-5.5` | OpenAI | 256K | chat | | `gpt-5.6-sol` | OpenAI | 258K | chat | | `gpt-5.6-terra` | OpenAI | 258K | chat | | `gpt-5.6-luna` | OpenAI | 258K | chat | | `gpt-5.4` | OpenAI | 1M | chat | | `gpt-image-2` | OpenAI | — | image generation | | `gemini-3.1-pro` | Google | 1M | chat | | `gemini-3.5-flash` | Google | 1M | chat | | `deepseek-v4-pro` | DeepSeek | 1M | chat | | `deepseek-v4-flash` | DeepSeek | 1M | chat | | `kimi-k2.7` | Moonshot | 256K | chat | | `kimi-k2.6` | Moonshot | 256K | chat | | `kimi-k3` | Moonshot | 1M | chat | | `qwen3.7-max` | Alibaba | 1M | chat | | `qwen3.7-plus` | Alibaba | 1M | chat | | `qwen3.6-plus` | Alibaba | 1M | chat | | `glm-5.2` | Zhipu | 1M | chat | | `glm-5.1` | Zhipu | 256K | chat | | `MiniMax-M3` | MiniMax | 1M | chat | | `MiniMax-M3-highspeed` | MiniMax | 1M | chat | | `MiniMax-M2.7` | MiniMax | 196K | chat | | `MiniMax-M2.7-highspeed` | MiniMax | 196K | chat | | `doubao-seed-2.0-pro` | ByteDance | 128K | chat | | `doubao-seed-2.0-code` | ByteDance | 200K | chat | | `mimo-v2.5-pro` | Xiaomi | 1M | chat | | `mimo-v2.5` | Xiaomi | 1M | chat | | `step-3.7-flash` | StepFun | 256K | chat | | `LongCat-2.0` | LongCat | 1M | chat | | `hy3` | Tencent Hunyuan | 256K | chat | | `grok-4.5` | xAI | 500K | chat | Note the MiniMax IDs are capitalized exactly as shown. Current per-token pricing for every model is in the [live catalog](https://routerplex.com/models). --- # Errors & limits _API reference — Status codes, retry guidance, and platform limits._ Standard OpenAI-style error responses: | Status | Meaning | Retry? | | --- | --- | --- | | `401` | Missing or invalid API key | no — fix the key | | `400` | Malformed request, unsupported parameter, or insufficient prepaid balance | no — fix the request or top up | | `429` | Edge, per-key, or provider rate limit; some gateway spend-limit failures may also use this status | yes for rate limits, no for a reached spend limit | | `5xx` | Upstream provider issue | yes | Error bodies follow the OpenAI shape: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` When a request is rejected by a key budget or your available balance, read the returned `error.message` and `error.code` before retrying. A retry cannot raise a hard budget or restore a zero balance; create a new key budget or top up first. ## Platform limits - Requests are limited to **60/s per IP** at the edge. This is separate from optional per-key RPM/TPM limits and the tighter limits on promotional accounts. - Request bodies up to **50 MB** (plenty for base64 vision payloads). - Streams stay open for up to **10 minutes**. --- # OpenAI SDKs _SDKs & frameworks — Python and JavaScript/TypeScript official SDKs._ The official OpenAI SDKs work unmodified — set `base_url` and your RouterPlex key. ## Python ```bash pip install openai ``` ```python import os from openai import OpenAI client = OpenAI( base_url="https://api.routerplex.com/v1", api_key=os.environ["ROUTERPLEX_API_KEY"], ) response = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Hello!"}], ) ``` ## JavaScript / TypeScript ```bash npm install openai ``` ```typescript import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.routerplex.com/v1", apiKey: process.env.ROUTERPLEX_API_KEY, }); ``` ## Environment-variable only Both SDKs also honor environment variables, so existing code can switch to RouterPlex with zero changes: ```bash export OPENAI_BASE_URL="https://api.routerplex.com/v1" export OPENAI_API_KEY="sk-..." # your RouterPlex key ``` --- # LangChain, LlamaIndex & AI SDK _SDKs & frameworks — Use RouterPlex from the popular LLM frameworks._ Frameworks that let you set a custom OpenAI-compatible base URL can use RouterPlex. Point them at `https://api.routerplex.com/v1`. ## LangChain (Python) ```python import os from langchain_openai import ChatOpenAI llm = ChatOpenAI( model="claude-sonnet-4-6", base_url="https://api.routerplex.com/v1", api_key=os.environ["ROUTERPLEX_API_KEY"], ) print(llm.invoke("Hello!").content) ``` ## LlamaIndex ```python import os from llama_index.llms.openai_like import OpenAILike llm = OpenAILike( model="deepseek-v4-pro", api_base="https://api.routerplex.com/v1", api_key=os.environ["ROUTERPLEX_API_KEY"], is_chat_model=True, ) ``` ## Vercel AI SDK ```typescript import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; import { generateText } from "ai"; const routerplex = createOpenAICompatible({ name: "routerplex", baseURL: "https://api.routerplex.com/v1", apiKey: process.env.ROUTERPLEX_API_KEY, }); const { text } = await generateText({ model: routerplex("gpt-5.5"), prompt: "Hello!", }); ``` --- # Cursor _IDEs & editors — Use any RouterPlex model inside Cursor._ Cursor can route its chat models through RouterPlex via the OpenAI key override. 1. Open **Cursor Settings → Models → API Keys**. 2. Paste your RouterPlex key into the **OpenAI API Key** field. 3. Enable **Override OpenAI Base URL** and set it to: ```text https://api.routerplex.com/v1 ``` 4. Click **Add model** and enter a model ID from the [catalog](/models) verbatim — e.g. `claude-opus-4-8` or `gpt-5.5`. 5. Enable only your custom models, then pick them from the model dropdown in chat. > **Tip:** create a dedicated key with a [budget](/keys-budgets) for Cursor, so editor usage is capped and shows up separately in your logs. --- # VS Code — Cline, Roo, Continue _IDEs & editors — The three big VS Code AI extensions._ All three major VS Code AI extensions have first-class OpenAI-compatible providers. The extension settings are identical on macOS, Linux, and Windows — only the config file paths and keyboard shortcuts differ, noted below. Install any of them from the Extensions panel (`Cmd+Shift+X` on macOS, `Ctrl+Shift+X` on Windows/Linux). ## Cline Open Cline's settings (gear icon in the Cline panel), and under **API Configuration** choose the **OpenAI Compatible** provider: ```text Base URL: https://api.routerplex.com/v1 API Key: sk-... # your RouterPlex key Model ID: claude-opus-4-8 ``` Cline can't fetch capability metadata from custom endpoints, so if it asks for model info, set the context window to match the [catalog](/models) (e.g. 1,000,000 for `claude-opus-4-8`) and enable image support for vision models. Cline supports separate **Plan** and **Act** models — a common setup is `claude-opus-4-8` for Plan and `claude-sonnet-4-6` for Act. ## Roo Code Open Roo Code's settings and pick the **OpenAI Compatible** API provider — same fields as Cline: ```text Base URL: https://api.routerplex.com/v1 API Key: sk-... Model ID: claude-opus-4-8 ``` Roo Code routes different modes to different configuration profiles — create one profile per model and assign e.g. `claude-opus-4-8` to Architect, `claude-sonnet-4-6` to Code, and `claude-haiku-4-5` to Ask to keep costs down. ## Continue Continue is configured through a YAML file rather than the UI: - macOS / Linux: `~/.continue/config.yaml` - Windows: `%USERPROFILE%\.continue\config.yaml` ```yaml models: - name: Claude Opus 4.8 (RouterPlex) provider: openai model: claude-opus-4-8 apiBase: https://api.routerplex.com/v1 apiKey: sk-... roles: [chat, edit, apply] - name: Gemini Flash (RouterPlex) provider: openai model: gemini-3.5-flash apiBase: https://api.routerplex.com/v1 apiKey: sk-... roles: [chat] ``` Reload the Continue panel after saving and the models appear in its picker. > **Tip:** create one RouterPlex key per extension with its own [budget](/keys-budgets), so each tool's spend is capped and attributable in your logs. --- # VS Code — built-in Chat _IDEs & editors — Add RouterPlex models to VS Code's built-in Chat via a custom endpoint._ VS Code's built-in **Chat** view can bring your own models through a *custom endpoint*. Add RouterPlex once and every model below shows up in the Chat model picker. The steps are the same on macOS, Windows, and Linux. > This is for VS Code's native Chat. For the Cline, Roo Code, and Continue extensions, see [VS Code — Cline, Roo, Continue](/vscode). ## Add RouterPlex as a custom endpoint **1. Open the Chat view, click the model dropdown, and choose "Manage Models…".** ![The Chat model picker, with "Manage Models…" at the bottom.](/vscode-chat/1.png) **2. Click "Add Models", then choose "Custom Endpoint".** ![Add Models then Custom Endpoint in the Language Models panel.](/vscode-chat/2.png) **3. Name the group "RouterPlex" and press Enter.** ![Naming the model group RouterPlex.](/vscode-chat/3.png) **4. Paste your RouterPlex API key and press Enter.** ![Pasting your RouterPlex API key.](/vscode-chat/4.png) **5. Choose "Chat Completions" as the API type.** ![Selecting the Chat Completions API type.](/vscode-chat/5.png) **6. VS Code opens `chatLanguageModels.json` — add one entry per model, then save.** ![Editing chatLanguageModels.json: id is the model ID, url is the RouterPlex API, and the token limits depend on the model.](/vscode-chat/6.png) That file lives at: - macOS: `~/Library/Application Support/Code/User/chatLanguageModels.json` - Windows: `%APPDATA%\Code\User\chatLanguageModels.json` - Linux: `~/.config/Code/User/chatLanguageModels.json` **7. Added the provider by editing the JSON directly?** If you created the RouterPlex group by hand instead of the wizard above, VS Code doesn't have your key yet. Right-click the group in the **Language Models** list, choose **Update API Key**, and paste your RouterPlex key. ![Right-click the model group and choose "Update API Key" to set your key.](/vscode-chat/7.png) ## Example configuration Every model points `url` at RouterPlex (`https://api.routerplex.com/v1`). Add as many entries to `models` as you like: ```json [ { "name": "RouterPlex", "vendor": "customendpoint", "apiKey": "${input:chat.lm.secret.-8cc97ea}", "apiType": "chat-completions", "models": [ { "id": "claude-opus-4-8", "name": "Claude Opus 4.8", "url": "https://api.routerplex.com/v1", "toolCalling": true, "vision": true, "maxInputTokens": 1000000, "maxOutputTokens": 64000 }, { "id": "qwen3.7-plus", "name": "Qwen3.7 Plus", "url": "https://api.routerplex.com/v1", "toolCalling": true, "vision": true, "maxInputTokens": 1000000, "maxOutputTokens": 128000 } ] } ] ``` Leave `apiKey` as the `${input:…}` placeholder VS Code generated in step 4 — it references the key you pasted, so you never store the raw key in the file. ```vscode-copy-all ``` ## Models Every entry uses `"url": "https://api.routerplex.com/v1"`. Copy the `id`, `maxInputTokens`, and `maxOutputTokens` for each model you want: | Model ID | Max input tokens | Max output tokens | | --- | --- | --- | | `claude-opus-5` | 1000000 | 128000 | | `claude-opus-4-8` | 1000000 | 64000 | | `claude-fable-5` | 1000000 | 128000 | | `claude-sonnet-5` | 1000000 | 128000 | | `claude-opus-4-7` | 1000000 | 64000 | | `claude-opus-4-6` | 1000000 | 64000 | | `claude-sonnet-4-6` | 1000000 | 64000 | | `claude-haiku-4-5` | 256000 | 64000 | | `gpt-5.5` | 256000 | 64000 | | `gpt-5.6-sol` | 258000 | 128000 | | `gpt-5.6-terra` | 258000 | 128000 | | `gpt-5.6-luna` | 258000 | 128000 | | `gpt-5.4` | 1000000 | 128000 | | `gemini-3.1-pro` | 1000000 | 128000 | | `gemini-3.5-flash` | 1000000 | 128000 | | `deepseek-v4-pro` | 1000000 | 128000 | | `deepseek-v4-flash` | 1000000 | 128000 | | `kimi-k2.7` | 256000 | 64000 | | `kimi-k2.6` | 256000 | 64000 | | `kimi-k3` | 1048576 | 128000 | | `qwen3.7-max` | 1000000 | 128000 | | `qwen3.7-plus` | 1000000 | 128000 | | `qwen3.6-plus` | 1000000 | 128000 | | `glm-5.2` | 1000000 | 128000 | | `glm-5.1` | 256000 | 64000 | | `MiniMax-M3` | 1000000 | 128000 | | `MiniMax-M3-highspeed` | 1000000 | 128000 | | `MiniMax-M2.7` | 196000 | 64000 | | `MiniMax-M2.7-highspeed` | 196000 | 64000 | | `doubao-seed-2.0-pro` | 128000 | 32000 | | `doubao-seed-2.0-code` | 200000 | 64000 | | `mimo-v2.5-pro` | 1000000 | 128000 | | `mimo-v2.5` | 1000000 | 128000 | | `step-3.7-flash` | 256000 | 64000 | | `LongCat-2.0` | 1000000 | 128000 | | `hy3` | 256000 | 131072 | | `grok-4.5` | 500000 | 128000 | The **Copy all** button sets `"vision"` on the models that accept image input and `"toolCalling": true` on all of them — adjust either per model if you like. Give this key its own [budget](/keys-budgets) so editor usage is capped and shows up separately in your logs. --- # Codex — VS Code extension _IDEs & editors — Configure OpenAI's Codex extension for VS Code with RouterPlex._ The Codex extension for VS Code reads the same `~/.codex/config.toml` file as the [Codex CLI](/codex-cli) — you just edit it from the extension's settings UI instead of a terminal. > Using the terminal instead? The [Codex CLI](/codex-cli) guide covers the same config file plus profiles for switching models. ## Open config.toml from the extension **1. In the Codex panel, click the gear icon in the top-right corner and choose "Codex settings".** ![Codex panel gear icon menu with "Codex settings" highlighted.](/codex-vscode/1.png) **2. In the left sidebar, click "Configuration".** ![Codex Settings sidebar with Configuration selected.](/codex-vscode/2.png) **3. Under "Custom config.toml settings", click "Open config.toml".** ![The "Open config.toml" button under Custom config.toml settings.](/codex-vscode/3.png) **4. Add the RouterPlex provider block above the `[desktop]` table, then save.** ![config.toml with the RouterPlex provider block added above the desktop table.](/codex-vscode/4.png) ```toml # ~/.codex/config.toml model_provider = "routerplex" model = "gpt-5.6-terra" # Or any other RouterPlex-supported model model_reasoning_effort = "low" [desktop] followUpQueueMode = "queue" [model_providers.routerplex] name = "RouterPlex" base_url = "https://api.routerplex.com/v1" wire_api = "responses" env_key = "ROUTERPLEX_API_KEY" env_key_instructions = "Set ROUTERPLEX_API_KEY before starting Codex." ``` `model_provider`, `model`, and `model_reasoning_effort` must go **above** `[desktop]` (or any other bracketed table). TOML keys belong to whichever table header precedes them — paste them below `[desktop]` and Codex reads them as `desktop.model_provider` instead of the top-level setting, so the provider silently never applies. The extension may have already generated other keys in the file — `notify`, `[desktop]`, `[marketplaces.openai-bundled]`. Leave those as they are; only the two blocks above are RouterPlex-specific. ## Set the API key Create a dedicated, budget-capped RouterPlex key in the [dashboard](https://routerplex.com/dashboard/keys). `env_key` tells Codex to read it from `ROUTERPLEX_API_KEY` in your OS environment — not from `config.toml` — so set it where VS Code's process can see it. **macOS / Linux** — add it to your shell profile so it persists, then reload the shell: ```bash echo 'export ROUTERPLEX_API_KEY="sk-..."' >> ~/.zshrc # or ~/.bashrc source ~/.zshrc ``` ![Setting ROUTERPLEX_API_KEY in the integrated terminal.](/codex-vscode/5.png) If you normally launch VS Code from the Dock or Spotlight rather than a terminal, note that GUI apps don't inherit variables that only live in a shell profile. Either launch VS Code with `code .` from a terminal that has sourced the profile, or set it machine-wide with `launchctl setenv ROUTERPLEX_API_KEY "sk-..."` before opening VS Code. **Windows (PowerShell)** — `setx` persists the variable for future sessions, but not for windows already open: ```powershell setx ROUTERPLEX_API_KEY "sk-..." ``` You can also add it under **System Properties → Environment Variables → User variables**, which has the same effect and doesn't require a terminal. ## Restart VS Code Environment variables are read once, at process start — fully quit VS Code (not just "Reload Window") and reopen it so the Codex extension picks up `ROUTERPLEX_API_KEY`. Then open the Codex panel and send a test prompt; it should show up under the dedicated key in the RouterPlex dashboard. If Codex reports an unsupported API format, make sure `wire_api = "responses"` is present. If a model is rejected, copy its case-sensitive ID from the [live catalog](/models) and update the `model` value. > **Tip:** to try a different model, change only the `model` value — the `[model_providers.routerplex]` block stays the same for every RouterPlex model. --- # Zed _IDEs & editors — Configure Zed's agent panel with RouterPlex models._ In `settings.json` point the OpenAI provider at RouterPlex and declare the models you want in the picker: ```json { "language_models": { "openai": { "api_url": "https://api.routerplex.com/v1", "available_models": [ { "name": "claude-opus-4-8", "display_name": "Claude Opus 4.8 (RouterPlex)", "max_tokens": 1000000 }, { "name": "deepseek-v4-pro", "display_name": "DeepSeek V4 Pro (RouterPlex)", "max_tokens": 1000000 } ] } } } ``` Then open the **Agent Panel settings** and paste your RouterPlex key as the OpenAI API key. --- # Claude Code with RouterPlex _Agents & CLIs — Route Claude Code to any RouterPlex chat model — no translation proxy needed. One base URL change adds a prepaid balance with per-key budgets._ Claude Code speaks Anthropic's Messages API, and RouterPlex exposes that format for every chat model — so you can point Claude Code straight at Claude, GPT, Gemini, DeepSeek, and the rest of the chat catalog. No bridge or router required. Works on macOS, Linux, and Windows. ## 1. Install Claude Code ```bash npm install -g @anthropic-ai/claude-code ``` ## 2. Point it at RouterPlex Create or edit Claude Code's settings file and set the base URL and your RouterPlex key under `env`: - macOS / Linux: `~/.claude/settings.json` - Windows: `%USERPROFILE%\.claude\settings.json` ```json { "env": { "ANTHROPIC_BASE_URL": "https://api.routerplex.com", "ANTHROPIC_AUTH_TOKEN": "sk-...", "ANTHROPIC_MODEL": "claude-opus-4-8", "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5" } } ``` - `ANTHROPIC_AUTH_TOKEN` — your RouterPlex API key (create one under [API keys & budgets](/keys-budgets)). - `ANTHROPIC_MODEL` — the model for normal turns. Use any chat ID from the [catalog](/models), e.g. `claude-opus-4-8`, `gpt-5.4`, or `gemini-3.5-flash`. - `ANTHROPIC_SMALL_FAST_MODEL` — the cheaper model Claude Code uses for background chores, e.g. `claude-haiku-4-5` or `deepseek-v4-flash`. Prefer to set it per shell session instead? macOS/Linux: ```bash export ANTHROPIC_BASE_URL=https://api.routerplex.com export ANTHROPIC_AUTH_TOKEN=sk-... export ANTHROPIC_MODEL=claude-opus-4-8 claude ``` Windows (PowerShell): ```powershell $env:ANTHROPIC_BASE_URL = "https://api.routerplex.com" $env:ANTHROPIC_AUTH_TOKEN = "sk-..." $env:ANTHROPIC_MODEL = "claude-opus-4-8" claude ``` ## 3. Verify Start `claude`, then run `/status` — it should show the RouterPlex base URL and your model. Switch models any time with `/model gpt-5.4` or another chat model ID. > Every chat model accepts the Messages format, but capabilities still vary. Claude-family models are the safest default for Claude Code's full tool-use behavior. Give this key its own [budget](/keys-budgets); coding agents burn tokens fast. ## Using claude-code-router? The community [claude-code-router](https://github.com/musistudio/claude-code-router) proxy lets Claude Code talk to arbitrary OpenAI-compatible backends. RouterPlex works as an upstream provider in it — add it to `~/.claude-code-router/config.json`: ```json { "Providers": [ { "name": "routerplex", "api_base_url": "https://api.routerplex.com/v1/chat/completions", "api_key": "sk-...", "models": ["claude-opus-4-8", "gpt-5.5", "deepseek-v4-pro"] } ] } ``` RouterPlex already translates Anthropic Messages for every chat model, including non-Claude models. Use claude-code-router only when you need its extra routing rules, transformations, or local fallback logic — not just to change model families. --- # OpenClaw _Agents & CLIs — Add RouterPlex as a model provider in OpenClaw._ [OpenClaw](https://openclaw.ai) supports custom OpenAI-compatible providers. Add RouterPlex under `models.providers` in `~/.openclaw/openclaw.json`: ```json { "models": { "providers": { "routerplex": { "baseUrl": "https://api.routerplex.com/v1", "apiKey": "${ROUTERPLEX_API_KEY}", "api": "openai-completions", "models": [ { "id": "claude-opus-4-8", "name": "Claude Opus 4.8", "reasoning": true, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 32000 }, { "id": "gemini-3.5-flash", "name": "Gemini 3.5 Flash", "reasoning": false, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 16000 } ] } } }, "agents": { "defaults": { "model": { "primary": "routerplex/claude-opus-4-8" }, "models": { "routerplex/claude-opus-4-8": { "alias": "Opus" }, "routerplex/gemini-3.5-flash": { "alias": "Flash" } } } } } ``` Then export the key and verify connectivity: ```bash export ROUTERPLEX_API_KEY="sk-..." openclaw models status --probe ``` Notes: - `api: "openai-completions"` is the right mode — RouterPlex serves `/v1/chat/completions` (not `/v1/responses`). - Models must appear in the `agents.defaults.models` allowlist or OpenClaw will reject them. - Model references use the `provider/model-id` form, e.g. `routerplex/claude-opus-4-8`. --- # OpenCode _Agents & CLIs — Add RouterPlex as a custom provider in OpenCode._ Add RouterPlex as a custom provider in `~/.config/opencode/opencode.json` (or a per-project `opencode.json`): ```json { "$schema": "https://opencode.ai/config.json", "provider": { "routerplex": { "npm": "@ai-sdk/openai-compatible", "name": "RouterPlex", "options": { "baseURL": "https://api.routerplex.com/v1", "apiKey": "{env:ROUTERPLEX_API_KEY}" }, "models": { "claude-opus-4-8": { "name": "Claude Opus 4.8" }, "gpt-5.5": { "name": "GPT-5.5" }, "kimi-k2.7": { "name": "Kimi K2.7" } } } } } ``` Then pick the model inside OpenCode with `/models`. ## Verify the provider Start OpenCode, open the model picker, and confirm the RouterPlex models from the configuration appear under the RouterPlex provider. Run one small repository question before changing a production workflow. A 401 response means the environment variable is missing or the key is invalid; a model-not-found response usually means the configured model ID does not exactly match the [RouterPlex model catalog](/models). ## Control agent spend Use a dedicated RouterPlex key for OpenCode instead of sharing a production key. Set a hard budget and, if appropriate, allowlist only the models included in the OpenCode configuration. This keeps project usage attributable and limits the cost of an accidental agent loop. Add or remove models in the configuration as your workflow changes; the base URL and authentication remain the same. --- # Codex CLI _Agents & CLIs — Point OpenAI's Codex CLI at RouterPlex._ Codex uses the Responses API for custom model providers. RouterPlex supports that route for Codex; other OpenAI-compatible tools in these docs use `/v1/chat/completions` when their client expects Chat Completions. Configure RouterPlex in your user-level Codex configuration at `~/.codex/config.toml` (the leading dot is required): > Using the Codex extension for VS Code instead of the terminal? See [Codex — VS Code extension](/codex-vscode) — same config file, edited from the settings UI. ```toml # ~/.codex/config.toml model_provider = "routerplex" model = "gpt-5.6-sol" [model_providers.routerplex] name = "RouterPlex" base_url = "https://api.routerplex.com/v1" wire_api = "responses" env_key = "ROUTERPLEX_API_KEY" env_key_instructions = "Set ROUTERPLEX_API_KEY before starting Codex." ``` ## Set the API key Create a dedicated, budget-capped RouterPlex key in the [dashboard](https://routerplex.com/dashboard/keys), then set it in the terminal session that starts Codex: ```bash export ROUTERPLEX_API_KEY="sk-..." codex ``` `env_key` tells Codex to read the key from `ROUTERPLEX_API_KEY` and send it as bearer authentication. Keep the key out of `config.toml`, source control, and shared shell history. Restart Codex after changing either the configuration or the variable. `gpt-5.6-sol` is a practical starting model for coding work. To switch models, replace the `model` value with an exact ID from the [catalog](/models), restart Codex, and try a small task first. ## Add multiple models Codex runs one active model per session, but the same RouterPlex provider can serve any RouterPlex model ID. Keep the shared provider block once in `~/.codex/config.toml`, then switch models with `--model`: ```bash codex --model claude-opus-4-8 codex exec --model gemini-3.5-flash "summarize this repository" ``` For repeatable presets, create profile files next to `config.toml`. Each profile only needs the settings that differ from the base RouterPlex provider: ```toml # ~/.codex/routerplex-opus.config.toml model = "claude-opus-4-8" model_reasoning_effort = "high" ``` ```toml # ~/.codex/routerplex-flash.config.toml model = "gemini-3.5-flash" model_reasoning_effort = "low" ``` Run a preset with: ```bash codex --profile routerplex-opus codex exec --profile routerplex-flash "check this diff" ``` Do not add separate `[model_providers.routerplex-*]` blocks for each model unless the base URL or authentication method changes. The model ID changes; the RouterPlex provider, base URL, and `ROUTERPLEX_API_KEY` stay the same. ## Verify the configuration Start Codex with a small prompt and confirm the request appears under the dedicated key in the RouterPlex dashboard. If authentication fails, run `printenv ROUTERPLEX_API_KEY` in the same shell before starting Codex; it should show that the variable exists, but do not paste the value into logs or support messages. If Codex reports an unsupported API format, make sure `wire_api = "responses"` is present. If a model is rejected, copy its case-sensitive ID from the [live catalog](/models) and update the `model` value in the configuration. ## Use a separate budget Coding agents can make many tool and follow-up calls from one instruction. Create a Codex-specific RouterPlex key with a hard budget rather than reusing a key that also serves an application. The limit is enforced by RouterPlex, so a local configuration mistake or runaway loop cannot spend beyond that key's cap. --- # Aider _Agents & CLIs — AI pair programming in your terminal, billed through RouterPlex._ Aider treats any OpenAI-compatible endpoint as an `openai/`-prefixed model: ```bash export OPENAI_API_BASE="https://api.routerplex.com/v1" export OPENAI_API_KEY="sk-..." # your RouterPlex key aider --model openai/claude-opus-4-8 ``` Or persist it in `~/.aider.conf.yml`: ```yaml openai-api-base: https://api.routerplex.com/v1 openai-api-key: sk-... model: openai/claude-opus-4-8 weak-model: openai/claude-haiku-4-5 ``` > **Note:** the `openai/` prefix tells Aider which wire format to use — the part after the slash must be a RouterPlex model ID verbatim. ## Verify the connection Open a small test repository and ask Aider a read-only question before allowing edits. Check the RouterPlex key logs to confirm the intended model handled the request. A 401 response usually means Aider cannot see OPENAI_API_KEY; a model-not-found response means the value after the openai/ prefix does not match a current [model ID](/models). ## Choose keys and models deliberately Give Aider its own RouterPlex key with a hard budget so its usage stays separate from production traffic. A cheaper weak model can handle repository summaries while the main model handles edits, but test the pair on your codebase rather than assuming every model follows tool instructions equally well. Both model IDs use the same RouterPlex balance and endpoint. --- # OpenHands _Agents & CLIs — Run the OpenHands agent on RouterPlex models._ OpenHands (formerly OpenDevin) uses LiteLLM under the hood, so it understands `openai/`-prefixed custom endpoints. In the OpenHands UI: **Settings → LLM → Advanced**: ```text Custom Model: openai/claude-sonnet-4-6 Base URL: https://api.routerplex.com/v1 API Key: sk-... # your RouterPlex key ``` Or with environment variables when self-hosting: ```bash export LLM_MODEL="openai/claude-sonnet-4-6" export LLM_BASE_URL="https://api.routerplex.com/v1" export LLM_API_KEY="sk-..." ``` The `openai/` prefix selects the OpenAI wire format; the part after the slash is the RouterPlex model ID verbatim. ## Verify before a long task Start OpenHands with a small read-only task and confirm the request appears in RouterPlex key logs under the expected model. If authentication fails, verify the environment variables are available inside the OpenHands container or process, not only in the host shell. If the model is rejected, use the exact case-sensitive ID from the [model catalog](/models). ## Cap autonomous usage OpenHands can continue planning, coding, and retrying without another human message. Create a dedicated key, set a hard budget, and allowlist only the models you have tested with its tool loop. RouterPlex enforces the cap server-side, so the agent cannot spend beyond it even if the local process keeps retrying. Increase the cap only after reviewing a representative task's token use and logs. --- # Keys & budgets _Platform — Per-key budgets, model allowlists, and promotional-account limits._ Each key can have its own guardrails. The dashboard exposes budgets and model allowlists when you create a key: - **Budget** — a hard spend cap for the key. Requests fail once it's reached. - **Allowed models** — restrict a key to specific models (e.g. only cheap ones for a side project). - **Promotional-account limits** — accounts using only promotional credit are automatically capped at 10 RPM and 50,000 TPM per key until the first paid top-up. Funded PAYG keys have no RouterPlex product-level RPM or TPM default. Per-request logs (time, model, tokens, cost) are available per key in the dashboard under [API Keys → Logs](https://routerplex.com/dashboard/keys). ## Recommended setup for agents Coding agents and autonomous tools can burn tokens quickly. For each agent: 1. Create a dedicated key named after the tool (`cursor`, `claude-code`, `openclaw`…). 2. Set a budget you're comfortable losing to a runaway loop. 3. Optionally allowlist only the models that tool should use. That way one misbehaving tool can never spend more than its own cap, and your usage logs stay attributable per tool. --- # Billing & credits _Platform — Prepaid balance, top-ups, and how costs are computed._ Pay-as-you-go by default: you top up a balance (card or crypto), and every request deducts its exact token cost — the same prices shown in the [catalog](https://routerplex.com/models). No subscription is required, and there is no minimum usage commitment; top-ups start at $5. Funded PAYG has no RouterPlex RPM, TPM, or usage-window cap. Optional monthly plans ([Plex Lite, Pro, Max](https://routerplex.com/pricing)) bundle bonus credits worth more than their price with account-wide 4-hour, weekly, and monthly spend windows — per-token prices stay identical. Available RouterPlex balance — including voucher or earned bonus credit — can fund one non-renewing 30-day plan cycle per account. Recurring plans require card checkout. A balance-funded plan is not a real-money payment and never qualifies a referral payment reward. - **Account access:** creating an account is free, but there is no universal signup credit. Named partner bonuses unlock only after a genuine qualifying payment and remain subject to campaign limits. - **Top-ups:** card (min $5) or USDT (min $12) from the [billing page](https://routerplex.com/dashboard/billing). - **When your balance runs out**, requests stop with a budget error; they resume the moment you top up. - **Pricing** is per token, per model — input and output are priced separately, exactly as listed in the catalog. Your live balance, total spend, and per-model breakdown are on the [dashboard](https://routerplex.com/dashboard). --- # Pricing - [Pay as you go](https://routerplex.com/pricing): Top up from $5 and pay per token at vendor list prices — no subscription required. No RouterPlex RPM/TPM or usage-window cap · 3 keys · credit never expires. - [Machine-readable pricing](https://routerplex.com/pricing.md): plan limits, credits, and billing terms in Markdown. - [Plex Lite](https://routerplex.com/pricing): $10/month — $11 in credits every month (+10%). Best when you use about $10 or more each month. - [Plex Pro](https://routerplex.com/pricing): $30/month — $35 in credits every month (+17%). Best when agents or production apps use $30 or more each month. - [Plex Max](https://routerplex.com/pricing): $100/month — $125 in credits every month (+25%). Best when a team or heavy workload uses $100 or more each month. --- # Guides ## Kimi K3 API: Pricing, Context Window and Setup Source: https://routerplex.com/blog/kimi-k3-api-pricing-setup — published 2026-07-16, updated 2026-07-30. Kimi K3 is Moonshot AI's flagship reasoning model for software engineering, long-horizon agent work, visual understanding and large knowledge tasks. The API model ID is `kimi-k3`, the context window is 1,048,576 tokens, and the official standard price is $3 per 1M cache-miss input tokens and $15 per 1M output tokens. Kimi K3 is now available on RouterPlex through the same OpenAI-compatible endpoint used for GPT, Claude, Gemini and the rest of the catalog. > Sources: [Moonshot Kimi K3 pricing](https://platform.kimi.ai/docs/pricing/chat-k3) and [Kimi K3 quickstart](https://platform.kimi.ai/docs/guide/kimi-k3-quickstart), checked July 16, 2026. Model capabilities and prices can change. ## Kimi K3 API pricing | Token category | Official price per 1M tokens | | --- | ---: | | Cache-hit input | $0.30 | | Cache-miss input | $3.00 | | Output | $15.00 | Moonshot defines 1M as 1,000,000 tokens for billing. Cache hits cost one tenth of normal input, so repeated long instructions, tool definitions and conversation prefixes can be materially cheaper when the provider reuses the cached prefix. RouterPlex bills those same Kimi K3 categories at the published rates. A $5 prepaid balance therefore buys roughly 1.67 million cache-miss input tokens, 16.67 million cached input tokens, or 333,333 output tokens if the workload used only one category. Real requests combine input and output. See the live [Kimi K3 API price page](/models/kimi-k3) for the current RouterPlex catalog rate. ## Kimi K3 pricing on OpenRouter vs RouterPlex Per-token prices for Kimi K3 are the same on OpenRouter and RouterPlex, because both pass through Moonshot's published rates. The cost difference is the credit purchase fee. Buying $100 of Kimi K3 credit costs $105.50 by card on OpenRouter, or $100 on RouterPlex. | | OpenRouter | RouterPlex | | --- | ---: | ---: | | Cache-miss input per 1M | $3.00 | $3.00 | | Cache-hit input per 1M | $0.30 | $0.30 | | Output per 1M | $15.00 | $15.00 | | Fee to buy credit by card | 5.5% ($0.80 min) | $0 | | Fee to buy credit by crypto | 5% | $0 | | Cost of $100 in credit | $105.50 | $100.00 | | Unused credit expires | Reserves the right to expire after 365 days | Does not expire | | Refund window on unused credit | 24 hours from the transaction | On request, at our discretion | | Balance can go negative | Yes | No | > OpenRouter fees, expiry and refund terms checked July 30, 2026 against its [FAQ](https://openrouter.ai/docs/faq) and [terms of service](https://openrouter.ai/terms). Terms can change, so confirm at checkout. The per-token rate is what most comparisons publish, so the two look identical on a price page. The fee applies whenever credit is purchased, which means it scales with how much credit you buy rather than how many tokens you burn. On small top-ups the $0.80 card minimum dominates: $5 of credit costs $5.80, an effective 16%. For the full breakdown, see [OpenRouter credits, fees and expiry](/blog/openrouter-top-up-fees) and the [RouterPlex vs OpenRouter comparison](/vs/openrouter). ## What Kimi K3 costs on a real workload List prices per 1M tokens are hard to reason about. Here is a single agent turn that sends a 40K-token prompt and returns 2K tokens of output, priced three ways depending on how much of the prompt hits Moonshot's cache: | Cache behaviour | Input cost | Output cost | Total per turn | 1,000 turns | | --- | ---: | ---: | ---: | ---: | | No cache (all cache-miss) | $0.120 | $0.030 | $0.150 | $150.00 | | 75% cached prefix | $0.039 | $0.030 | $0.069 | $69.00 | | 90% cached prefix | $0.023 | $0.030 | $0.053 | $52.80 | The arithmetic for the 75% row: ```text 30,000 cached tokens × $0.30/1M = $0.009 10,000 uncached tokens × $3.00/1M = $0.030 2,000 output tokens × $15.00/1M = $0.030 total = $0.069 ``` Two things fall out of this. First, **cache design matters more than model choice** on Kimi K3 — a well-structured stable prefix cuts the input bill by two thirds, which dwarfs most price differences between comparable models. Keep system prompts, tool definitions and file context in a fixed prefix so the cacheable portion stays byte-identical between turns. Second, **output becomes the dominant cost once caching works.** Output is 20% of an uncached turn but 57% of a 90%-cached one. Reasoning models emit a lot of tokens, so once the cache is working, capping `max_tokens` is a more effective lever than shaving the prompt. ## Is there a Kimi K3 subscription? No. Kimi K3 API access is billed per token, not by subscription. Kimi's consumer subscription plans cover the Kimi chat app and do not include API keys, so there is no monthly seat cost to add on top of token spend. A prepaid balance is the entire cost of API access. That matters for budgeting: with no recurring floor, a Kimi K3 workload that runs for one week costs one week of tokens. RouterPlex follows the same model — a prepaid balance, per-key hard budgets, and no subscription tier gating model access. ## Kimi K3 specifications | Capability | Kimi K3 | | --- | --- | | Model ID | `kimi-k3` | | Context window | 1,048,576 tokens | | Input | Text and images | | Reasoning | Always enabled | | Current reasoning effort | `max` | | Tool calling | Supported | | Structured output | Supported | | OpenAI-compatible chat API | Yes | Moonshot describes Kimi K3 as a 2.8-trillion-parameter model built with Kimi Delta Attention and Attention Residuals. Those architecture details matter less operationally than the API behavior: K3 can retain a large working context, inspect images, reason before answering and participate in tool-calling loops. ## Call Kimi K3 with RouterPlex Create a RouterPlex key, give it a hard budget, and send the standard chat-completions request: ```bash curl https://api.routerplex.com/v1/chat/completions -H "Authorization: Bearer $ROUTERPLEX_API_KEY" -H "Content-Type: application/json" -d '{ "model": "kimi-k3", "messages": [ {"role": "user", "content": "Review this migration plan and identify the highest-risk assumption."} ], "reasoning_effort": "max" }' ``` The equivalent Python setup uses the regular OpenAI client: ```python import os from openai import OpenAI client = OpenAI( api_key=os.environ["ROUTERPLEX_API_KEY"], base_url="https://api.routerplex.com/v1", ) response = client.chat.completions.create( model="kimi-k3", reasoning_effort="max", messages=[{"role": "user", "content": "Design a rollback-safe deployment plan."}], ) print(response.choices[0].message.content) ``` ## Where Kimi K3 fits Kimi K3 is most relevant when a task needs more than a short answer: - Repository-scale planning with many files and constraints. - Long-running agents that call multiple tools. - Large document collections or extended conversation state. - Visual inspection combined with technical reasoning. - Structured JSON output for downstream automation. For a dedicated coding model with a smaller 256K context, Kimi K2.7 Code may still be a useful comparison. Kimi K3 is the broader flagship choice when coding is mixed with research, planning, images or long-context knowledge work. ## Kimi K3 API details to watch K3 always reasons. Moonshot currently accepts only `reasoning_effort="max"`, although more levels are planned. Streaming responses can expose reasoning and final-answer deltas separately. For multi-turn tool use, retain the complete assistant message returned by the model. Keeping only the visible text can remove tool-call or reasoning state needed by the next request. Moonshot also notes that its web-search capability is being updated, so do not make a production design depend on that feature without retesting it. ## Run a controlled Kimi K3 test Start with one narrow workload and a hard key budget. Compare answer quality, latency, cached-token behavior and total cost against the model you currently use. [Create a RouterPlex account](/sign-up), add the minimum $5 balance, and select `kimi-k3`. You can compare it with [GPT-5.6](/blog/gpt-5-6-api-pricing-sol-terra-luna) and [Claude Fable 5](/blog/claude-fable-5-api-pricing-setup) through the same endpoint. ### Frequently asked questions **How much does the Kimi K3 API cost?** Moonshot publishes Kimi K3 at $3 per 1M cache-miss input tokens, $0.30 per 1M cache-hit input tokens, and $15 per 1M output tokens. RouterPlex uses the same published rates. **What is the Kimi K3 context window?** Kimi K3 supports a 1,048,576-token context window, commonly described as 1M tokens. **Does Kimi K3 support images?** Yes. Moonshot documents native visual understanding and supports image input in chat messages. **Can Kimi K3 use the OpenAI SDK?** Yes. Kimi K3 is available through OpenAI-compatible chat completions. With RouterPlex, use https://api.routerplex.com/v1 and model ID kimi-k3. **Is Kimi K3 cheaper on OpenRouter or RouterPlex?** Per-token list prices are the same on both, because both pass through Moonshot's published rates. The difference is the credit purchase fee: buying $100 of credit costs $105.50 by card on OpenRouter (5.5%, $0.80 minimum) or $105 by crypto, versus $100 on RouterPlex. Fees were checked July 19, 2026. **Is there a Kimi K3 subscription plan for API access?** No. Kimi's consumer subscriptions cover the Kimi chat app, not API keys. Kimi K3 API access is billed per token with no monthly seat fee, so a prepaid balance is the whole cost. RouterPlex works the same way: pay per token from a prepaid balance, no subscription. ## Grok API Pricing: Every Model, Rate and the 200K Cliff Source: https://routerplex.com/blog/grok-api-pricing — published 2026-07-30, updated 2026-07-30. **Grok 4.5 costs $2 per 1M input tokens and $6 per 1M output tokens**, with cached input at $0.30 per 1M, over a 500K-token context window. The rate that catches people out: once a prompt reaches **200K tokens, the price doubles to $4 input and $12 output — and the higher rate applies to every token in that request**, not just the ones past the threshold. Grok models are OpenAI-compatible, so they can be called through any gateway that speaks `/v1/chat/completions`. On RouterPlex, `grok-4.5` is billed at xAI list price with no markup. > Sources: [xAI models and pricing](https://docs.x.ai/developers/models) and [xAI pricing docs](https://docs.x.ai/developers/pricing), checked July 30, 2026. Rates change; verify before committing to a volume estimate. ## Grok API pricing, every text model All figures are USD per 1M tokens. The first row of each model is the standard rate for prompts under 200K tokens; the second is long-context pricing at or above 200K. | Model | Context | Input | Cached input | Output | | --- | --- | ---: | ---: | ---: | | `grok-4.5` | 500K | $2.00 | $0.30 | $6.00 | | `grok-4.5` (≥200K prompt) | 500K | $4.00 | $0.60 | $12.00 | | `grok-4.3` | 1M | $1.25 | $0.20 | $2.50 | | `grok-4.3` (≥200K prompt) | 1M | $2.50 | $0.40 | $5.00 | | `grok-4.20-0309-reasoning` | 1M | $1.25 | $0.20 | $2.50 | | `grok-4.20-0309-non-reasoning` | 1M | $1.25 | $0.20 | $2.50 | | `grok-4.20-multi-agent-0309` | 1M | $1.25 | $0.20 | $2.50 | | `grok-build-0.1` | 256K | $1.00 | $0.20 | $2.00 | | `grok-build-0.1` (≥200K prompt) | 256K | $2.00 | $0.40 | $4.00 | Grok 4.5 is the flagship and the most expensive per token. Grok 4.3 and the Grok 4.20 variants sit at roughly 60% of the input price and 40% of the output price, over twice the context. Grok Build 0.1 is the cheapest published text rate. ## The 200K cliff is the number that matters Most pricing tables present long-context pricing as a footnote. It deserves better, because it is not a marginal rate. xAI's rule is explicit: *requests whose prompt reaches the listed token threshold are billed at the higher rate for all tokens in the request.* There is no blended calculation. ```text 199,000-token prompt on grok-4.5 → 199,000 × $2.00/1M = $0.398 201,000-token prompt on grok-4.5 → 201,000 × $4.00/1M = $0.804 ``` A 1% larger prompt costs 102% more. If you are running long-context agent loops that accumulate history, crossing 200K mid-session doubles the cost of every subsequent turn that carries the full transcript. Two practical consequences: - **Trim before the threshold, not after.** Compaction that fires at 250K tokens has already paid the penalty. Fire it at 180K. - **Grok 4.3 is often the better long-context choice.** At 1M context and $2.50/$5.00 even in its long-context tier, it is cheaper past 200K than Grok 4.5 is *below* 200K on output. ## What a real workload costs Take a coding-agent turn with a 40K-token prompt and 2K tokens of output, well under the threshold: | Model | Input cost | Output cost | Total per turn | 1,000 turns | | --- | ---: | ---: | ---: | ---: | | `grok-4.5` | $0.080 | $0.012 | $0.092 | $92.00 | | `grok-4.3` | $0.050 | $0.005 | $0.055 | $55.00 | | `grok-build-0.1` | $0.040 | $0.004 | $0.044 | $44.00 | Cached input changes this substantially for agents that resend a stable system prompt and file context. At $0.30 per 1M, a cache hit on Grok 4.5 input is 85% cheaper than a cache miss, which usually matters more than the choice between 4.5 and 4.3. ## Calling Grok through an OpenAI-compatible endpoint Grok speaks the OpenAI chat-completions schema, so the only changes are the base URL, the key, and the model ID. ```python import os from openai import OpenAI client = OpenAI( base_url="https://api.routerplex.com/v1", api_key=os.environ["ROUTERPLEX_API_KEY"], ) response = client.chat.completions.create( model="grok-4.5", messages=[{"role": "user", "content": "Summarise this changelog."}], ) print(response.choices[0].message.content) ``` The same key reaches every other model in the catalog, so switching from `grok-4.5` to `claude-opus-5` or `kimi-k3` is a one-string change with no new account, no second balance, and no separate invoice. ## Subscriptions are not API credit Grok's consumer plans and the developer API are separate products on separate billing. A SuperGrok subscription does not produce API credit, and API spend is not covered by a monthly plan. If your goal is programmatic access, price the API per token and ignore the subscription tiers entirely — see [xAI's pricing page](https://x.ai/pricing) for current consumer plans. ## Capping Grok spend Per-token billing on a long-context model is exactly the shape of bill that surprises people, and the 200K cliff makes it worse. On RouterPlex every API key carries its own hard lifetime budget, enforced server-side: a key with a $20 budget stops at $20 whether the overrun came from a runaway agent loop, a leaked key, or a prompt that quietly crossed 200K tokens. The balance is prepaid and cannot go negative. Compare the [live Grok 4.5 rate](/models/grok-4-5) against the rest of the [model catalog](/models), or [start with a $5 top-up](/sign-up). ### Frequently asked questions **How much does the Grok API cost?** xAI lists Grok 4.5 at $2 per 1M input tokens and $6 per 1M output tokens for prompts under 200K tokens, with cached input at $0.30 per 1M. Prompts at or above 200K tokens are billed at $4 input and $12 output per 1M. **What is the cheapest Grok model on the API?** Grok Build 0.1 is the lowest published rate at $1.00 per 1M input and $2.00 per 1M output tokens under 200K, with a 256K context window. Grok 4.3 is $1.25 input and $2.50 output over a 1M-token context. **Why did my Grok bill double on a long request?** xAI uses long-context pricing. When a prompt reaches the 200K-token threshold, the higher rate applies to every token in that request, not just the tokens past the threshold. A 201K-token prompt on Grok 4.5 is billed entirely at $4/$12, not $2/$6. **What is the Grok 4.5 context window?** Grok 4.5 has a 500K-token context window. Grok 4.3 and the Grok 4.20 variants carry 1M tokens, and Grok Build 0.1 carries 256K. **Is Grok API pricing the same as a SuperGrok subscription?** No. The consumer Grok plans and the developer API are billed separately. Paying for a Grok subscription does not grant API credit, and API usage is charged per token. **Can I use Grok without an xAI account?** Yes. Any gateway exposing an OpenAI-compatible endpoint can route Grok requests. On RouterPlex, grok-4.5 is callable at xAI list price from the same prepaid balance and key as GPT, Claude, Gemini and the rest of the catalog. ## OpenRouter Credits: Fees, Expiry, and What $100 Actually Costs Source: https://routerplex.com/blog/openrouter-top-up-fees — published 2026-07-14, updated 2026-07-30. **OpenRouter credits are prepaid deposits, denominated in USD, that OpenRouter deducts from on every request.** As of July 30, 2026, buying them costs **5.5% by card with a $0.80 minimum, or 5% by cryptocurrency**. OpenRouter's terms reserve the right to **expire unused credits 365 days after purchase**, and refunds for unused credits may be requested only **within 24 hours** of the transaction. OpenRouter says it does not mark up the underlying model rate. So OpenRouter pricing has two layers: the selected model's provider rate, and the fee charged when credits are purchased. That distinction matters because a page showing vendor list price can still cost more than vendor list price once the credit-purchase fee is included. > Sources: [OpenRouter FAQ](https://openrouter.ai/docs/faq), [OpenRouter terms](https://openrouter.ai/terms), [OpenRouter pricing](https://openrouter.ai/pricing), and its [platform fee announcement](https://openrouter.ai/blog/announcements/simplifying-our-platform-fee/), all checked July 30, 2026. Terms can change, so verify the current checkout and terms before making a large purchase. ## What OpenRouter credits are Credits are not a subscription and not a token allowance. They are a dollar balance you fund in advance, and each API or chat request subtracts its computed cost from that balance. Three properties are worth knowing before you fund a large amount: | Property | OpenRouter (per its published terms) | RouterPlex | | --- | --- | --- | | Cost to buy $100 of credit | $105.50 by card, $105.00 by crypto | $100.00 | | Unused credit expires | Reserves the right to expire after 365 days | Purchased credit does not expire | | Refund window on unused credit | 24 hours from the transaction | Unused purchased credit refundable on request, at our discretion | | Balance can go negative | Yes — see the [402 guide](/blog/openrouter-negative-balance-402) | No; requests stop at zero | The expiry clause is the one most people miss. If you pre-fund a year of usage to amortise the 5.5% fee, you are taking on the risk that the unused remainder is reclaimable by the vendor at the twelve-month mark. Funding in smaller increments avoids that risk but pays the $0.80 minimum more often — on a $5 top-up that minimum is a 16% effective fee. ## How OpenRouter pricing works OpenRouter is pay-as-you-go rather than a required monthly subscription. Each model has input, output, and sometimes cache or image rates. Usage is deducted from purchased account credits. The purchase fee sits outside the model rate, which is why total cost should be calculated from money paid to usable balance. ```text total cost = model usage + credit purchase fee + optional products ``` For most developers comparing gateways, the funding fee is the predictable platform-level difference. Model rates vary by model and provider, while 5.5% applies whenever card credits are purchased under the published terms. ## The $100 fee math | Payment route | Usable model credit | Purchase fee | Total paid | | --- | ---: | ---: | ---: | | OpenRouter card | $100.00 | $5.50 | $105.50 | | OpenRouter crypto | $100.00 | $5.00 | $105.00 | | RouterPlex card or crypto | $100.00 | $0.00 | $100.00 | The arithmetic is simple: multiply the credit amount by the purchase-fee rate, then add that fee to the amount charged. ```text $100.00 credit × 5.5% card fee = $5.50 fee $100.00 credit + $5.50 fee = $105.50 charged ``` For a small card top-up, the minimum matters more. A 5.5% fee on $5 would be $0.275, but a $0.80 minimum means the effective fee is much higher on that purchase. You would pay $5.80 to receive $5.00 in credit, an effective cost of 16% relative to the usable credit. ## A purchase fee is not a token markup It is useful to separate three numbers when comparing an LLM gateway: - **Model rate:** the input and output token price shown for a model. - **Purchase fee:** the amount charged to turn dollars into gateway credits. - **Operational extras:** logging, routing, observability, or support products that may have separate prices. Two gateways can show the same Claude or GPT token rate while producing different total costs. If Gateway A charges $105.50 for $100 of credit and Gateway B charges $100 for $100 of credit, Gateway A is effectively 5.5% more expensive before a single token is generated. This is why comparisons based only on a model table are incomplete. Follow the money from payment method to usable balance. If the fee is the reason you are comparing services, start with the broader [OpenRouter alternatives guide](/blog/openrouter-alternatives). ## What the fee costs over time The dollar amount becomes more visible once usage is recurring. | Credits purchased per month | 5.5% monthly fee | Fee over 12 months | | --- | ---: | ---: | | $20 | $1.10 | $13.20 | | $100 | $5.50 | $66.00 | | $500 | $27.50 | $330.00 | | $1,000 | $55.00 | $660.00 | This is not a claim that OpenRouter is always the wrong choice. It has a broad catalog and mature routing features that may justify the fee for a particular team. The point is to include the purchase fee in the comparison instead of treating it as invisible. ## How RouterPlex handles top-ups RouterPlex uses a prepaid balance with no top-up fee and no model markup. Pay $5 and the account receives $5 in usable credits. Pay $100 and it receives $100. The tradeoff is explicit: RouterPlex is focused on one OpenAI-compatible endpoint, a curated multi-provider catalog, and spend controls. It is not trying to reproduce every feature of every larger gateway. Each API key can have its own hard lifetime budget. That lets you create separate keys for a coding agent, production app, evaluation job, or client without giving each workload access to the entire account balance. See the [full model price list](/models) and the detailed [RouterPlex vs OpenRouter comparison](/vs/openrouter). ## A practical comparison checklist Before choosing a gateway, record these numbers for your actual workload: 1. The amount charged to receive $100 in usable credit. 2. The input and output price of the models you use most. 3. Whether unused credit expires. 4. Whether a balance can become negative. 5. Whether keys support a hard server-side spend limit. 6. Whether switching away requires code changes beyond a base URL and key. The cheapest-looking token table is not necessarily the lowest total cost. The useful question is: how many usable model dollars arrive after payment, and how tightly can you cap the downside? ## Start with the smallest real test For a self-serve API, a paid $5 test is more informative than a feature matrix. Create one key with a $5 budget, run the same prompt set against the models you care about, and inspect latency, output quality, and the final balance. [Start RouterPlex with a $5 top-up](/sign-up), or compare every published rate in the [model catalog](/models). ### Frequently asked questions **What are OpenRouter credits?** Credits are prepaid deposits denominated in USD that OpenRouter deducts from as you make API or chat requests. You buy them up front by card or cryptocurrency, and inference cost is subtracted per request. **Do OpenRouter credits expire?** They can. OpenRouter's terms state it reserves the right to expire unused credits three hundred sixty-five (365) days after purchase. Purchased RouterPlex credit does not expire. **Can I get a refund on OpenRouter credits?** Only within a narrow window. OpenRouter's terms say refunds for unused credits may be requested within twenty-four (24) hours of the transaction. Platform fees and cryptocurrency payments are not refundable. **Does OpenRouter mark up model token prices?** OpenRouter says it does not mark up the underlying provider price. Its platform fee is charged when credits are purchased, which is separate from the per-token model rate. **How much does $100 of OpenRouter credit cost by card?** At a 5.5% purchase fee, $100 of usable credit costs $105.50. Re-check the current checkout and OpenRouter documentation before purchasing because fees can change. **Does RouterPlex charge a top-up fee?** No. A $100 RouterPlex top-up adds $100 in usable prepaid credits. Published model rates are vendor list prices with no additional markup. ## Claude Opus 5 API: Pricing, Context and Setup Source: https://routerplex.com/blog/claude-opus-5-api-pricing-setup — published 2026-07-27, updated 2026-07-27. Claude Opus 5 is Anthropic's current Opus-tier model, released on July 24, 2026. Its API model ID is `claude-opus-5`, its context window is 1 million tokens, and standard pricing is **$5 per 1M input tokens and $25 per 1M output tokens** — the same rate Anthropic charges for Claude Opus 4.8. Claude Opus 5 is live on RouterPlex through both the OpenAI-compatible `/v1/chat/completions` endpoint and the Anthropic-compatible `/v1/messages` endpoint, so the same key reaches Opus 5, GPT-5.6, Gemini and the rest of the catalog. > Sources: [Anthropic Claude pricing](https://platform.claude.com/docs/en/about-claude/pricing), [What's new in Claude Opus 5](https://platform.claude.com/docs/en/about-claude/models/whats-new-opus-5), and the [Claude model overview](https://platform.claude.com/docs/en/about-claude/models/overview), checked July 27, 2026. Prices and limits can change. ## Claude Opus 5 API pricing | Token category | Price per 1M tokens | | --- | ---: | | Standard input | $5.00 | | 5-minute cache write | $6.25 | | 1-hour cache write | $10.00 | | Cache read | $0.50 | | Output | $25.00 | The headline number is that the price did not move. Opus 5 is positioned as a substantial capability step over Opus 4.8 while staying at the Opus-tier rate, which makes it the cheaper of the two on a cost-per-completed-task basis whenever it needs fewer retries or shorter agent runs. Anthropic also offers a research-preview fast mode for Opus 5 at $10 input and $50 output per 1M tokens. That is a first-party Claude API feature, not part of the standard rate, and it is not available through third-party gateways. See the live [Claude Opus 5 API pricing page](/models/claude-opus-5) for the rate RouterPlex bills. ## Claude Opus 5 specifications | Capability | Claude Opus 5 | | --- | --- | | Model ID | `claude-opus-5` | | Context window | 1M tokens (default and maximum) | | Maximum output | 128K tokens | | Vision input | Yes | | Tool use | Yes | | Effort levels | `low`, `medium`, `high`, `xhigh`, `max` | | Minimum cacheable prompt | 512 tokens | | OpenAI- and Anthropic-compatible access on RouterPlex | Yes | The model ID has no date suffix. Write `claude-opus-5` exactly; a constructed ID like `claude-opus-5-20260724` will fail. ## Four API changes worth knowing before you migrate Most launch coverage stops at the benchmark chart. If you are moving an existing Opus 4.8 integration, these behavioural differences matter more than the scores. **Thinking is on by default.** On Opus 4.8, omitting the `thinking` parameter meant the model did not think. On Opus 5, omitting it runs adaptive thinking. Because `max_tokens` caps thinking *and* response text together, a request that was sized tightly around its answer on Opus 4.8 can now truncate mid-response. Revisit `max_tokens` on any route that never set `thinking`. **Disabling thinking is capped at `high` effort.** Sending `thinking: {"type": "disabled"}` together with `effort` of `xhigh` or `max` returns a 400. The combination is valid on Opus 4.8, so audit every call site rather than just the first one — effort and thinking are validated per request. **The full effort ladder is available.** Opus 5 supports `low` through `max` with no beta header, and the lower rungs are unusually strong on this model. Effort defaults carried over from an older model are rarely the right setting; sweep it against your own evaluation rather than assuming `high`. **Prompt caching starts at 512 tokens.** Opus 4.8 required a 1024-token prefix before a cache entry was created. Opus 5 halves that, so system prompts you had written off as too short to cache may now cache with no code change. At a $0.50 cache read against $5.00 standard input, that is worth re-checking. ## Call Claude Opus 5 with RouterPlex The OpenAI-compatible shape works with any OpenAI SDK: ```bash curl https://api.routerplex.com/v1/chat/completions \ -H "Authorization: Bearer $ROUTERPLEX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-opus-5", "messages": [ {"role": "user", "content": "Trace this bug across the repository and name the root cause."} ] }' ``` Python uses the same base URL as every other model in the catalog: ```python import os from openai import OpenAI client = OpenAI( api_key=os.environ["ROUTERPLEX_API_KEY"], base_url="https://api.routerplex.com/v1", ) response = client.chat.completions.create( model="claude-opus-5", messages=[{"role": "user", "content": "Review this migration plan for irreversible steps."}], ) print(response.choices[0].message.content) ``` ## Use Claude Opus 5 in Claude Code Claude Opus 5 is reachable through the Anthropic-compatible `/v1/messages` endpoint, so Claude Code and the official Anthropic SDKs point straight at RouterPlex with no router or proxy in between: ```bash export ANTHROPIC_BASE_URL=https://api.routerplex.com export ANTHROPIC_AUTH_TOKEN=$ROUTERPLEX_API_KEY export ANTHROPIC_MODEL=claude-opus-5 ``` Thinking blocks, tool use and prompt caching all pass through in the native Anthropic format. The full walkthrough is in the [Claude Code setup guide](https://docs.routerplex.com/claude-code), and the billing comparison against a subscription is in [Claude Code pricing](/blog/claude-code-pricing). ## Claude Opus 5 vs Opus 4.8, Fable 5 and Sonnet 5 | Model | Input / 1M | Output / 1M | Context | Best fit | | --- | ---: | ---: | ---: | --- | | Claude Opus 5 | $5 | $25 | 1M | Current Opus default for agents and hard coding work | | Claude Opus 4.8 | $5 | $25 | 1M | Stable baseline for integrations already tuned to it | | Claude Fable 5 | $10 | $50 | 1M | Highest-capability tier, twice the Opus rate | | Claude Sonnet 5 (introductory) | $2 | $10 | 1M | Cheapest strong Claude for volume coding and agent work | Opus 5 and Opus 4.8 cost the same, so there is no pricing reason to stay on 4.8 — only the migration cost of re-testing the behavioural changes above. Fable 5 remains the escalation target when a task genuinely needs it, at double the rate. Against [Claude Sonnet 5](/models/claude-sonnet-5), the gap is 2.5x on both input and output. For high-volume work where a cheaper model already succeeds, that difference compounds quickly. ## Control Opus 5 spend before the first request At $25 per 1M output tokens, a long-running agent can consume a balance faster than expected — and thinking now being on by default means output token counts will be higher than the equivalent Opus 4.8 request. Three practical controls: - Give the Opus 5 key its own hard budget so a runaway loop cannot drain the account balance. - Set `effort` deliberately. Start lower than you think you need and raise it where evaluation shows a real difference. - Reuse stable system prompts and tool definitions so the 512-token cache minimum can actually earn you the $0.50 cache-read rate. ## Test it against a real task Pick a task where a better result has measurable value, then run the same input through Opus 5, Opus 4.8 and Sonnet 5. Compare correctness, review time and final billed cost rather than benchmark headlines — your prompt structure, tools and error tolerance decide which price-quality point wins. [Create a RouterPlex key with a hard budget](/sign-up), or compare Opus 5 with [Claude Fable 5](/blog/claude-fable-5-api-pricing-setup) and [Kimi K3](/blog/kimi-k3-api-pricing-setup) through the same endpoint. ### Frequently asked questions **How much does the Claude Opus 5 API cost?** Anthropic lists Claude Opus 5 at $5 per 1M input tokens and $25 per 1M output tokens, with cache reads at $0.50 per 1M. That is the same standard rate as Claude Opus 4.8. **What is the Claude Opus 5 context window?** Claude Opus 5 has a 1M-token context window, which is both the default and the maximum, and supports up to 128K output tokens per request. **What is the Claude Opus 5 model ID?** The API model ID is claude-opus-5. It carries no date suffix, so do not append one. **Is Claude Opus 5 more expensive than Claude Opus 4.8?** No. Both are $5 per 1M input and $25 per 1M output tokens on standard pricing. Opus 5 also lowers the minimum cacheable prompt to 512 tokens, so short prompts that could not be cached on Opus 4.8 can now create cache entries. **Claude Opus 5 or Claude Fable 5?** Claude Fable 5 costs $10 input and $50 output per 1M tokens, twice the Opus 5 rate. Start on Opus 5 and escalate to Fable only when a measured evaluation shows the harder model changes the outcome on your task. **Can I use Claude Opus 5 without an Anthropic account?** Yes. Gateways that expose an OpenAI- or Anthropic-compatible endpoint can route claude-opus-5 requests. On RouterPlex it is callable from one prepaid balance through both /v1/chat/completions and /v1/messages. ## Claude Code Router Setup: Current CCR Guide for Any Model Source: https://routerplex.com/blog/claude-code-router-setup — published 2026-07-14, updated 2026-07-26. Claude Code Router, usually shortened to CCR, is a local control plane that connects Claude Code and other coding agents to multiple model providers. The current release is no longer configured primarily through the `config.json` files shown in many older tutorials. It uses a desktop or browser management UI, a local gateway, provider profiles, routing rules, and SQLite-backed configuration. This guide covers the current setup and the simpler direct-gateway alternative. > Sources: the official [Claude Code Router repository](https://github.com/musistudio/claude-code-router) and [CCR CLI documentation](https://ccrdesk.top/en/guides/cli/), checked July 19, 2026 against version 3.0.14. CCR changes quickly, so re-check the release notes if the UI differs. ## What Claude Code Router does CCR listens on a local model-gateway endpoint and decides which upstream provider and model should handle a request. It can centralize provider credentials, model selection, conditional routes, retries, fallbacks, client keys, logs, and cost estimates. That is useful when you want routing policy on your machine. It is unnecessary when one upstream already accepts Claude Code's native Anthropic Messages request and you do not need local routing rules. | Route | Best for | Local gateway required | | --- | --- | --- | | Claude Code Router | Multiple providers, local profiles, conditional routes, fallbacks | Yes | | Direct Anthropic-compatible gateway | One upstream route with fewer moving parts | No | ## Install the current Claude Code Router The npm CLI requires Node.js 22 or newer: ```bash node --version npm install -g @musistudio/claude-code-router ccr --help ``` Start the background service and open the browser UI: ```bash ccr ui ``` For an SSH or headless session, use `ccr ui --no-open` and open the printed authenticated URL through a secure tunnel. The management UI prefers `http://127.0.0.1:3458`. The model gateway prefers `http://127.0.0.1:3456`. CCR can choose a following port when one is occupied, so trust the URL it prints instead of assuming a port. Desktop installers for macOS, Windows, and Linux are available from [GitHub Releases](https://github.com/musistudio/claude-code-router/releases). The desktop and npm distributions share the same local data directory. ## Do not edit a legacy config.json Current CCR stores live configuration in `config.sqlite`: - macOS and Linux: `~/.claude-code-router/config.sqlite` - Windows: `%APPDATA%\claude-code-router\config.sqlite` A legacy `config.json` is read only as a one-time migration source when no SQLite configuration exists. Use the UI to add providers and routes. For backups, stop CCR or use its export function instead of copying a live SQLite file. ## Add RouterPlex as an upstream provider Create a dedicated RouterPlex API key before opening CCR. Give it a hard $5 or $10 budget for the first test. A local router can retry, fall back, or run several agent profiles, so the upstream key should enforce the real financial limit. In CCR: 1. Open **Providers** and choose **Add Provider**. 2. Select **Other / custom API endpoint**. 3. Name the provider `RouterPlex`. 4. Choose the OpenAI-compatible chat protocol. 5. Use `https://api.routerplex.com/v1` as the API base URL. 6. Paste the dedicated RouterPlex key. 7. Add model IDs from the live [RouterPlex model catalog](/models). 8. Run CCR's protocol probe or connectivity test, then save. Use exact model IDs. A display name such as "Claude Opus" is not interchangeable with an API ID such as `claude-opus-4-8`. ## Create a CCR client key and Claude Code profile CCR separates upstream provider credentials from local gateway client keys. The RouterPlex key pays for upstream model calls. A CCR client key authorizes Claude Code to call the local gateway. Do not paste one where the other belongs. Open **API Keys** and create a client key. Then open **Agent Config**, add a Claude Code profile, select the RouterPlex-backed model and desired scope, and apply the configuration. Keep the gateway running under **Server**. An enabled profile can be launched from the CLI: ```bash ccr "Claude - RouterPlex" cli ``` Use the exact profile name or ID shown by CCR. The generated profile keeps Claude Code pointed at the local gateway while CCR resolves the upstream provider and model. ## Verify the resolved route Start with an empty directory and a read-only prompt. Before giving the agent a real repository, confirm both sides of the route: 1. CCR Logs show the expected request model, resolved provider, resolved model, status, tokens, and latency. 2. The RouterPlex dashboard shows the same upstream model and a plausible cost under the dedicated key. 3. The RouterPlex key budget decreases by the billed amount. 4. Stopping CCR makes the local route fail, proving Claude Code is not silently calling another endpoint. Only then increase the budget or enable fallback models. ## Skip CCR with a direct Messages gateway Claude Code can connect directly to a gateway that supports the Anthropic Messages API. RouterPlex exposes that route for its chat models, including non-Anthropic models translated at the gateway boundary. Create or edit the Claude Code settings file: - macOS and Linux: `~/.claude/settings.json` - Windows: `%USERPROFILE%\.claude\settings.json` ```json { "env": { "ANTHROPIC_BASE_URL": "https://api.routerplex.com", "ANTHROPIC_AUTH_TOKEN": "sk-...", "ANTHROPIC_MODEL": "claude-opus-4-8", "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5" } } ``` This direct route has fewer moving parts. Use CCR when its local routing, provider profiles, fallbacks, or logs solve a real problem; do not add it only because an old guide says every non-Anthropic model needs a translation proxy. The complete direct setup is also in the [RouterPlex Claude Code documentation](https://docs.routerplex.com/claude-code). ## Routing Claude Code Router to specific backends CCR treats every upstream the same way: a provider profile with a protocol, a base URL, and a set of model IDs. Once you know that pattern, the common variations are small changes to those three fields. | Backend | Protocol | Base URL pattern | Notes | | --- | --- | --- | --- | | RouterPlex | OpenAI-compatible | `https://api.routerplex.com/v1` | One key, prepaid balance, per-key budget | | Ollama (local) | OpenAI-compatible | `http://localhost:11434/v1` | No API cost; quality and speed depend on local hardware | | OpenRouter | OpenAI-compatible | `https://openrouter.ai/api/v1` | Larger niche catalog; 5.5% card fee on credit purchases | | Direct vendor | Vendor-specific | Vendor base URL | Requires a separate account and key per vendor | ### Claude Code Router with Ollama Point a provider profile at the local Ollama OpenAI-compatible endpoint and add the model tags you have pulled. Because the models run locally, there is no per-token cost and no upstream budget to cap. The tradeoff is capability: local models are generally weaker at long agentic tool loops than hosted frontier models, so mixed setups are common. Use CCR's routing rules to send heavy reasoning to a hosted provider and cheap or private work to Ollama. ### Claude Code Router with Kimi Kimi K3 is a common CCR target because its 1M-token context suits repository-scale work. Add `kimi-k3` as a model ID on an OpenAI-compatible provider profile. See [Kimi K3 API pricing and setup](/blog/kimi-k3-api-pricing-setup) for current rates before pointing an agent loop at it. ### Claude Code Router in Docker The project publishes container images so the gateway can run as a service rather than a desktop app. The important detail is network exposure: CCR is a local control plane holding upstream provider credentials, so bind it to localhost or a private network. Do not publish the gateway port to a public interface. Check the repository release notes for the current image name and tag, which change more often than the configuration model. ### Claude Code Router with VS Code CCR intercepts at the API boundary, not the editor, so a VS Code Claude Code session follows the same route as the terminal one as long as the extension inherits the environment CCR sets. If the extension still reaches Anthropic directly, the usual cause is that it was launched from a shell without the router's environment. Restart the editor from a shell where the CCR profile is active, then confirm with the log check below. ### When you do not need CCR at all If you use one upstream and no conditional routing, CCR is a moving part with no payoff. A direct Anthropic-compatible gateway gives you the same model access with nothing extra to run locally — that route is covered above. Choose CCR when you genuinely want local routing policy across several providers. ## Common Claude Code Router problems ### ccr is not found Confirm Node.js 22 or newer, run `npm prefix -g`, and make sure npm's global binary directory is on `PATH`. ### The UI opens but model calls fail Add a provider and model, create a CCR client key, and confirm the gateway is running under **Server**. Run `ccr serve` in the foreground when you need startup logs. ### Old settings keep returning Run `ccr stop` before changing listener options. Do not expect edits to a legacy `config.json` to update the live SQLite configuration. ### RouterPlex rejects the model Check the provider's base URL, the exact model ID, and which credential is being used. CCR client keys and RouterPlex upstream keys serve different boundaries. ### The local gateway is exposed remotely Keep CCR on `127.0.0.1` unless remote access is intentional. A remote deployment needs a fixed strong management token, TLS, firewall or private-network controls, and protected storage because CCR holds upstream credentials. ## Cost controls for coding agents - Give every coding tool or repository its own RouterPlex key. - Set a hard upstream budget before enabling retries or fallbacks. - Start with one model and one profile. - Review CCR's estimate against the upstream billed amount. - Rotate any key that appears in shell history, logs, screenshots, or a committed file. [Start with a $5 RouterPlex balance](/sign-up), cap the dedicated key, and verify one small CCR-routed request before trusting an autonomous coding session. ### Frequently asked questions **What is Claude Code Router?** Claude Code Router, or CCR, is a local control plane that connects Claude Code and other coding agents to multiple model providers. The current release uses a desktop or browser management UI, a local gateway, provider profiles, routing rules, and SQLite-backed configuration. **How do I install Claude Code Router?** For the npm CLI, install Node.js 22 or newer, run npm install -g @musistudio/claude-code-router, then run ccr ui. Desktop installers are available from the project's GitHub Releases page. **Does current Claude Code Router use config.json?** No. Current CCR stores live configuration in config.sqlite and treats a legacy config.json only as a one-time migration source. Configure providers and routing through the desktop or browser UI. **Can Claude Code use a custom API base URL without CCR?** Yes. Set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN when the upstream gateway supports the Anthropic Messages API. RouterPlex supports that direct route for its chat models. **Which budget should I use for Claude Code?** Start with a dedicated key capped at the amount you are willing to spend during the test, such as $5 or $10. Increase it only after reviewing real usage. **Can Claude Code Router use Ollama?** Yes. Add a provider profile using the OpenAI-compatible protocol and the local Ollama base URL http://localhost:11434/v1, then add the model tags you have pulled. Local models cost nothing per token, but are generally weaker at long agentic tool loops than hosted frontier models. **Does Claude Code Router work with the VS Code extension?** Yes. CCR intercepts at the API boundary rather than the editor, so a VS Code session follows the same route as the terminal as long as the extension inherits the router's environment. If it still calls Anthropic directly, relaunch the editor from a shell where the CCR profile is active. **Can I run Claude Code Router in Docker?** Yes. The project publishes container images so the gateway can run as a service. Bind it to localhost or a private network, because the router holds upstream provider credentials and should never be exposed on a public interface. ## OpenRouter Alternatives (2026): 8 Options Compared Source: https://routerplex.com/blog/openrouter-alternatives — published 2026-07-19, updated 2026-07-24. An OpenRouter alternative can solve one of three different problems: buy access to many models through one account, put a gateway in front of provider keys you already own, or self-host the routing layer. Those products look similar from the application because they expose an OpenAI-compatible API, but the billing and operational responsibility are different. This guide compares eight practical options for 2026. It does not pretend one gateway is best for everyone. The useful question is which responsibility boundary fits your workload. > Disclosure: RouterPlex publishes this comparison and is one of the products covered. We identify where RouterPlex fits, where OpenRouter remains stronger, and use the same decision criteria for every option. > Pricing and product capabilities change. OpenRouter's purchase fee was checked against its [published FAQ](https://openrouter.ai/docs/faq#pricing-and-fees) on July 19, 2026. Verify each vendor's current documentation before moving production traffic. ## The short answer RouterPlex is the closest OpenRouter alternative when you want hosted access to mainstream models through one prepaid account without a credit-purchase fee. LiteLLM is the strongest fit when you want to self-host and bring provider keys. Portkey and Helicone make more sense when policy or observability matters more than bundled model access. Cloudflare and Vercel are natural choices when the surrounding application already runs in their ecosystems. That answer changes if catalog breadth is non-negotiable. OpenRouter carries far more niche and community models than RouterPlex, and keeping OpenRouter can be the correct decision for those workloads. ## How these alternatives were evaluated Each option is compared on the boundary that creates real switching work: whether model access is included, who operates the gateway, provider and model coverage, pricing outside the token rate, spend controls, observability, and how much application code must change. Product claims link to vendor documentation where practical, and the recommendations name both the best fit and the main tradeoff. ## OpenRouter alternatives at a glance | Alternative | Best fit | What changes from OpenRouter | | --- | --- | --- | | RouterPlex | Developers wanting hosted access and one prepaid balance | Smaller curated catalog, no top-up fee, hard per-key budgets | | LiteLLM | Teams wanting full proxy control | You operate the gateway and usually keep separate provider accounts | | Portkey | Teams combining gateway policy and observability | Bring provider relationships into a broader control plane | | Helicone | Observability-first AI applications | Put monitoring, caching, and gateway controls around model calls | | Cloudflare AI Gateway | Workloads already using Cloudflare | Add edge controls while retaining provider-specific setup | | Vercel AI Gateway | Next.js and AI SDK applications | Use one gateway endpoint within the Vercel developer workflow | | Requesty | Teams wanting another managed routing service | Compare its routing, provider, and billing terms with your workload | | Direct provider APIs | Applications committed to one or two vendors | Remove the gateway layer but manage separate keys, bills, and SDK details | ## 1. RouterPlex: prepaid multi-model access without a top-up fee RouterPlex is the closest alternative when you want the same basic buying experience: one account, one API key, and model access included. You do not bring separate OpenAI, Anthropic, Google, DeepSeek, or Moonshot accounts. The commercial difference is at funding time. RouterPlex adds $100 to the balance when you pay $100. It does not add a card or crypto purchase fee, and supported models are billed at their published vendor list prices. Every API key can also carry a hard lifetime budget, while the account balance is prepaid and stops at zero. The honest limitation is catalog breadth. RouterPlex focuses on 38 mainstream frontier and value models across 14 providers. OpenRouter carries hundreds of models and more provider-routing options. If a project depends on niche community models, OpenRouter may remain the better fit. Best for: indie developers, small teams, coding-agent users, and agencies that value simple billing and spend containment more than the largest possible catalog. See the exact [RouterPlex vs OpenRouter comparison](/vs/openrouter), including fee math and migration details. ## 2. LiteLLM: self-hosted control [LiteLLM](https://docs.litellm.ai/) is an open-source proxy and SDK. It is a strong OpenRouter alternative when the goal is protocol compatibility and routing control rather than bundled model access. Self-hosting moves responsibility back to your team. You manage provider accounts and credentials, deploy the proxy, secure its administrative surface, operate its database, plan upgrades, and reconcile provider spend. In exchange, you control the network boundary, routing logic, logs, and provider contracts. Best for: platform teams that already have vendor agreements, infrastructure ownership, and a real reason to customize the gateway. Read the deeper [hosted gateway vs self-hosted LiteLLM comparison](/blog/managed-litellm-alternatives). ## 3. Portkey: gateway policy plus observability [Portkey](https://portkey.ai/docs/product/ai-gateway) combines an AI gateway with controls for routing, reliability, governance, and observability. It is more relevant when a team wants to standardize how many internal applications reach models than when a solo developer simply wants to buy tokens through one wallet. Evaluate it around policy: fallbacks, retries, access controls, logs, data handling, and how it connects to provider accounts. Those capabilities can be worth more than a small funding fee for an organization with production governance requirements. Best for: teams treating the model gateway as shared infrastructure. ## 4. Helicone: observability-first gatewaying [Helicone](https://docs.helicone.ai/gateway/overview) is a natural option when request visibility is the first problem. Its gateway and observability tooling focus on tracing model usage, latency, cost, caching, and application behavior. This is a different purchase from prepaid model aggregation. Decide whether you primarily need one bill for model access or better control and analysis around provider calls. Some teams need both, but they should be evaluated separately. Best for: AI products that already have provider access and need production telemetry. ## 5. Cloudflare AI Gateway: edge controls for Cloudflare workloads [Cloudflare AI Gateway](https://developers.cloudflare.com/ai-gateway/) fits teams already building on Workers or using Cloudflare for application traffic. It can centralize analytics and gateway behavior close to the edge. The main tradeoff is ecosystem fit. It is compelling when Cloudflare already owns the surrounding request path. It is less obviously the simplest answer for a small standalone script whose only requirement is one prepaid key for several commercial models. Best for: Cloudflare-native applications and teams that want gateway controls beside their edge stack. ## 6. Vercel AI Gateway: a natural fit for AI SDK applications [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) is designed to give applications a unified endpoint across model providers, with especially natural integration into Vercel's AI SDK and deployment platform. Compare current billing, provider coverage, fallbacks, logging, and portability. The strongest reason to choose it is usually developer-workflow fit, not merely that it speaks an OpenAI-compatible protocol. Best for: Next.js applications and teams already standardized on Vercel's AI tooling. ## 7. Requesty: another managed routing layer [Requesty](https://docs.requesty.ai/) offers managed model routing and related gateway features. It belongs on the shortlist when you want a hosted service but RouterPlex's curated catalog or OpenRouter's fee structure does not fit. Test the exact models you use. A long provider list matters less than whether the gateway supports your required model, tool-calling behavior, context limits, data policy, and payment method. Best for: teams comparing managed gateways on routing behavior and provider coverage. ## 8. Direct provider APIs: fewer layers, more accounts The simplest architectural alternative is to use OpenAI, Anthropic, Google, or another model provider directly. Direct access removes an intermediary and can make provider-specific features available sooner. The cost is operational fragmentation. Each provider has its own account, key, billing threshold, rate limits, SDK details, and usage dashboard. Direct APIs work well when one vendor handles nearly all traffic. They become less attractive when an application changes models frequently or needs one spend view across providers. Best for: workloads committed to one or two providers and teams willing to maintain provider-specific integrations. ## How to choose an OpenRouter alternative Use these questions before comparing feature grids: 1. Do you need model access included, or will you bring provider keys? 2. Do you want to operate the proxy yourself? 3. Which exact models and API features are non-negotiable? 4. Can each application key have a hard server-side budget? 5. What happens when prepaid credit reaches zero? 6. Are prompts and responses stored, and can storage be disabled? 7. What purchase, subscription, or platform fees apply before token usage? 8. Can you leave by changing a base URL and key, or does the SDK create lock-in? The first two questions usually eliminate half the list. A self-hosted BYOK gateway and a hosted prepaid model marketplace are not interchangeable, even when both accept the same curl request. ## A low-risk migration test Do not move production traffic first. Create a separate key with a small hard budget, then replay representative requests against the final two candidates. Check plain chat, streaming, tool calls, structured output, error handling, context limits, and the final billed amount. Confirm that model IDs and provider-specific parameters behave as expected. Keep the old route available until logs and costs match your assumptions. If you want hosted access to mainstream models without a purchase fee, [start a $5 RouterPlex test](/sign-up). The API is OpenAI-compatible, so the first comparison can be as small as changing the base URL, key, and model ID. ### Frequently asked questions **What is the best OpenRouter alternative?** The best choice depends on the job. RouterPlex fits developers who want hosted multi-model access with one prepaid balance and no top-up fee. LiteLLM fits teams that want to self-host and keep their own provider accounts. Portkey, Helicone, Cloudflare AI Gateway, Vercel AI Gateway, and Requesty emphasize different combinations of routing, observability, control, and managed access. **Is there a free OpenRouter alternative?** Open-source gateways such as LiteLLM can be self-hosted without paying a gateway subscription, but model providers still charge for tokens and you still operate the infrastructure. A free proxy is not the same as free model usage. **Does RouterPlex charge an OpenRouter-style credit fee?** No. RouterPlex adds the full payment amount to the prepaid balance and bills supported models at their published vendor list prices. OpenRouter's published fee was 5.5% for card purchases, with a $0.80 minimum, and 5% for crypto when checked July 19, 2026. **How hard is it to switch from OpenRouter?** For an OpenAI-compatible application, switching usually means changing the base URL, API key, and model ID. Test tool calling, structured output, streaming, and provider-specific parameters before moving production traffic. ## Claude Code Pricing: Pro, Max, and API Costs Source: https://routerplex.com/blog/claude-code-pricing — published 2026-07-19, updated 2026-07-19. Claude Code pricing has two billing routes. You can use Claude Code through a paid Claude subscription, or fund it with pay-as-you-go API usage. As of July 19, 2026, Claude Pro costs $20 per month, while Claude Max costs $100 or $200 per month. API usage has no fixed monthly price: input, output, and prompt-cache tokens are billed at the selected model's rate. > Sources: [Claude plans and pricing](https://claude.com/pricing), [Anthropic's plan chooser](https://support.claude.com/en/articles/11049762-choose-a-claude-plan), and [Claude Code cost documentation](https://code.claude.com/docs/en/costs), checked July 19, 2026. Prices and limits can change. ## Claude Code pricing at a glance | Billing route | Published price | Claude Code access | Best fit | | --- | ---: | --- | --- | | Claude Pro monthly | $20/month | Included | Regular individual use | | Claude Pro annual | $200/year, about $17/month | Included | Regular use with annual commitment | | Claude Max 5x | $100/month | Included | Heavy daily sessions | | Claude Max 20x | $200/month | Included | Very heavy individual use | | Team or Enterprise | Current per-seat or contract price | Included | Shared administration and organization controls | | Anthropic API | Per token | API-funded login | Variable or metered workloads | | Compatible API gateway | Per token, plus any gateway fees | Custom gateway route | Multi-model access and separate spend controls | Claude Code is included in every paid Claude plan. The important detail is that terminal usage does not have a separate pool: Claude Code, Claude web, desktop, and mobile activity share the same plan limits. ## Claude Pro: $20 monthly or $200 annually Claude Pro is the lowest-cost paid route into Claude Code. The monthly plan is $20. The annual plan is $200 paid up front, which Anthropic presents as roughly $17 per month. Pro is the sensible starting point when you want Claude Code and also use Claude's chat applications. It is not an unlimited terminal plan. Anthropic describes plan limits as rolling usage windows, with weekly limits layered on paid plans. The number of prompts you receive varies with conversation length, model choice, files, tools, and your usage across other Claude surfaces. Choose Pro when: - You code with Claude regularly but not continuously all day. - You also value Claude on the web or desktop. - A predictable $20 bill matters more than per-request accounting. - Waiting for a reset after an occasional limit is acceptable. ## Claude Max: $100 or $200 monthly Claude Max has two individual tiers. The $100 option provides 5x the usage of Pro per five-hour session. The $200 option provides 20x the usage of Pro per five-hour session. Both include the rest of the Pro feature set and higher output limits. Max is designed for people who work with Claude throughout the day. It is still governed by usage limits rather than a fixed token allowance. Paying $200 does not create an unlimited API account. Choose Max when: - Claude Code is part of several hours of daily development. - Pro limits interrupt paid work often enough to cost more than the upgrade. - You want subscription predictability instead of tracking every token. - You use Claude's other applications enough to value the shared plan. The honest test is operational: record how often Pro blocks a productive session and how long you wait. Upgrade when the lost work is consistently worth more than the price difference. ## Pay-as-you-go Claude Code API pricing API-funded Claude Code has no $20, $100, or $200 subscription tier. The cost is calculated from the model's token rates: ```text request cost = input tokens / 1,000,000 × input rate + output tokens / 1,000,000 × output rate + cache writes and reads at their published rates ``` Anthropic's Claude Code cost documentation says API usage averages about $13 per developer per active day and $150–$250 per developer per month, with 90% of users staying below $30 per active day. Those figures are planning baselines, not a promise. Repository size, model choice, agent loops, and tool output can move the real number sharply. API billing is attractive when use is intermittent. A developer who runs two bounded sessions a week may spend less than a monthly plan. An autonomous agent working across several repositories can spend far more. ## What happens when a subscription limit is reached Anthropic says paid users can wait for the usage window to reset, upgrade, or enable usage credits to continue at standard API rates. This makes the subscription behave like a base allowance with optional metered overflow. Before enabling overflow billing: 1. Set a monthly spending cap. 2. Check which model Claude Code selects by default. 3. Clear or compact long sessions when the old context is no longer useful. 4. Separate personal experiments from organization-funded work. 5. Review usage after the first full week, not after the first cheap prompt. ## Subscription vs API: which is cheaper? There is no honest universal break-even calculation because Anthropic does not sell Pro or Max as fixed token bundles. Limits depend on workload behavior, and the subscription pool is shared with other Claude products. Use this decision rule: | Work pattern | Better starting route | | --- | --- | | Daily interactive coding plus Claude chat | Pro | | Pro interrupts work repeatedly | Max 5x | | Claude Code is open most of the workday | Max 20x or measured API pilot | | A few bounded sessions each month | API billing | | Automated jobs with explicit budgets | API billing | | Need Claude, GPT, Gemini, and DeepSeek through one balance | Multi-model gateway | Run both billing routes for one representative week if the difference matters. Record productive sessions completed, blocks, API cost, and time spent managing limits. ## Using Claude Code with a compatible API gateway Claude Code accepts a custom Anthropic-compatible base URL. A gateway can be useful when you want pay-as-you-go access, a separate hard budget for the coding key, or the ability to select non-Anthropic models without maintaining several provider accounts. RouterPlex supports the Anthropic Messages route and bills from a prepaid balance. Each API key can carry a hard lifetime budget, so a coding session can be limited to $5, $10, or another explicit amount at the server. That route is not automatically cheaper than Claude Pro. It is more measurable and more flexible. You pay for the actual model usage, and you can move between Claude, GPT, Gemini, DeepSeek, Kimi, and other supported models through the same balance. Read the current [Claude Code Router and custom gateway setup](/blog/claude-code-router-setup), or [install Claude Code first](/blog/install-claude-code). ## A practical first-month choice Start with Pro if you are an individual who wants Claude Code every week and prefers a fixed bill. Start with a small API budget if usage is occasional, automated, or needs strict cost attribution. Move to Max only after Pro limits repeatedly interrupt work. If multi-model access is the requirement, [create a RouterPlex account](/sign-up), add the minimum $5 balance, and give the Claude Code key a hard cap before the first repository session. ### Frequently asked questions **How much does Claude Code cost?** Claude Code is included with paid Claude plans. Claude Pro is $20 per month or $200 billed annually. Claude Max is $100 per month for 5x Pro usage or $200 per month for 20x Pro usage. API-funded Claude Code is billed per token instead of by subscription. **Is Claude Code included with Claude Pro?** Yes. Anthropic says Claude Code is included in all paid Claude plans. Terminal usage and Claude web, desktop, and mobile usage draw from the same plan limits. **What happens when Claude Code reaches a plan limit?** You can wait for the rolling usage window to reset, move to a higher plan, or enable paid usage credits where available. Additional usage credits are charged at standard API rates. **Is Claude Code cheaper with a subscription or API billing?** A subscription is easier to budget for steady daily use, while API billing can be cheaper for irregular or tightly capped workloads. There is no universal break-even point because subscription limits depend on model choice, conversation length, and other Claude usage. ## Install Claude Code on macOS, Windows, and Linux Source: https://routerplex.com/blog/install-claude-code — published 2026-07-19, updated 2026-07-19. Install Claude Code with Anthropic's native installer unless you have a specific reason to use npm. The native build works on macOS, Linux, Windows, and WSL, updates itself, and does not require Node.js. After installation, run `claude --version` and `claude doctor` before opening a real repository. > Source: [Anthropic's official Claude Code setup guide](https://code.claude.com/docs/en/setup), checked July 19, 2026. Installer commands can change; verify the official page before using them in managed deployment scripts. ## System requirements Anthropic currently lists these minimums: - macOS 13 or newer. - Windows 10 version 1809 or newer, or Windows Server 2019 or newer. - Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+. - 4 GB or more RAM. - An x64 or ARM64 processor. - Internet access to authenticate and call the model service. Claude Code also expects Git for normal repository workflows. Ripgrep is usually bundled. ## Install Claude Code on macOS, Linux, or WSL Use the recommended native installer: ```bash curl -fsSL https://claude.ai/install.sh | bash ``` Open a new terminal and verify the binary: ```bash claude --version claude doctor ``` The same command works inside WSL. Run it in the Linux shell, not Windows PowerShell, when you want Claude Code to operate on files inside the WSL filesystem. ### Install with Homebrew Anthropic also publishes a Homebrew cask: ```bash brew install --cask claude-code ``` Homebrew installations do not use Claude Code's built-in auto-updater. Upgrade through Homebrew: ```bash brew upgrade --cask claude-code ``` ## Install Claude Code on Windows ### PowerShell native installer Open PowerShell and run: ```powershell irm https://claude.ai/install.ps1 | iex ``` Close and reopen PowerShell, then verify: ```powershell claude --version claude doctor ``` ### Windows Command Prompt Anthropic publishes a CMD installer for environments that do not use PowerShell: ```bat curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd ``` ### Install with WinGet The package-manager route is: ```powershell winget install Anthropic.ClaudeCode ``` Like Homebrew, WinGet manages upgrades for its own installation. ## Install Claude Code with npm The npm package is still supported, but Anthropic recommends the native installer for most users. npm requires Node.js 18 or newer. ```bash npm install -g @anthropic-ai/claude-code@latest ``` Do not run a global npm install with `sudo`. Fix the npm prefix and permissions instead. Mixing a native installation and npm installation can also leave two different `claude` binaries on `PATH`. ## Authenticate the first session Move into a test directory and start Claude Code: ```bash mkdir claude-code-test cd claude-code-test claude ``` The first run opens the login flow. Sign in with a paid Claude plan or use an Anthropic Console/API billing route. Claude Code is included with paid Claude plans; API-funded sessions are billed per token. Run `/status` after login to confirm the active account and model before granting repository access. For current plan prices, read [Claude Code pricing: Pro, Max, and API costs](/blog/claude-code-pricing). ## Fix zsh: command not found: claude The exact query `zsh: command not found: claude` receives roughly 1,600 monthly US searches in OpenSEO data, and it usually means the installation directory is missing from `PATH` or the shell has not reloaded. Start with: ```bash which claude echo $PATH exec $SHELL -l claude --version ``` If you used npm, inspect the global prefix: ```bash npm prefix -g npm bin -g ``` Add that binary directory to your shell configuration, then open a new terminal. If both native and npm copies exist, remove the older installation so `which claude` resolves to one expected binary. ## Verify Claude Code safely Do not begin with a production repository. Use an empty directory and ask a read-only question. Confirm: 1. `claude --version` returns a version. 2. `claude doctor` reports a healthy installation. 3. `/status` shows the expected account and model. 4. A small prompt succeeds without requesting unnecessary permissions. 5. The selected billing route shows the request in its usage dashboard. ## Use Claude Code with a custom API gateway Installation and model routing are separate. Install the official Claude Code client first. Then set `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` if the gateway supports the Anthropic Messages API. RouterPlex exposes that API shape and lets the same Claude Code client reach supported Claude, GPT, Gemini, DeepSeek, Kimi, and other chat models. Give the coding key a hard server-side budget before the first agent session. Follow the [current Claude Code Router and direct-gateway guide](/blog/claude-code-router-setup) after the base installation works. ## Update or uninstall Claude Code Native installations auto-update by default. Run `claude doctor` when an update appears stuck. Homebrew and WinGet installations should be upgraded through their package manager, and npm installations can be updated with: ```bash npm install -g @anthropic-ai/claude-code@latest ``` Before uninstalling, identify the installation method. Removing the npm package does not remove a native or Homebrew binary, and vice versa. Once the client passes its health check, [start a $5 RouterPlex test](/sign-up) if you want a prepaid custom route with a hard key budget. ### Frequently asked questions **How do I install Claude Code?** Anthropic recommends its native installer. On macOS, Linux, or WSL, run curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell, run irm https://claude.ai/install.ps1 | iex. **Does Claude Code require Node.js?** The recommended native installer does not require Node.js. The npm installation remains available for advanced or legacy setups and requires Node.js 18 or newer. **How do I fix 'command not found: claude'?** Open a new terminal, run which claude or where.exe claude, and verify that the installer's binary directory or npm global bin directory is on PATH. Then run claude doctor. **Can I install Claude Code on Windows without WSL?** Yes. Anthropic publishes a native PowerShell installer and a WinGet package for Windows. WSL is optional. ## Claude Code Alternatives (2026): 8 Coding Agents Compared Source: https://routerplex.com/blog/claude-code-alternatives — published 2026-07-19, updated 2026-07-19. A Claude Code alternative should be compared on four things: where it runs, how much autonomy it has, which models it supports, and how you pay for inference. The closest substitutes are terminal coding agents such as OpenCode, Codex CLI, Gemini CLI, and Aider. IDE-first tools such as Cline, Roo Code, Cursor, and Continue solve a related problem with a different interface. This guide does not call an API gateway a coding agent. RouterPlex can supply models to these tools, but the agent remains responsible for reading files, planning edits, running commands, and asking for approval. > Product behavior was checked against each project's official documentation on July 19, 2026. Open-source status, free quotas, subscription prices, and model support can change. ## Claude Code alternatives at a glance | Tool | Primary interface | Model flexibility | Best fit | | --- | --- | --- | --- | | OpenCode | Terminal and desktop | Broad provider and custom-provider support | Developers wanting an open, provider-flexible agent | | OpenAI Codex CLI | Terminal | OpenAI models and configurable providers | OpenAI-centered coding workflows | | Gemini CLI | Terminal | Gemini-first, extensions and MCP | Google ecosystem and generous developer access | | Aider | Terminal | Many providers through LiteLLM and OpenAI-compatible routes | Explicit Git-aware editing and pair programming | | Cline | VS Code | Native providers and OpenAI-compatible endpoints | Approval-driven agent work inside the editor | | Roo Code | VS Code | Multiple providers and per-mode configuration | Role-based Architect, Code, and Debug workflows | | Cursor | Desktop IDE | Bundled models plus selected custom API keys | Polished editor experience and inline completion | | Continue | VS Code and JetBrains | Configurable models and providers | Teams assembling a modular open-source assistant | ## 1. OpenCode [OpenCode](https://opencode.ai/) is the closest fit for developers who want a terminal-oriented coding agent without centering the workflow on one model vendor. It supports multiple providers, custom provider configuration, project instructions, tools, and interactive sessions. Choose OpenCode when provider choice matters and you are comfortable configuring the model layer. RouterPlex works as a custom OpenAI-compatible provider; the full configuration is in the [OpenCode custom provider guide](/blog/opencode-custom-provider-routerplex). ## 2. OpenAI Codex CLI [Codex CLI](https://developers.openai.com/codex/cli/) is OpenAI's terminal coding agent. It can inspect repositories, edit files, and run commands under configurable approval and sandbox policies. Choose Codex when your organization already uses OpenAI accounts, models, and developer tooling. Its agent behavior and model stack differ from Claude Code, so compare both on the same repository task rather than benchmark headlines. ## 3. Gemini CLI [Gemini CLI](https://github.com/google-gemini/gemini-cli) is Google's open-source terminal agent. It integrates Gemini models, tools, MCP servers, and project context into a command-line workflow. Choose Gemini CLI when Gemini access, Google Cloud integration, or an open-source terminal surface matters. Check the current free and paid quotas before assuming a development workflow will remain free at production volume. ## 4. Aider [Aider](https://aider.chat/) is a mature terminal pair-programming tool with Git-aware edits, repository maps, and broad model support through provider integrations. Aider is less opaque than a fully autonomous agent: you choose the files and model, see diffs, and keep normal Git history. That makes it a strong alternative for developers who want control over each change. RouterPlex can supply an OpenAI-compatible model route. See the [Aider setup guide](/blog/aider-openai-compatible-routerplex). ## 5. Cline [Cline](https://cline.bot/) is an open-source coding agent for VS Code. It proposes file edits and terminal commands inside the editor, with approval controls that make the action boundary visible. Choose Cline when you want agent behavior without leaving VS Code. It accepts OpenAI-compatible endpoints, so one gateway key can expose several model families. See the [Cline OpenAI-compatible setup](/blog/cline-openai-compatible-routerplex). ## 6. Roo Code [Roo Code](https://roocode.com/) is a VS Code agent with configurable modes such as Architect, Code, and Debug. Different modes can use different instructions and models. That separation is useful for spend control. A lower-cost model can handle planning or routine edits while a stronger model reviews a difficult change. Use separate gateway keys or hard budgets if each mode needs independent cost attribution. ## 7. Cursor [Cursor](https://cursor.com/) is an AI-first code editor rather than a terminal agent. Its strengths are editor integration, inline completion, chat, and multi-file changes in a polished desktop workflow. Choose Cursor when the IDE experience matters more than provider freedom. Custom API support and feature availability can vary by model and Cursor plan, so verify that the exact agent feature you need uses the custom key rather than a bundled model route. ## 8. Continue [Continue](https://continue.dev/) provides open-source extensions for VS Code and JetBrains with configurable chat, edit, autocomplete, embeddings, and reranking models. Choose Continue when you want to assemble a team-specific assistant rather than adopt one fixed agent workflow. The extra configuration buys control but creates more components to maintain. ## Free does not mean inference is free Several Claude Code alternatives are open source, but the model still runs somewhere. Your cost can come from: - A direct provider API key. - A hosted gateway balance. - A tool subscription that bundles model access. - Local hardware and electricity. - A provider's limited free quota. Separate the agent license from model inference before comparing prices. A free editor extension calling an expensive model is not a free coding setup. ## Can Claude Code itself use other models? Yes. If you like Claude Code's interface, a compatible gateway can route its Anthropic Messages requests to supported non-Claude models. That may remove the need to switch agents. The direct route is useful when model choice or prepaid billing is the problem. A different agent is useful when approvals, UI, repository behavior, or extensibility is the problem. Read the [current Claude Code Router setup](/blog/claude-code-router-setup) for both the direct gateway and local CCR patterns. ## How to choose Use one representative repository task and score each finalist on: 1. Correctness of the final change. 2. Review time, not just generation time. 3. Number of unnecessary file or command requests. 4. Quality of the diff and commit boundaries. 5. Model and provider flexibility. 6. Actual billed cost. 7. Recovery after a failed command or rejected edit. Do not move every repository at once. Keep the tool that produces the smallest correct, reviewable change under your preferred approval model. If you want one prepaid model balance for Claude Code, OpenCode, Cline, or Aider, [start a $5 RouterPlex test](/sign-up) and give each tool a separate hard-budget key. ### Frequently asked questions **What is the best Claude Code alternative?** OpenCode is a strong terminal-first alternative for broad provider choice. Codex CLI fits OpenAI-centered workflows, Gemini CLI fits Google-centered workflows, and Aider is strong for explicit Git-based editing. The best choice depends on interface, autonomy, model support, and billing. **Is there a free open-source Claude Code alternative?** Yes. OpenCode, Aider, Gemini CLI, Cline, Roo Code, and Continue have open-source components or distributions. Model inference may still cost money unless you use local or provider-funded free models. **Can Claude Code use non-Claude models?** Yes, through a compatible gateway or local router. Claude Code speaks the Anthropic Messages protocol, so the upstream must accept or translate that request shape. **Is RouterPlex a Claude Code alternative?** No. RouterPlex is an API gateway, not a coding agent. It can provide models and billing for Claude Code and several alternatives, including OpenCode, Cline, and Aider. ## Best LLM Gateways for Developers (2026): 9 Compared Source: https://routerplex.com/blog/best-llm-gateways — published 2026-07-19, updated 2026-07-19. The best LLM gateway depends on what you want the gateway to own. RouterPlex, OpenRouter, Requesty, and AgentRouter can bundle access to models behind one account. LiteLLM, Portkey, and Helicone usually sit in front of provider relationships you control. Fireworks AI and Together AI run model inference infrastructure and overlap with gateways without being the same product category. This comparison separates those responsibility boundaries before comparing feature lists. > Product pages and documentation were checked July 19, 2026. RouterPlex publishes this comparison and is one of the products covered. Claims about competitors link to their official sites; verify current pricing, data policies, and service terms before buying. ## LLM gateway comparison | Product | Category | Model access included | Best fit | | --- | --- | --- | --- | | RouterPlex | Hosted multi-provider gateway | Yes | Prepaid access, no top-up fee, hard per-key budgets | | OpenRouter | Hosted model marketplace and router | Yes | Broad catalog and provider routing | | Requesty | Hosted AI gateway and router | Yes and configurable routes | Large catalog and managed routing | | AgentRouter | Community-oriented hosted gateway | Advertised free quota and hosted access | Experiments where free quota outweighs support concerns | | Fireworks AI | Inference platform | Models hosted by Fireworks | Fast open-model inference, deployment, and fine-tuning | | Together AI | AI cloud and inference platform | Models hosted by Together | Open-model inference, dedicated endpoints, and training | | LiteLLM | Open-source proxy and SDK | No, typically BYOK | Self-hosted control and provider abstraction | | Portkey | Managed AI gateway and control plane | Typically BYOK | Governance, routing policy, and organization controls | | Helicone | Observability and gateway platform | Typically provider-backed | Tracing, cost visibility, caching, and application telemetry | ## RouterPlex [RouterPlex](/) is a hosted gateway for developers who want model access included rather than bringing separate vendor accounts. One prepaid balance covers 38 curated models across 14 providers through OpenAI- and Anthropic-compatible endpoints. RouterPlex charges supported models at vendor list price and adds no card or crypto top-up fee. Every key can carry a hard lifetime budget, and the prepaid account balance stops at zero. The limitation is deliberate: the catalog is much smaller than OpenRouter or Requesty. RouterPlex fits mainstream Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, and similar workloads, not every niche community model. Best for: indie developers and small teams that value billing simplicity and spend containment. ## OpenRouter [OpenRouter](https://openrouter.ai/) is the category leader for broad hosted model access. It offers hundreds of models, multiple providers for many models, routing controls, and an active developer ecosystem. OpenRouter says it passes through provider token prices, then charges when credits are purchased. Its published card fee was 5.5% with a $0.80 minimum and its crypto fee was 5% when checked July 19, 2026. Best for: developers who need the broadest catalog or provider-routing depth and accept the funding fee. Read the [OpenRouter alternatives comparison](/blog/openrouter-alternatives) or the detailed [OpenRouter pricing and fee math](/blog/openrouter-top-up-fees). ## Requesty [Requesty](https://www.requesty.ai/) describes itself as an AI gateway and LLM router for more than 600 models. It emphasizes routing, provider access, observability, and enterprise gateway features. OpenSEO shows Requesty earning search traffic from model directories, cheapest-model rankings, and provider pages. That is useful evidence of its product shape: it competes as both a gateway and a model-discovery layer. Best for: teams that want a large managed catalog and routing features. Compare billing, supported endpoints, logging, and data terms for the exact models you use. ## AgentRouter [AgentRouter](https://agentrouter.org/) is a hosted unified API aimed heavily at coding-tool users. Its public messaging emphasizes free quota, Claude Code compatibility, and access to multiple model families. The tradeoff is confidence. Its public search footprint is small, and promotional affiliate content makes strong free-credit claims without the depth of pricing, privacy, support, or sustainability evidence available from larger services. Treat free quota as a test budget, not a production guarantee. Best for: non-sensitive experiments where the current free offer is worth testing. Avoid making it a single point of failure until service terms, data handling, and support meet your requirements. ## Fireworks AI [Fireworks AI](https://fireworks.ai/) is primarily an inference platform for generative and open-weight models. It offers serverless inference, deployments, fine-tuning, and model-serving infrastructure. That is not the same purchase as a neutral wallet spanning every proprietary model vendor. Fireworks competes when you want fast inference for models it hosts, especially open models, and are willing to choose the serving platform as well as the model. OpenSEO shows Fireworks ranking strongly for `open source LLMs`, `inference providers`, and model-specific queries. That matches its infrastructure position. Best for: production open-model inference, deployment control, and performance work. ## Together AI [Together AI](https://www.together.ai/) is an AI cloud for model inference, dedicated endpoints, and training. Like Fireworks, it runs model infrastructure rather than acting only as a billing and routing layer over unrelated vendors. Together earns organic visibility through model pages for DeepSeek, Kimi, Sora, and other hosted models. Choose it when the desired model and deployment mode are available directly on Together. Best for: teams building on open or hosted models that want inference infrastructure and optional dedicated capacity. ## LiteLLM [LiteLLM](https://docs.litellm.ai/) is an open-source SDK and proxy that normalizes many model-provider APIs. In a self-hosted setup, you keep the provider accounts, credentials, infrastructure, database, upgrades, and incident response. LiteLLM removes protocol fragmentation but not vendor-account fragmentation. That is a good trade when your team already has contracts and needs control over the proxy boundary. Best for: platform teams with provider relationships and engineers available to own the gateway. Read the [LiteLLM alternatives and self-hosting guide](/blog/managed-litellm-alternatives). ## Portkey [Portkey](https://portkey.ai/features/ai-gateway) combines an AI gateway with routing, reliability, access controls, observability, and governance features. Portkey is relevant when the gateway is an organization control plane rather than merely a cheaper way to buy tokens. Evaluate it on policy, auditability, data controls, and how it connects to existing provider accounts. Best for: teams standardizing model access across several applications or business units. ## Helicone [Helicone](https://docs.helicone.ai/gateway/overview) leads with LLM observability and adds gateway capabilities such as caching, routing, and request controls. Choose Helicone when the primary pain is understanding production model behavior: cost, latency, errors, prompts, traces, and cache performance. Decide separately whether model access should come through direct provider accounts or another aggregator. Best for: AI applications that already call models and need better telemetry. ## Which LLM gateway should you choose? Use the responsibility boundary first: | Requirement | Start with | | --- | --- | | One prepaid balance, mainstream models, hard budgets | RouterPlex | | Largest hosted model catalog | OpenRouter or Requesty | | Free experimental quota | AgentRouter, after checking current terms | | Open-model inference infrastructure | Fireworks AI or Together AI | | Self-hosted BYOK proxy | LiteLLM | | Organization policy and governance | Portkey | | Observability-first gateway | Helicone | Then test the final two with the same requests. Verify streaming, tool calls, structured output, context limits, error behavior, data retention, and final billed cost. ## Cost questions most comparisons miss Ask each provider: 1. Is there a markup on model tokens? 2. Is there a fee when purchasing credits? 3. Does BYOK usage have a platform fee? 4. Is observability priced separately? 5. Can balances become negative? 6. Can each key enforce a hard server-side budget? 7. Do credits expire or become non-refundable? 8. What happens when billing state is unavailable? The cheapest-looking model rate can still produce a more expensive account if funding fees, minimums, or operational work are excluded. If your shortlist starts with one hosted balance and hard spend limits, [run a $5 RouterPlex test](/sign-up). Use a dedicated key, replay a representative workload, and compare the exact billed amount before moving traffic. ### Frequently asked questions **What is the best LLM gateway for developers?** RouterPlex and OpenRouter fit developers who want model access included. LiteLLM fits teams that want to self-host with their own provider keys. Portkey and Helicone fit governance or observability-heavy teams. Fireworks AI and Together AI are inference platforms rather than neutral gateways across every proprietary provider. **What is the difference between an LLM gateway and an inference provider?** A gateway provides one control point across model providers. An inference provider runs the model infrastructure itself. Fireworks AI and Together AI primarily operate inference platforms; RouterPlex and OpenRouter aggregate access; LiteLLM proxies keys you already own. **Is AgentRouter a RouterPlex competitor?** Yes, for developers seeking one API across models. AgentRouter emphasizes free quota and community access, while RouterPlex emphasizes transparent prepaid billing, hard key budgets, published business terms, and a smaller curated catalog. **Do LLM gateways add fees?** Some do and some do not. Compare token markup, credit-purchase fees, subscriptions, BYOK charges, and optional observability plans separately. A model table alone does not show total cost. ## LiteLLM Alternatives: Managed Gateways vs Self-Hosting Source: https://routerplex.com/blog/managed-litellm-alternatives — published 2026-07-14, updated 2026-07-19. LiteLLM alternatives fall into three groups: self-hosted proxies, managed bring-your-own-key gateways, and prepaid services that include model access. The right choice depends on whether you want infrastructure control or simply want one reliable API endpoint and bill. LiteLLM itself is an open-source proxy and SDK. It is a strong fit when a team already has provider accounts and needs a programmable compatibility layer. A managed gateway is a different purchase: you give up some control to avoid owning the operational surface. OpenSEO keyword data checked July 19, 2026 shows `litellm alternatives` at 320 monthly US searches with keyword difficulty 0. That low score does not make the topic automatic to rank for; the page still needs to answer the architectural choice more clearly than a generic product list. ## The three common architectures | Architecture | You provide vendor keys | You run the proxy | Unified prepaid balance | | --- | --- | --- | --- | | Self-hosted LiteLLM | Yes | Yes | You build it | | Managed BYOK gateway | Usually | No | Usually no | | Prepaid multi-provider gateway | No | No | Yes | The phrase "LiteLLM alternative" can refer to any of these, which is why feature checklists often become confusing. Start with the responsibility boundary. ## What self-hosting actually includes A basic proxy container can be running quickly. Production ownership is broader: - Store and rotate provider credentials. - Run the proxy database and backups. - Configure authentication and tenant isolation. - Patch the proxy and its dependencies. - Protect administrative endpoints and webhooks. - Reconcile provider spend with internal users and keys. - Handle rate limits, retries, fallbacks, and provider outages. - Build or integrate payment, credit, refund, and tax workflows if users pay you. - Monitor logs without accidentally retaining sensitive prompt content. None of these tasks makes self-hosting a bad choice. They are simply part of the cost. A team with platform engineers and negotiated vendor contracts may prefer that control. ## When self-hosted LiteLLM is the right answer Choose self-hosting when several of these are true: - You must keep the proxy inside your network or cloud account. - You already have OpenAI, Anthropic, Google, and other provider contracts. - You need custom routing logic or unsupported providers. - Your security team requires direct control over logs, secrets, and data regions. - You have engineers on call for the gateway. - Your volume is large enough that infrastructure ownership is economical. For an internal platform team, the proxy is a product. Treat it like one: assign an owner, define an upgrade cadence, test provider failures, and document the billing source of truth. ## When a managed gateway is the better trade A hosted gateway is usually better for an indie developer or small team that wants model access rather than proxy ownership. The practical advantages are: - One account instead of separate vendor approvals and billing setups. - One OpenAI-compatible base URL and key format. - A catalog that can be switched with the model string. - A single usage view and balance. - No proxy database, deployment, or upgrade work. - Faster setup for coding tools, evaluations, and small production apps. The costs are reduced control, dependency on the gateway's reliability, and possible platform fees. The exit plan matters. An OpenAI-compatible gateway limits lock-in because moving usually means changing a base URL, key, and model ID rather than rewriting the application. ## BYOK versus prepaid access Managed gateways also differ in who pays the underlying model provider. With bring-your-own-key, you keep vendor accounts and attach their credentials to the gateway. This can preserve enterprise contracts and direct provider billing, but it does not solve account sprawl. With prepaid access, the gateway holds provider relationships and deducts usage from one wallet. This is simpler for small teams, but you should inspect purchase fees, credit expiration, refund terms, and whether the wallet can become negative. RouterPlex uses prepaid access. A top-up starts at $5, has no top-up fee, and model usage is charged at the published vendor list price. Funded PAYG has no RouterPlex RPM/TPM or usage-window cap. Optional plans add bonus credits with account-wide spend windows; they are not required for access. ## Security and budget questions to ask Before choosing a managed LiteLLM alternative, ask for concrete answers: 1. Can each API key have a hard server-side spend cap? 2. What happens when the account balance reaches zero? 3. Are prompt and response bodies stored, and where is that configured? 4. How are webhook signatures verified? 5. Can an old subscription event overwrite the current plan? 6. Are refunds cumulative and idempotent? 7. What happens to API requests when billing or usage data is unavailable? 8. Can all keys be revoked immediately? These are operational questions, not marketing details. A proxy that routes correctly but reconciles money incorrectly is not production-ready. ## RouterPlex as the narrow managed option RouterPlex is designed for developers who want a smaller responsibility surface: - OpenAI- and Anthropic-compatible APIs for 38 models. - One prepaid balance paid by card or crypto. - No token markup and no top-up fee. - Hard budgets on individual keys. - Hosted operation and model-provider integration. - A base-URL-level exit path. It is not the right fit for a company that needs to inject its own provider contracts, write arbitrary routing plugins, or control the proxy deployment. In those cases, self-hosted LiteLLM is likely the more honest answer. For a small team deciding whether to operate a proxy, compare one month of engineering and on-call time with the restrictions and fees of a hosted service. Then run a small paid workload on the final two options. [Start a $5 RouterPlex test](/sign-up), review the [model catalog](/models), or use the [quickstart](https://docs.routerplex.com/quickstart) to send the same request through your existing OpenAI SDK. ### Frequently asked questions **Is a managed LLM gateway the same as hosted LiteLLM?** Not always. Some products host LiteLLM for you, while others provide an OpenAI-compatible gateway with their own control plane and prepaid model access. Compare the operational outcome and billing model, not only the underlying proxy. **When should I self-host LiteLLM?** Self-host when you need full configuration control, already have vendor contracts and keys, can operate the database and proxy securely, and accept ownership of upgrades and incidents. **When is RouterPlex a LiteLLM alternative?** RouterPlex is an alternative when the goal is one hosted OpenAI-compatible endpoint, one prepaid balance, multi-provider model access, and per-key budgets without operating the proxy or separate vendor accounts. ## OpenCode Custom Provider Setup for Claude, GPT, and Gemini Source: https://routerplex.com/blog/opencode-custom-provider-routerplex — published 2026-07-15, updated 2026-07-19. OpenCode supports custom OpenAI-compatible providers through `@ai-sdk/openai-compatible`. Point that provider at RouterPlex and OpenCode can select Claude, GPT, Gemini, Kimi, and other models from one API key and prepaid balance. > The provider structure below follows the [official OpenCode custom-provider documentation](https://opencode.ai/docs/providers/) checked July 15, 2026. ## 1. Decide where the provider belongs Use one of these files: - `~/.config/opencode/opencode.json` for every project. - `opencode.json` in a repository for a project-specific model list. Keep the API key in an environment variable. A repository configuration can safely reference that variable without storing the credential. ## 2. Configure RouterPlex ```json { "$schema": "https://opencode.ai/config.json", "provider": { "routerplex": { "npm": "@ai-sdk/openai-compatible", "name": "RouterPlex", "options": { "baseURL": "https://api.routerplex.com/v1", "apiKey": "{env:ROUTERPLEX_API_KEY}" }, "models": { "claude-opus-4-8": { "name": "Claude Opus 4.8" }, "gpt-5.5": { "name": "GPT-5.5" }, "gemini-3.5-flash": { "name": "Gemini 3.5 Flash" } } } } } ``` Export the key before opening OpenCode: ```bash export ROUTERPLEX_API_KEY="sk-..." opencode ``` Run `/models` and choose one of the models under the RouterPlex provider. ## Why the npm package matters RouterPlex uses `/v1/chat/completions`, so `@ai-sdk/openai-compatible` is the correct adapter. The official OpenCode docs distinguish this from providers that require the OpenAI Responses API. If the provider loads but requests fail, check the adapter before changing model IDs. ## Give OpenCode its own budget Create a key named after the project or tool, such as `opencode-my-app`. Add a hard budget and optionally restrict the key to the model IDs in the configuration file. That creates two useful controls: 1. OpenCode only displays the models registered in its local provider. 2. RouterPlex independently rejects any model or spend that the API key is not allowed to use. The second control still applies if a local configuration file is edited or the agent behaves unexpectedly. ## Troubleshooting ### RouterPlex does not appear in /models Validate the JSON and confirm the provider is under the singular `provider` key. Check that `npm`, `options.baseURL`, and `models` are inside the `routerplex` provider. ### Authentication fails Run `echo $ROUTERPLEX_API_KEY` in the same shell that launches OpenCode. Avoid printing the value in shared logs or screenshots. ### Model not found Use a model ID exactly as it appears in the [RouterPlex catalog](/models). Display names are only labels; the JSON object key is the ID sent to the API. ### Costs are higher than expected Check which model is selected, review tool-call loops, and set a smaller hard budget while testing. Agent tasks often involve several model calls rather than one. See the shorter [OpenCode integration reference](https://docs.routerplex.com/opencode), or [start with $5](/sign-up) and test one repository with a dedicated key. ### Frequently asked questions **Can OpenCode use a custom OpenAI-compatible provider?** Yes. Configure a provider with the @ai-sdk/openai-compatible package, a baseURL, an API key, and the model IDs you want OpenCode to display. **Where does OpenCode store custom providers?** Use ~/.config/opencode/opencode.json for a user-wide provider or opencode.json in a project for project-specific configuration. **Can OpenCode switch between Claude and GPT through one key?** Yes. Register the RouterPlex model IDs under the same custom provider, then use OpenCode's /models command to switch. ## Cline OpenAI-Compatible API Setup with RouterPlex Source: https://routerplex.com/blog/cline-openai-compatible-routerplex — published 2026-07-15, updated 2026-07-19. Cline can connect to RouterPlex through its built-in OpenAI Compatible provider. The setup needs three values: the RouterPlex base URL, a dedicated API key, and an exact model ID. > Cline's required fields were verified against the [official OpenAI Compatible provider guide](https://docs.cline.bot/provider-config/openai-compatible) on July 15, 2026. ## 1. Create a key for Cline Do not reuse the key from a production application. Create a RouterPlex key named `cline` or after the repository, then set a hard budget. Cline can inspect files, call tools, retry, and continue across several steps. A $5 or $10 test budget limits the cost of a mistaken loop while you verify the configuration. ## 2. Open Cline provider settings In Cline, open Settings and enter: | Setting | Value | | --- | --- | | API Provider | OpenAI Compatible | | Base URL | https://api.routerplex.com/v1 | | API Key | Your RouterPlex key | | Model ID | A current RouterPlex model ID | For example, use `claude-sonnet-4-6`, `gpt-5.5`, or another ID from the [model catalog](/models). Do not enter a display label such as "Claude Sonnet." Cline sends the Model ID field directly to the API. ## 3. Configure model capabilities Cline exposes optional model settings such as context window, maximum output, image support, and prices. Match capabilities to the selected model when Cline does not discover them automatically. Incorrect capability settings can cause confusing behavior. For example, enabling image input for a text-only model does not add vision support. Use the RouterPlex catalog and the provider's published model documentation as the source of truth. ## 4. Verify with a small task Use Cline's Verify action, then run a bounded task in a test repository: ```text Read package.json and summarize the available scripts. Do not edit files. ``` Check the RouterPlex usage page and confirm: 1. The request used the dedicated Cline key. 2. The expected model ID appears. 3. Token usage and cost are plausible. 4. The remaining key budget decreased. ## Troubleshooting Cline with RouterPlex ### Invalid API key Create a fresh key if the credential was copied incompletely or exposed. Confirm that Cline is using the RouterPlex key, not a vendor key. ### Model not found Copy the ID directly from the RouterPlex catalog. Model names change over time, and aliases used by another gateway may not exist. ### Connection error The base URL must be `https://api.routerplex.com/v1`. Do not use the dashboard URL and do not append `/chat/completions`. ### Agent spends too quickly Use a less expensive model for routine work, make tasks smaller, reduce parallel activity, and lower the server-side key budget. A local warning is useful, but the RouterPlex budget is the hard stop. ## A practical Cline key policy - One key per repository or client. - A small initial hard budget. - A model allowlist when the repository should use only approved models. - Immediate key rotation if it appears in a committed settings file. - Usage review after long autonomous tasks. [Create a $5 RouterPlex account](/sign-up), then connect Cline with a key that cannot spend beyond the amount you choose. ### Frequently asked questions **Which Cline provider should I select for RouterPlex?** Select OpenAI Compatible, then enter the RouterPlex base URL, API key, and an exact RouterPlex model ID. **What is the RouterPlex base URL for Cline?** Use https://api.routerplex.com/v1. Cline adds the chat-completions path when it sends a request. **How should I control Cline costs?** Create a dedicated key with a hard budget, choose a suitable model, limit output where possible, and review usage after the first task. ## Aider OpenAI-Compatible API Setup with RouterPlex Source: https://routerplex.com/blog/aider-openai-compatible-routerplex — published 2026-07-15, updated 2026-07-19. Aider works with RouterPlex through its OpenAI-compatible API support. Set the API base and key, then use an `openai/`-prefixed RouterPlex model ID when launching Aider. > The adapter pattern follows [Aider's OpenAI-compatible API documentation](https://aider.chat/docs/llms/openai-compat.html), checked July 15, 2026. ## Quick setup Create a dedicated RouterPlex key for Aider and export these variables: ```bash export OPENAI_API_BASE="https://api.routerplex.com/v1" export OPENAI_API_KEY="sk-..." aider --model openai/claude-opus-4-8 ``` The `openai/` prefix tells Aider which API format to use. RouterPlex receives the part after the slash as the model ID. You can switch to another model without changing the endpoint: ```bash aider --model openai/gpt-5.5 aider --model openai/gemini-3.5-flash ``` Use an ID from the current [RouterPlex model catalog](/models). ## Persist the configuration Add the settings to `~/.aider.conf.yml`: ```yaml openai-api-base: https://api.routerplex.com/v1 openai-api-key: sk-... model: openai/claude-opus-4-8 weak-model: openai/claude-haiku-4-5 ``` Prefer an environment variable or local secret mechanism for the key. Do not commit a live credential into a repository. The weak model handles lower-stakes work and can reduce cost, while the primary model remains available for the main coding task. ## Set a server-side budget Aider sessions can become expensive when a large repository is repeatedly mapped or a task needs many edit/test cycles. Create a key named after the repository and cap it at the most you are willing to spend during the session. The budget remains effective even if Aider retries or a local cost estimate is wrong. Optionally allowlist only the primary and weak model. This prevents an accidental configuration change from selecting a more expensive model. ## Verify the route Start Aider in a small repository and ask for a read-only task: ```text /ask Explain the project structure without editing files. ``` Then check the RouterPlex dashboard for the key, model, token count, and cost. ## Common Aider errors ### Unknown model Confirm that the command uses `openai/routerplex-model-id` and that the part after `openai/` exactly matches the RouterPlex catalog. ### Authentication error Make sure `OPENAI_API_KEY` is exported in the shell that launches Aider. A terminal, IDE task, and container can each have different environments. ### Requests go to api.openai.com Check `OPENAI_API_BASE` or `openai-api-base`. It must point to `https://api.routerplex.com/v1`. ### Repository map costs too much Use a lower-cost weak model, narrow the task, and set a smaller RouterPlex key budget while tuning the workflow. See the concise [Aider integration reference](https://docs.routerplex.com/aider), or [start with $5](/sign-up) and run one budget-capped coding session. ### Frequently asked questions **How does Aider use an OpenAI-compatible API?** Set OPENAI_API_BASE and OPENAI_API_KEY, then prefix the selected RouterPlex model ID with openai/ so Aider uses the OpenAI wire format. **Why does the Aider model need an openai/ prefix?** The prefix selects the API adapter. The text after the slash remains the exact model ID RouterPlex receives. **Can Aider use a cheaper model for secondary work?** Yes. Configure a weak-model separately and keep both models within the RouterPlex key's allowlist and budget. ## GPT-5.6 API Pricing: Sol vs Terra vs Luna Source: https://routerplex.com/blog/gpt-5-6-api-pricing-sol-terra-luna — published 2026-07-16, updated 2026-07-16. GPT-5.6 is available in three API models: `gpt-5.6-sol`, `gpt-5.6-terra` and `gpt-5.6-luna`. Sol is the highest-capability and highest-cost option, Terra is the balanced option, and Luna has the lowest price for high-frequency workloads. All three GPT-5.6 models are live on RouterPlex with image input, 128K maximum output and a 258K input limit on the current master route. > Source: [OpenAI API pricing](https://developers.openai.com/api/docs/pricing), checked July 16, 2026. OpenAI's direct model pages document a larger context window than the current RouterPlex upstream route. ## GPT-5.6 API price comparison | Model ID | Input / 1M | Cached input / 1M | Output / 1M | RouterPlex input limit | | --- | ---: | ---: | ---: | ---: | | `gpt-5.6-sol` | $5.00 | $0.50 | $30.00 | 258K | | `gpt-5.6-terra` | $2.50 | $0.25 | $15.00 | 258K | | `gpt-5.6-luna` | $1.00 | $0.10 | $6.00 | 258K | Cached input is one tenth of standard input for these models. Output remains the largest cost category, so concise completion limits and clear stopping conditions matter more than small prompt changes in many workloads. ## GPT-5.6 Sol vs Terra vs Luna ### Choose GPT-5.6 Sol for the hardest work Sol has the highest price and is positioned for complex coding, long-document reasoning, difficult analysis and image understanding. Use it when a better answer is worth more than token savings: architecture reviews, high-risk migrations, hard debugging sessions or multi-stage agents. Live pricing: [GPT-5.6 Sol API](/models/gpt-5-6-sol). ### Choose GPT-5.6 Terra for a balanced default Terra costs half as much as Sol on both standard input and output. That makes it the practical starting point for everyday coding assistance, document work, customer-facing AI features and agents whose tasks are important but not consistently frontier-hard. Live pricing: [GPT-5.6 Terra API](/models/gpt-5-6-terra). ### Choose GPT-5.6 Luna for volume Luna costs one fifth of Sol on input and output. It fits classification, extraction, straightforward Q&A, document triage and high-frequency automation where a lower per-request cost creates more value than maximum capability. Live pricing: [GPT-5.6 Luna API](/models/gpt-5-6-luna). ## Use GPT-5.6 through one OpenAI-compatible endpoint The model string is the only part that changes: ```bash curl https://api.routerplex.com/v1/chat/completions -H "Authorization: Bearer $ROUTERPLEX_API_KEY" -H "Content-Type: application/json" -d '{ "model": "gpt-5.6-terra", "messages": [ {"role": "user", "content": "Find the failure modes in this deployment plan."} ] }' ``` To compare all three, run the same representative prompt set with a separate hard budget for each model. Record output quality, latency, uncached input, cached input and output cost instead of judging from one demo prompt. ## Context and vision behavior OpenAI's direct GPT-5.6 model pages list a 1,050,000-token context window and 128,000 maximum output tokens. RouterPlex currently advertises 258K input because that is the limit supplied by its master route. The smaller published RouterPlex limit is intentional: customers should plan against the route they can actually call, not a larger direct-vendor specification. Sol, Terra and Luna all accept images. That makes the same endpoint useful for screenshots, diagrams, scanned documents and mixed text-image tasks. The output remains text. ## A simple selection rule Start with Terra. Move to Sol only when evaluation shows a meaningful quality improvement on the task that pays for the higher rate. Move to Luna when Terra succeeds reliably and throughput or unit cost matters more. This approach is more reliable than choosing from benchmark headlines. Your prompt structure, tools, repository and error tolerance determine which price-quality point is best. [Start a $5 RouterPlex test](/sign-up), set a hard budget on the key, and compare GPT-5.6 with [Kimi K3](/blog/kimi-k3-api-pricing-setup) and [Claude Fable 5](/blog/claude-fable-5-api-pricing-setup). ### Frequently asked questions **What does the GPT-5.6 API cost?** OpenAI lists GPT-5.6 Sol at $5/$30, Terra at $2.50/$15, and Luna at $1/$6 per 1M input/output tokens. **Which GPT-5.6 model is cheapest?** GPT-5.6 Luna has the lowest standard price at $1 per 1M input tokens and $6 per 1M output tokens. **Do GPT-5.6 Sol, Terra and Luna support vision?** Yes. All three accept image input as well as text. **What context does RouterPlex expose for GPT-5.6?** The current RouterPlex master route exposes 258K input tokens for each GPT-5.6 model. OpenAI's direct API documents a larger context window, so do not assume the limits are identical across providers. ## Claude Fable 5 API: Pricing, Context and Setup Source: https://routerplex.com/blog/claude-fable-5-api-pricing-setup — published 2026-07-16, updated 2026-07-16. Claude Fable 5 is Anthropic's highest-capability generally available model. Its API model ID is `claude-fable-5`, its context window is 1 million tokens, and standard pricing is $10 per 1M input tokens and $50 per 1M output tokens. Claude Fable 5 is live on RouterPlex through an OpenAI-compatible chat-completions endpoint, so the same SDK configuration can call Fable, GPT-5.6, Kimi K3 and other providers. > Sources: [Anthropic Claude pricing](https://platform.claude.com/docs/en/about-claude/pricing) and [Claude model overview](https://platform.claude.com/docs/en/about-claude/models/overview), checked July 16, 2026. ## Claude Fable 5 API pricing | Token category | Price per 1M tokens | | --- | ---: | | Standard input | $10.00 | | 5-minute cache write | $12.50 | | 1-hour cache write | $20.00 | | Cache read | $1.00 | | Output | $50.00 | Fable is expensive relative to general-purpose models. Its economic case depends on the value of the task: a difficult engineering decision, deep research synthesis or long-running agent can justify the rate when a weaker result would cost more in review time or failure risk. See the live [Claude Fable 5 API pricing page](/models/claude-fable-5). ## Claude Fable 5 specifications | Capability | Claude Fable 5 | | --- | --- | | Model ID | `claude-fable-5` | | Context window | 1M tokens | | Maximum synchronous output | 128K tokens | | Vision input | Yes | | Tool use | Yes | | OpenAI-compatible access on RouterPlex | Yes | Anthropic says Fable uses the newer tokenizer introduced with later Claude models. Token counts may differ from older Claude versions for the same text, so estimate costs from actual API usage rather than assuming an old prompt has the same token count. ## Call Claude Fable 5 with RouterPlex Use the regular chat-completions shape: ```bash curl https://api.routerplex.com/v1/chat/completions -H "Authorization: Bearer $ROUTERPLEX_API_KEY" -H "Content-Type: application/json" -d '{ "model": "claude-fable-5", "messages": [ {"role": "user", "content": "Review this architecture and identify the most expensive wrong assumption."} ] }' ``` Python uses the same RouterPlex base URL as every other chat model: ```python import os from openai import OpenAI client = OpenAI( api_key=os.environ["ROUTERPLEX_API_KEY"], base_url="https://api.routerplex.com/v1", ) response = client.chat.completions.create( model="claude-fable-5", messages=[{"role": "user", "content": "Audit this rollout plan for irreversible steps."}], ) print(response.choices[0].message.content) ``` ## Claude Fable 5 vs Claude Sonnet 5 | Model | Input / 1M | Output / 1M | Context | Best fit | | --- | ---: | ---: | ---: | --- | | Claude Fable 5 | $10 | $50 | 1M | Highest-value complex reasoning and agents | | Claude Sonnet 5 introductory rate | $2 | $10 | 1M | Strong default for coding and general agent work | | Claude Sonnet 5 rate from September 1, 2026 | $3 | $15 | 1M | Balanced capability and cost | Sonnet 5's introductory pricing is scheduled through August 31, 2026. If Fable does not produce a measurable improvement on your workload, Sonnet is the more economical default. Use Fable selectively: escalation after another model fails, final review of high-risk output, difficult repository-wide reasoning, or the small number of requests whose quality has outsized value. ## Control Fable spend before the first request At $50 per 1M output tokens, an unconstrained agent can consume a balance quickly. Give the Fable key its own hard budget and use explicit completion limits where the client supports them. Separate keys also make it easy to compare Fable revenue or task value against its cost. Prompt caching matters for repeated long prefixes. A cache read costs one tenth of normal input, while cache writes cost more than normal input. Reuse stable system instructions and tool definitions when the workflow naturally supports it; do not add complexity only to chase a cache hit. ## Test Fable against a real task Choose a task where a better result has clear value. Run the same input through Fable, Sonnet 5 and one non-Claude model, then compare correctness, review time, latency and final billed cost. [Create a RouterPlex key with a $5 hard budget](/sign-up), or compare Fable with [GPT-5.6](/blog/gpt-5-6-api-pricing-sol-terra-luna) and [Kimi K3](/blog/kimi-k3-api-pricing-setup). ### Frequently asked questions **How much does Claude Fable 5 cost?** Anthropic lists Claude Fable 5 at $10 per 1M input tokens, $1 per 1M cache-read tokens, and $50 per 1M output tokens. **What is the Claude Fable 5 context window?** Claude Fable 5 supports a 1M-token context window and up to 128K output tokens in the synchronous Messages API. **Does Claude Fable 5 support vision?** Yes. Claude Fable 5 accepts image input alongside text. **Claude Fable 5 or Claude Sonnet 5?** Use Fable for the highest-value complex work where capability matters most. Sonnet 5 is substantially cheaper and is the better default when cost and throughput matter. ## OpenClaw Custom Provider Setup with RouterPlex Source: https://routerplex.com/blog/openclaw-custom-provider-routerplex — published 2026-07-15, updated 2026-07-15. OpenClaw can use RouterPlex as a custom OpenAI-compatible model provider. Add a provider under `models.providers`, list the models OpenClaw may use, and select them with the `routerplex/model-id` format. The result is one OpenClaw installation that can switch between Claude, GPT, Gemini, DeepSeek, and other RouterPlex models without maintaining a separate billing account for every provider. > Configuration fields were checked against the [OpenClaw model-provider documentation](https://docs.openclaw.ai/concepts/model-providers) on July 15, 2026. ## 1. Create a dedicated OpenClaw key Create a RouterPlex API key named `openclaw`. Give it a hard budget before connecting the agent. Autonomous agents can make several model calls for one user request. A dedicated key gives the workload its own cost ceiling and makes every call attributable in the usage logs. For an initial test, a $5 or $10 key budget is enough. Increase it after you have inspected a real task. ## 2. Add RouterPlex to OpenClaw Open or create `~/.openclaw/openclaw.json`: ```json { "models": { "providers": { "routerplex": { "baseUrl": "https://api.routerplex.com/v1", "apiKey": "sk-...", "api": "openai-completions", "models": [ { "id": "claude-opus-4-8", "name": "Claude Opus 4.8", "reasoning": true, "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 32000 }, { "id": "gemini-3.5-flash", "name": "Gemini 3.5 Flash", "input": ["text", "image"], "contextWindow": 1000000, "maxTokens": 16000 } ] } } }, "agents": { "defaults": { "model": { "primary": "routerplex/claude-opus-4-8" }, "models": { "routerplex/claude-opus-4-8": { "alias": "Opus" }, "routerplex/gemini-3.5-flash": { "alias": "Flash" } } } } } ``` Use an environment-managed secret in production rather than committing the key. The example shows the field location only. The `models.providers.routerplex.models` array registers the runtime models. The separate `agents.defaults.models` object controls which provider/model references are visible to the agent. ## 3. Verify the provider Run OpenClaw's provider probe: ```bash openclaw models status --probe ``` Confirm that the RouterPlex base URL appears and both configured models pass the probe. Then start with a short task and check the RouterPlex usage page for the dedicated key. ## Common OpenClaw configuration errors ### Model is not allowed Add the full `routerplex/model-id` reference to `agents.defaults.models`. Registering a provider model does not automatically add it to an active allowlist. ### Provider returns a 404 Use `https://api.routerplex.com/v1` as the base URL and `openai-completions` as the API mode. Do not append `/chat/completions` to the configured base URL. ### The agent uses an unexpected model Check for a session-level model pin. Run `/model default` inside OpenClaw to return to the configured primary model. ## Recommended model and budget pattern - Use a strong primary model for tool decisions and repository-wide changes. - Use a faster model for low-risk utility work. - Keep fallbacks within the models allowed by the RouterPlex key. - Give each OpenClaw workspace or client its own key when costs need separate attribution. - Raise the key budget gradually instead of exposing the complete account balance. The full configuration is also available in the [OpenClaw RouterPlex documentation](https://docs.routerplex.com/openclaw). [Create a $5 prepaid account](/sign-up) to test the provider with a deliberately small budget. ### Frequently asked questions **Can OpenClaw use an OpenAI-compatible API?** Yes. OpenClaw supports explicit custom providers under models.providers. Set the provider base URL, API key, API mode, and model catalog, then reference models as provider/model-id. **Which API mode should RouterPlex use in OpenClaw?** Use openai-completions. RouterPlex serves the OpenAI-compatible /v1/chat/completions endpoint. **How do I stop OpenClaw from spending the full account balance?** Create a dedicated RouterPlex key for OpenClaw and assign it a hard budget. Also limit the model allowlist and OpenClaw fallback chain. ## OpenRouter Negative Balance and 402 Errors: Causes and Fixes Source: https://routerplex.com/blog/openrouter-negative-balance-402 — published 2026-07-14, updated 2026-07-14. An OpenRouter 402 error means the request cannot proceed because the account does not have sufficient credit. If the dashboard also shows a negative balance, the practical recovery is to stop the workload, inspect recent activity, and add enough credit to bring the balance above zero before retrying. The important engineering question is not only how to clear the error. It is how a prepaid-looking account crossed zero and how to reduce the blast radius next time. > OpenRouter documents its credit system and credit monitoring in the [billing section of its FAQ](https://openrouter.ai/docs/faq#credit-and-billing-systems). Error behavior and provider responses can change, so use the current activity page as the source of truth for your account. ## Why a balance can cross zero LLM billing is finalized after tokens are generated. At request start, a gateway knows the current balance and an estimate of what the request might cost. It does not yet know the final output length. Several normal API behaviors can create a small accounting gap: - **Streaming:** the response starts before the final output-token count is known. - **Concurrency:** multiple requests pass the same pre-request balance check at nearly the same time. - **Retries:** an SDK, proxy, or agent may retry a request without making the retry obvious in the UI. - **Long outputs:** a missing or high `max_tokens` value lets a response cost much more than expected. - **Agent loops:** tools can call the model repeatedly until a task ends, multiplying a small per-call cost. - **Delayed usage posting:** provider usage can arrive after the response completes. Imagine an account with $0.08 left and four concurrent requests. Each request sees a positive balance at the start. If each eventually costs $0.04, the final combined cost is $0.16 and the resulting balance is -$0.08. ## How to recover from a 402 1. Stop the process that is sending requests. Do not let an automatic retry loop keep firing. 2. Open the activity or usage log and filter to the affected API key and time window. 3. Check whether requests were concurrent, retried, or unexpectedly long. 4. Rotate the key if the traffic is not yours. 5. Add enough credit to restore a positive available balance. 6. Send one small request manually before restarting the full workload. For an automated service, treat a 402 as a billing-state error, not a transient network error. Blind exponential retries cannot create credit and may hide the actual failure from an operator. ```python from openai import OpenAI, APIStatusError client = OpenAI( base_url="https://api.example.com/v1", api_key="sk-...", ) try: client.chat.completions.create( model="your-model", messages=[{"role": "user", "content": "Summarize this file"}], max_tokens=500, ) except APIStatusError as error: if error.status_code == 402: # Alert an operator and pause the queue. Do not auto-retry forever. raise RuntimeError("LLM credit exhausted") from error raise ``` ## Four controls that matter more than a low-balance alert An alert is useful, but it fires after spend has already happened. Stronger controls stop or constrain the request path. ### 1. One key per workload Do not share the same key across production, local development, CI, and coding agents. Separate keys make attribution and revocation straightforward. ### 2. A hard key budget A server-side key budget is better than a dashboard target. Set the maximum amount that a key is allowed to consume. If a local experiment should cost at most $10, its credential should not be able to reach the other $490 in the account. ### 3. Output and concurrency limits Set `max_tokens`, bound the number of parallel requests, and cap agent steps. These limits reduce both expected cost and the uncertainty between request start and final accounting. ### 4. Fail closed when balance data is unavailable If your own service cannot retrieve the current gateway balance, do not display a made-up zero or assume the full lifetime top-up remains available. Mark the balance unavailable and pause high-risk jobs until billing state is trustworthy. ## The prepaid design alternative RouterPlex uses a prepaid account balance and lets every API key carry a hard lifetime spend budget. The intended behavior is to stop requests at the available prepaid limit instead of turning a negative amount into debt that must be repaid. The safest setup still uses defense in depth: a $10 key budget, explicit output limits, bounded concurrency, and a low-balance alert. No single billing check can replace application-level controls for an autonomous agent. For the exact setup, read [API keys and budgets](https://docs.routerplex.com/keys-budgets). You can also [create a $5 prepaid account](/sign-up) and test the failure behavior with a deliberately small key budget. ### Frequently asked questions **What does HTTP 402 mean on OpenRouter?** It generally means the account does not have enough available credit for the request. Check the account balance and activity records before retrying. **Why can an LLM API balance go negative?** Streaming requests, concurrent requests, and delayed final usage accounting can allow several requests to pass a balance check before their final token costs are posted. **How do I prevent a coding agent from draining my balance?** Use a dedicated key with a hard server-side budget, keep concurrency bounded, set output-token limits, and alert on spend before the account-wide balance is exhausted. --- # Model pricing (live) Prices in USD per 1M tokens, identical on every tier. | Model ID | Provider | Context | Input / 1M | Output / 1M | | --- | --- | --- | --- | --- | | qwen3.6-plus | Alibaba | 1M | $0.50 | $3.00 | | qwen3.7-max | Alibaba | 1M | $2.50 | $7.50 | | qwen3.7-plus | Alibaba | 1M | $0.32 | $1.28 | | claude-fable-5 | Anthropic | 1M | $10.00 | $50.00 | | claude-haiku-4-5 | Anthropic | 256K | $1.00 | $5.00 | | claude-opus-4-6 | Anthropic | 1M | $5.00 | $25.00 | | claude-opus-4-7 | Anthropic | 1M | $5.00 | $25.00 | | claude-opus-4-8 | Anthropic | 1M | $5.00 | $25.00 | | claude-opus-5 | Anthropic | 1M | $5.00 | $25.00 | | claude-sonnet-4-6 | Anthropic | 1M | $3.00 | $15.00 | | claude-sonnet-5 | Anthropic | 1M | $2.00 | $10.00 | | doubao-seed-2.0-code | ByteDance | 200K | $0.67 | $3.36 | | doubao-seed-2.0-pro | ByteDance | 128K | $0.67 | $3.36 | | deepseek-v4-flash | DeepSeek | 1M | $0.090 | $0.18 | | deepseek-v4-pro | DeepSeek | 1M | $0.43 | $0.87 | | gemini-3.1-pro | Google | 1M | $2.00 | $12.00 | | gemini-3.5-flash | Google | 1M | $1.50 | $9.00 | | LongCat-2.0 | LongCat | 1M | $0.30 | $1.20 | | MiniMax-M2.7 | MiniMax | 196K | $0.30 | $1.20 | | MiniMax-M2.7-highspeed | MiniMax | 196K | $0.60 | $2.40 | | MiniMax-M3 | MiniMax | 1M | $0.30 | $1.20 | | MiniMax-M3-highspeed | MiniMax | 1M | $0.45 | $1.80 | | kimi-k2.6 | Moonshot | 256K | $0.95 | $4.00 | | kimi-k2.7 | Moonshot | 256K | $0.95 | $4.00 | | kimi-k3 | Moonshot | 1M | $3.00 | $15.00 | | gpt-5.4 | OpenAI | 1M | $2.50 | $15.00 | | gpt-5.5 | OpenAI | 256K | $5.00 | $30.00 | | gpt-5.6-luna | OpenAI | 258K | $1.00 | $6.00 | | gpt-5.6-sol | OpenAI | 258K | $5.00 | $30.00 | | gpt-5.6-terra | OpenAI | 258K | $2.50 | $15.00 | | gpt-image-2 | OpenAI | — | $5.00 | $30.00 | | step-3.7-flash | StepFun | 256K | $0.20 | $1.15 | | hy3 | Tencent Hunyuan | 256K | $0.20 | $0.80 | | mimo-v2.5 | Xiaomi | 1M | $0.11 | $0.28 | | mimo-v2.5-pro | Xiaomi | 1M | $0.44 | $0.87 | | glm-5.1 | Zhipu | 256K | $1.40 | $4.40 | | glm-5.2 | Zhipu | 1M | $1.40 | $4.40 | | grok-4.5 | xAI | 500K | $2.00 | $6.00 |