Switch in two lines
- baseURL: "https://api.openai.com/v1",
- apiKey: process.env.OPENAI_API_KEY,
+ baseURL: "https://api.routerplus.com/v1",
+ apiKey: process.env.ROUTERPLUS_API_KEY,
Change the base URL and the key. The OpenAI SDK you already use calls 43 models from 16 providers.
- baseURL: "https://api.openai.com/v1",
- apiKey: process.env.OPENAI_API_KEY,
+ baseURL: "https://api.routerplus.com/v1",
+ apiKey: process.env.ROUTERPLUS_API_KEY,import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.routerplus.com/v1",
api_key=os.environ["ROUTERPLUS_API_KEY"],
)
reply = client.chat.completions.create(
model="deepseek/deepseek-v4.1-flash",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.routerplus.com/v1",
apiKey: process.env.ROUTERPLUS_API_KEY,
});
const reply = await client.chat.completions.create({
model: "deepseek/deepseek-v4.1-flash",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }],
});
console.log(reply.choices[0].message.content);curl https://api.routerplus.com/v1/chat/completions \
-H "Authorization: Bearer $ROUTERPLUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-v4.1-flash",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "Hello" }]
}'| Endpoint | What it does |
|---|---|
| POST /v1/chat/completions | Chat Completions for every chat model, streamed or not |
| POST /v1/responses | Responses API for OpenAI's models; other chat models in preview |
| GET /v1/models | The models your key can call, in OpenAI list shape |
| POST /v1/images/generations | Images API for image models, base64 output |
Authorization: Bearer or x-api-key. Same key on every endpoint.
Forwarded as sent to OpenAI-format providers. Any other field is dropped and named in x-tm-dropped-params; send "provider": {"require_parameters": true} for a 400 instead. Wire compatibility
Anything that speaks the OpenAI format. Setup for coding agents
| Family | Models | Newest | Lowest input | Lowest output | Providers |
|---|---|---|---|---|---|
| 1 | Particle-1October 27, 2026 | $0.2125 | $0.85 | 1 | |
| 1 | Ultramarine 1 FlashSeptember 29, 2026 | $0.15 | $0.50 | 1 | |
| 6 | Kimi K3.1 ProOctober 24, 2026 | $0.39 | $1.80 | 11 | |
| 8 | DeepSeek V4.1 Flash 1017October 17, 2026 | $0.06 | $0.18 | 14 | |
| 6 | GLM 5.3 FlashAugust 26, 2026 | $0.05 | $0.20 | 15 | |
| 13 | Qwen3.8 MaxSeptember 3, 2026 | $0.039 | $0.382 | 11 | |
| 3 | Gemma 4 12BMay 23, 2026 | $0.12 | $0.35 | 5 | |
| 1 | Muse Spark OpenOctober 15, 2026 | $1.25 | $4.25 | 2 | |
| 2 | gpt-oss-120bAugust 5, 2025 | $0.03 | $0.14 | 2 | |
| 2 | MiniMax M3.1 FlashOctober 19, 2026 | $0.15 | $0.60 | 3 |
USD per 1M tokens, as of November 5, 2026.
The API takes the same requests and returns the same responses as OpenAI's Chat Completions API. Code written for OpenAI works after you change the base URL to https://api.routerplus.com/v1 and the key to a RouterPlus key.
Yes. Set base_url (Python) or baseURL (Node) and your RouterPlus key. Fields the SDK types do not know, like the provider object, go through extra_body in Python, or a request object passed as a variable in TypeScript.
Every chat model in the catalog answers on /v1/chat/completions, including the 43 open models on this page. When a model's provider speaks the Anthropic format, the gateway translates the request, the stream and errors both ways.
A field outside the forwarded set is dropped and named in the x-tm-dropped-params response header, never forwarded silently. Send "provider": {"require_parameters": true} to get a 400 instead of a drop.
Yes. Send stream: true and read server-sent events as you would from OpenAI. The final chunk carries usage with the request's cost in USD.
Embeddings, audio, moderation, files and batches return 404. n above 1 is a 400, so make separate calls for several samples. On the Responses API, store is always false and previous_response_id is a 400.