API reference

Chat completions

The core endpoint — fully OpenAI-compatible.

POST https://api.routerplex.com/v1/chat/completions

Fully OpenAI-compatible, so the official SDKs work as-is.

python
from openai import OpenAI
 
client = OpenAI(
base_url="https://api.routerplex.com/v1",
api_key="sk-...", # your RouterPlex 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_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.