Skip to content
NewTry RouterPlus with free creditsTry playground →

OpenAI-compatible API

Change the base URL and the key. The OpenAI SDK you already use calls 43 models from 16 providers.

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,

Code

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" }]
  }'

Endpoints

EndpointWhat it does
POST /v1/chat/completionsChat Completions for every chat model, streamed or not
POST /v1/responsesResponses API for OpenAI's models; other chat models in preview
GET /v1/modelsThe models your key can call, in OpenAI list shape
POST /v1/images/generationsImages API for image models, base64 output

Authorization: Bearer or x-api-key. Same key on every endpoint.

Parameters

  • model
  • messages
  • stream
  • stream_options
  • temperature
  • top_p
  • max_tokens
  • max_completion_tokens
  • stop
  • tools
  • tool_choice
  • parallel_tool_calls
  • response_format
  • reasoning_effort
  • seed
  • user
  • logprobs
  • top_logprobs
  • frequency_penalty
  • presence_penalty
  • logit_bias
  • metadata
  • store
  • prediction

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

Works with

  • OpenAI Python SDK
  • OpenAI Node SDK
  • Codex
  • Cursor
  • Cline
  • Kilo Code
  • OpenCode

Anything that speaks the OpenAI format. Setup for coding agents

Models

FamilyModelsNewestLowest inputLowest outputProviders
Particle1Particle-1October 27, 2026$0.2125$0.851
Ultramarine1Ultramarine 1 FlashSeptember 29, 2026$0.15$0.501
Kimi6Kimi K3.1 ProOctober 24, 2026$0.39$1.8011
DeepSeek8DeepSeek V4.1 Flash 1017October 17, 2026$0.06$0.1814
GLM6GLM 5.3 FlashAugust 26, 2026$0.05$0.2015
Qwen13Qwen3.8 MaxSeptember 3, 2026$0.039$0.38211
Gemma 43Gemma 4 12BMay 23, 2026$0.12$0.355
Muse Spark1Muse Spark OpenOctober 15, 2026$1.25$4.252
gpt-oss2gpt-oss-120bAugust 5, 2025$0.03$0.142
MiniMax M32MiniMax M3.1 FlashOctober 19, 2026$0.15$0.603

USD per 1M tokens, as of November 5, 2026.

All modelsCompare models

FAQ

What does OpenAI-compatible mean?

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.

Can I use the official OpenAI SDKs?

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.

Which models can I call this way?

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.

What happens to parameters a provider does not take?

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.

Does streaming work?

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.

What is not supported?

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.

Keep your OpenAI code