본문으로 건너뛰기

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 on the dashboard's API Keys page (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)
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
)
TypeScript works the same way
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 — OpenRouter-format model ID as-is
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"}]
  }'
ParameterTypeRequiredDescription
openai/gpt-5.5gpt-5.5OptionalAuto-converted
anthropic/claude-haiku-4-5claude-haiku-4-5OptionalAuto-converted
x-ai/grok-4.3grok-4.3OptionalAuto-converted
meta-llama/llama-4-scoutllama-4-scout-17bOptionalAuto-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.

streaming.py
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.

Stuck somewhere? Drop your key into the playground and test it right away. Your first top-up earns a separate reward of 10% of the credit you top up (capped at 5,000 credits). See coupons & bonuses for the conditions.