Migrating from OpenRouter: drop-in OpenAI-compatible setup in two linesAn API for AI coding agents: one key, any OpenAI-compatible tool

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.

2 linesclient config changebase_url and api_key in OpenAI SDK
$0to issue a Twelver keyno signup and no card required
15model series in TwelverGPT, DeepSeek, Qwen, Grok, GLM, MiMo, MiniMax

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:

Template — this will not work as isclient.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:

Template — this will not work as isclient.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 patternTwelver seriesLive modelIn / out, $ per 1M
qwen/qwen-plus (and similar)qwenQwen3.7-Plus0.65 / 2.6
qwen/qwen-maxqwen-maxQwen3.8-Max3.25 / 9.75
deepseek/deepseek-chat / r1deepseekDeepSeek V4 Pro2.15 / 6.44
openai/gpt-mini / nanogptGPT-6 Luna0.163 / 0.813
openai/gpt-flagshipgpt-terraGPT-6.1 Terra1.63 / 8.13
x-ai/grok-*grokGrok 4.73.25 / 9.75
z-ai/glm-*zaiGLM-5.32.28 / 7.15
minimax/minimax-*minimaxMiniMax M3.1 Flash0.244 / 0.975
Twelver rates as of 4 November 2026. Current rates at /l/en/twelver-coding-api.

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 month
request: $0.00591,000 requests: $5.87
autoQwen3.7-Plus$67.86 per month
request: $0.0231,000 requests: $22.62
deepseekDeepSeek V4 Pro$217 per month
request: $0.0721,000 requests: $72.23
zaiGLM-5.3$231 per month
request: $0.0771,000 requests: $76.98
grokGrok 4.7$328 per month
request: $0.1091,000 requests: $109
qwen-maxQwen3.8-Max$328 per month
request: $0.1091,000 requests: $109

Twelver 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 in opencode.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

Your Twelver API key authenticates more than /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

ErrorCauseFix
400 / Model not foundRequest still passes a vendor/model-name slugSwap it for a short Twelver series from the table above (auto, deepseek, qwen-max, gpt)
404 Not FoundTrailing slash after /v1 or missing /v1 suffixEnsure your Twelver base_url ends cleanly in /v1 with no trailing slash
401 UnauthorizedOld API key still loaded in environmentUpdate .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?
No. Because both use the OpenAI /v1/chat/completions format, you only update base_url, api_key and model series names. Streaming, tool calling and JSON outputs stay unchanged.
How can I list all available Twelver model series programmatically?
Send a GET request to /v1/models with your Twelver key in the Authorization: Bearer header — it returns every currently supported series.
Can I test the Twelver migration without adding a card?
Yes. Click the button on this page or on the Twelver API page to issue a Base URL and key with starter tokens — no signup and no card required.
What else does one Twelver API key cover beyond chat completions?
One key and token balance unlock three surfaces: the OpenAI-compatible chat API (15 series), the media API (images, video, music, speech) and 27 remote MCP toolsets.
Where can I compare provider categories and markups?
See the companion chapter OpenRouter alternatives for the full breakdown.

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
Rate your experience