Migrating from OpenRouter: drop-in OpenAI-compatible setup in two lines
The short version: because your client already speaks the standard OpenAI format, moving a project from OpenRouter to Twelver takes two lines of config — base_url and api_key — plus swapping long model slugs for short Twelver series names. One Twelver key and token balance cover chat completions, the media API and 27 remote MCP toolsets with published per-series rates.
Why teams switch to a single multi-surface Twelver key
Standard OpenAI-compatible stacks make switching providers cheap: your streaming loop, tool definitions and structured output schemas stay untouched. Moving to Twelver gives you published per-series pricing, instant key provisioning without signup, and one shared balance that covers text models, image/video/audio generation and remote MCP servers. For a broader look at provider types and markup chains, see OpenRouter alternatives.
Step 1. Issue your Twelver Base URL and API key
Click below to create a Base URL of the form https://twelver.app/api/ai/<config-id>/v1 and an sk-… key on starter tokens — no signup and no card. Both values populate automatically in the migration snippets below.
Right here on the page
Ready Twelver Base URL and key for migration
Issue a key in one click — the Python and TypeScript snippets below update automatically. You can also send a live test request right here.
Press it and get your base_url and API key.
No sign-up, no card.
Free. Your key appears right here.
Step 2. Update client initialisation (Python and Node.js)
In the official Python OpenAI SDK, replace the base URL, key and model name. Custom aggregator headers such as HTTP-Referer or X-Title can be removed — Twelver accepts plain OpenAI SDK requests:
client.pyThe highlighted parts are stand-ins. The button above issues them in seconds, no sign-up.from openai import OpenAI
client = OpenAI(
base_url="https://twelver.ru/api/ai/<your-config-id>/v1",
api_key="sk-<your-key>",
)
response = client.chat.completions.create(
model="deepseek", # short Twelver series name
messages=[{"role": "user", "content": "Check this SQL query for N+1 issues"}],
)
print(response.choices[0].message.content)The same swap in Node.js / TypeScript with the official openai package:
client.tsThe highlighted parts are stand-ins. The button above issues them in seconds, no sign-up.import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://twelver.ru/api/ai/<your-config-id>/v1',
apiKey: 'sk-<your-key>',
});
const completion = await client.chat.completions.create({
model: 'qwen', // Qwen3.7-Plus series on Twelver
messages: [{ role: 'user', content: 'Write a unit test in Vitest' }],
});
console.log(completion.choices[0].message.content);Step 3. Map vendor/model slugs to Twelver series
The only field that changes beyond base_url and key is model. Instead of pinned vendor/model-name strings that age out, Twelver uses short stable series pointing to the current release. Call GET /v1/models any time to inspect the full list.
| Previous ID pattern | Twelver series | Live model | In / out, $ per 1M |
|---|---|---|---|
| qwen/qwen-plus (and similar) | qwen | Qwen3.7-Plus | 0.65 / 2.6 |
| qwen/qwen-max | qwen-max | Qwen3.8-Max | 3.25 / 9.75 |
| deepseek/deepseek-chat / r1 | deepseek | DeepSeek V4 Pro | 2.15 / 6.44 |
| openai/gpt-mini / nano | gpt | GPT-6 Luna | 0.163 / 0.813 |
| openai/gpt-flagship | gpt-terra | GPT-6.1 Terra | 1.63 / 8.13 |
| x-ai/grok-* | grok | Grok 4.7 | 3.25 / 9.75 |
| z-ai/glm-* | zai | GLM-5.3 | 2.28 / 7.15 |
| minimax/minimax-* | minimax | MiniMax M3.1 Flash | 0.244 / 0.975 |
Work out what the requests cost
Pick a workload or type your own numbers — the calculator multiplies them by each series’ rates. A token is roughly 4 characters of English text or code.
gptGPT-6 Luna$17.6 per monthautoQwen3.7-Plus$67.86 per monthdeepseekDeepSeek V4 Pro$217 per monthzaiGLM-5.3$231 per monthgrokGrok 4.7$328 per monthqwen-maxQwen3.8-Max$328 per monthTwelver rates as of 4 November 2026; tokens are billed as actually used, caching and discounts not included. The arithmetic runs in your browser.
Step 4. Point your IDE and terminal agents at Twelver
If your workflow runs through coding agents rather than custom scripts, the exact same Base URL and key drop into:
- OpenCode — update
baseURL, the key env var and model names inopencode.json. - Cline — choose OpenAI Compatible, paste the Twelver Base URL, key and short series ID.
- Kilo Code — add a Custom provider in VS Code, JetBrains or
kilo.jsonc.
One Twelver balance for chat, media and MCP
/v1/chat/completions: the same key and token balance also cover the media API (images, video, music, speech) and 27 remote MCP toolsets. No separate subscriptions needed for web search or image generation.Fast assisted migration
Ask the AI to port your client config to Twelver
Opens chat with the question pre-filled — just press send. The Twelver API integrator issues your base_url and key, maps your model slugs to Twelver series and estimates token spend.
Common migration errors
| Error | Cause | Fix |
|---|---|---|
| 400 / Model not found | Request still passes a vendor/model-name slug | Swap it for a short Twelver series from the table above (auto, deepseek, qwen-max, gpt) |
| 404 Not Found | Trailing slash after /v1 or missing /v1 suffix | Ensure your Twelver base_url ends cleanly in /v1 with no trailing slash |
| 401 Unauthorized | Old API key still loaded in environment | Update .env or exported variable and restart the process |
Read next
Provider-type comparison and markup breakdown: OpenRouter alternatives. Overview of model APIs: AI model APIs. Full book: API for AI coding agents.
Frequently asked questions
Do I have to rewrite application code to move to Twelver?
How can I list all available Twelver model series programmatically?
Can I test the Twelver migration without adding a card?
What else does one Twelver API key cover beyond chat completions?
Where can I compare provider categories and markups?
Try it yourself
Everything in this guide runs inside Twelver
One chat for text, images, video, music and voice — no separate services or subscriptions.
Open Twelver chat