API guide

One OpenAI-compatible API, every ModelRouters model.

Change the base URL, use your ModelRouters key, and select any model id below. The same account can use hosted credits, BYOK connections, browser chat, and optional persistent memory.

Available hosted models

These exact ids work in the model field today. GET /v1/models is the runtime source of truth.

27 live models
ProviderModelAPI model id
DeepSeekDeepSeek V4 Flashdeepseek-v4-flash
DeepSeekDeepSeek V4 Flash — Fastdeepseek-v4-flash-fast
DeepSeekDeepSeek V4 Flash — Reasoningdeepseek-v4-flash-reasoning
DeepSeekDeepSeek V4 Prodeepseek-v4-pro
xAIGrok Build 0.1grok-build-0.1
xAIGrok 4.3grok-4.3
xAIGrok 4.20 Non-Reasoninggrok-4.20-0309-non-reasoning
xAIGrok 4.20 Reasoninggrok-4.20-0309-reasoning
xAIGrok 4.5grok-4.5
xAIGrok 4.6grok-4.6
Z.AIGLM-4.5 Airglm-4.5-air
Z.AIGLM-4.5glm-4.5
Z.AIGLM-4.6glm-4.6
Z.AIGLM-4.7glm-4.7
Z.AIGLM-5glm-5
Z.AIGLM-5 Turboglm-5-turbo
Z.AIGLM-5.1glm-5.1
Z.AIGLM-5.2glm-5.2
AnthropicClaude Haiku 4.5claude-haiku-4.5
AnthropicClaude Sonnet 4.6claude-sonnet-4.6
AnthropicClaude Sonnet 5claude-sonnet-5
AnthropicClaude Opus 4.8claude-opus-4.8
AnthropicClaude Opus 5claude-opus-5
AnthropicClaude Fable 5claude-fable-5
OpenAIGPT-5.6 Lunagpt-5.6-luna
OpenAIGPT-5.6 Terragpt-5.6-terra
OpenAIGPT-5.6 Solgpt-5.6-sol
Base URL
https://api.modelrouters.net/v1
Authentication
Bearer mr_live_...
Primary endpoint
POST /chat/completions

Connect a chat client

Choose Chat Completion and a custom OpenAI-compatible source. Set the Base URL to https://api.modelrouters.net/v1, enter your ModelRouters API key, and use a hosted model id, an original OpenRouter model id, or one of your optional private user/<alias> model ids. When the client appends /chat/completions automatically, do not add that suffix to the Base URL yourself.

Desktop chat client connected to ModelRouters through a custom OpenAI-compatible base URL
Base-URL style — the client appends the Chat Completions path.
Chat client connected to the full ModelRouters chat completions endpoint
Full-endpoint style — paste the complete proxy URL, then replace the shown private alias with a model id from your dashboard.

Connect a provider

Bring-your-own-key routing is free. DeepSeek is the recommended direct BYOK starting point, while other supported providers follow the same setup. Your provider bills model usage directly; ModelRouters keeps the connection credential encrypted at rest.

  1. 1. Add a provider. Choose the provider, paste its API key, and save the connection.
  2. 2. Test the connection. Confirm the credential and upstream endpoint work before routing chat.
  3. 3. Route OpenRouter directly. With an OpenRouter connection, send its original provider/model id unchanged.
  4. 4. Add aliases only if useful. Optional user/<alias> profiles add a friendly name, preset, persona, or roleplay mode.
Provider connection and named BYOK model profile in the ModelRouters dashboard
One provider credential can power multiple models. OpenRouter works directly with its original model ids; this example also creates the optional user/jimmy alias.

Quick start with curl

Create a key in the dashboard, keep it server-side, and send a normal Chat Completions request.

export MODELROUTERS_KEY="mr_live_..."

curl  https://api.modelrouters.net/v1/chat/completions \
  -H "Authorization: Bearer $MODELROUTERS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [
      {"role": "user", "content": "Write a two-line welcome message."}
    ]
  }'

Use the OpenAI SDK

Existing OpenAI Chat Completions integrations usually need only a new base URL, API key, and model id.

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MODELROUTERS_KEY"],
    base_url=" https://api.modelrouters.net/v1",
)

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

JavaScript

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.MODELROUTERS_KEY,
  baseURL: " https://api.modelrouters.net/v1",
});

const response = await client.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(response.choices[0].message.content);

Streaming

Set stream: true. ModelRouters returns standard server-sent Chat Completions chunks.

const stream = await client.chat.completions.create({
  model: "claude-sonnet-4.6",
  messages: [{ role: "user", content: "Tell me a short story." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Memory + saved chats

Launch sale

The bundle is regularly $6/month and currently $3/month. New accounts can activate 30 days free without a card. The trial ends automatically with no charge; continuing at the launch price requires a separate paid subscription. Subscribing activates persistent memory and encrypted saved chats automatically; no request-body change is required. You can disable either feature from the dashboard, and your relevant memories follow you when you switch models. The complete first user prompt remains available in the encrypted Saved Chat and can be edited into a new fork. Memory facts are derived and stored separately; saving the prompt does not cause it to be re-injected on every request.

Configure memory →

Bring your own key

Connect DeepSeek or another provider in the dashboard. Routing is free; your provider bills inference directly. An OpenRouter connection accepts original provider/model ids without an alias. Optional private aliases use:

user/<your-alias>

Authenticated GET /v1/models includes your aliases. Legacy byok:<id>:<model> routes remain supported for existing integrations.

Endpoints and responses

List models currently exposed by the API.
Create a streamed or non-streamed chat completion.
Send your ModelRouters key as a Bearer token.
HTTP 401

Missing or invalid API key

HTTP 402

Hosted credits or memory subscription required

HTTP 404

Unknown, retired, or inactive model/connection

HTTP 429

Request capacity or rate limit reached