Migrate from OpenRouter
Keep your code as-is — change just two lines. Five minutes is all it takes.
base_url and the API key. Model IDs are converted automatically even if you send them in OpenRouter format.1. Swap base_url and the API key#
PleumRouter is an OpenAI-compatible API, so you can keep using your existing SDK. First sign up, then issue a key on the dashboard's API Keys page (keys start with plm_).
from openai import OpenAI
client = OpenAI(
api_key="sk-or-v1-xxxxxxxx", # OpenRouter key
base_url="https://openrouter.ai/api/v1", # OpenRouter
)import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["PLEUM_API_KEY"], # PleumRouter key
base_url="https://apirouter.pleum.ai/v1", # PleumRouter
)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.PLEUM_API_KEY,
baseURL: "https://apirouter.pleum.ai/v1",
});2. Model IDs — send them as-is#
You can send vendor-namespaced formats like OpenRouter's openai/gpt-5.5 unchanged — we convert them automatically. The short form (gpt-5.5) works too. See the full model list at GET /v1/models or on the models page.
curl https://apirouter.pleum.ai/v1/chat/completions \
-H "Authorization: Bearer $PLEUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.5",
"messages": [{"role": "user", "content": "Hello"}]
}'| Parameter | Type | Required | Description |
|---|---|---|---|
| openai/gpt-5.5 | gpt-5.5 | Optional | Auto-converted |
| anthropic/claude-haiku-4-5 | claude-haiku-4-5 | Optional | Auto-converted |
| x-ai/grok-4.3 | grok-4.3 | Optional | Auto-converted |
| meta-llama/llama-4-scout | llama-4-scout-17b | Optional | Auto-converted |
3. Streaming#
stream: true works with the OpenAI SDK as-is. The final chunk of the response includes usage along with the KRW cost (cost), so you know the price of each call right away.
stream = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="")4. Error handling#
The main status codes are 400/401/402/429/503. If credits run low, you get a 402 with a top-up prompt. For the full format, see the error docs.
5. Cost — PleumRouter fees#
Model usage carries no markup (0%). An FX markup of 0.5% applies to the KRW conversion. When an account without a subscription tops up prepaid credits, a 3% platform fee applies; top-ups by subscribed accounts carry no platform fee. The amount you pay at top-up includes 10% VAT. KRW payment is the default. See the full formula in the pricing docs.