Skip to content

Migrate from OpenRouter

Keep your code as-is — change just two lines. Five minutes is all it takes.

Only two things change — 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 under Dashboard → API Keys (keys start with plm_).

Before (OpenRouter)
from openai import OpenAI

client = OpenAI(
    api_key="sk-or-v1-xxxxxxxx",                # OpenRouter key
    base_url="https://openrouter.ai/api/v1",    # OpenRouter
)
After (PleumRouter)
from openai import OpenAI

client = OpenAI(
    api_key="plm_xxxxxxxxxxxxxxxx",             # PleumRouter key
    base_url="https://apirouter.pleum.ai/v1",      # PleumRouter
)
TypeScript works the same way
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "plm_xxxxxxxxxxxxxxxx",
  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 — OpenRouter-format model ID as-is
curl https://apirouter.pleum.ai/v1/chat/completions \
  -H "Authorization: Bearer plm_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.5",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
ParameterTypeRequiredDescription
openai/gpt-5.5→ gpt-5.5OptionalAuto-converted
anthropic/claude-haiku-4-5→ claude-haiku-4-5OptionalAuto-converted
x-ai/grok-4.3→ grok-4.3OptionalAuto-converted
meta-llama/llama-4-maverick→ Llama 4 MaverickOptionalvia Together AI

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.

streaming.py
stream = client.chat.completions.create(
    model="gpt-4.1",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

4. Error handling#

Status codes match the OpenAI standard (400/401/402/429/502). If credits run low, you get a 402 with a top-up prompt. For the full format, see the error docs.

5. Cost — how is it different from OpenRouter?#

OpenRouter charges roughly a 5.5% fee on credit purchases. PleumRouter doesn't mark up token prices (0%) and only a 3% platform fee at top-up — cheaper. On top of that, KRW payments are built in, making corporate-card reconciliation far easier. See the full formula in the pricing docs.

Stuck somewhere? Drop your key into the playground and test it right away. You also earn rewards for signing up, linking an account, your first call, and your first payment — up to ₩5,000.