가이드
Migrate from OpenRouter to bnrouter
Change Base URL, API key, and model id — keep the OpenAI request shape.
업데이트: 2026-10-27 · 검증: docs_checked(문서 대조. E2E 미실시)
Quick answer
To migrate an OpenAI-compatible client from OpenRouter to bnrouter, change the Base URL to https://console.bnrouter.com/v1, use your bnrouter API key, and set model to the id shown in the bnrouter console (YOUR_MODEL_ID).
What stays the same
- POST /v1/chat/completions request and response fields.
- OpenAI SDK, LangChain, and other OpenAI-compatible clients.
What changes
- Base URL → https://console.bnrouter.com/v1 (marketing www is not the API).
- Authorization: Bearer <bnrouter user API key>.
- model field → YOUR_MODEL_ID from bnrouter (do not assume 1:1 OpenRouter slugs).
Verify in the dashboard
After a successful test, check usage for that API key in the merchant console. If you see 401, fix the key first; if 404, check Base URL and model id.
Claude Code / Codex / IDE tooling
For Claude Code, Codex, and similar tools, point the OpenAI-compatible or Anthropic proxy Base URL at bnrouter per [tooling docs](/docs/tooling).
Rollback
Keep your OpenRouter key until bnrouter is verified. To roll back, restore the previous Base URL, key, and model id.
curl https://console.bnrouter.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_BNROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"messages": [{"role": "user", "content": "Hello from bnrouter"}],
"stream": false
}'from openai import OpenAI
client = OpenAI(
api_key="YOUR_BNROUTER_API_KEY",
base_url="https://console.bnrouter.com/v1",
)
response = client.chat.completions.create(
model="YOUR_MODEL_ID",
messages=[{"role": "user", "content": "Hello from bnrouter"}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.BNROUTER_API_KEY,
baseURL: "https://console.bnrouter.com/v1",
});
const response = await client.chat.completions.create({
model: "YOUR_MODEL_ID",
messages: [{ role: "user", content: "Hello from bnrouter" }],
});
console.log(response.choices[0]?.message?.content);Checklist
- Confirm YOUR_MODEL_ID in the console before cutting over traffic.
- Run one non-stream test request after updating config.
FAQ
- Can I reuse OpenRouter model names?
- Only if the same id exists on bnrouter — always pick YOUR_MODEL_ID from the bnrouter console or GET /models.
- What if I used www.bnrouter.com/v1?
- See wrong Base URL guide — use console host only.
Sources
- bnrouter tooling docs (checked 2026-10-27)
- Wrong Base URL guide (checked 2026-10-27)