Back to migration guides
    From OpenRouter

    Migrate from OpenRouter

    Same OpenAI-compatible API. Same model breadth. Without the per-request platform fee, without 'auto' being a black box, and with a dashboard built for teams instead of solo developers.

    Published May 20268 min read

    OpenRouter is the right tool when you're a solo developer poking at models. Once you're shipping AI to real users, the cracks show: a platform fee on every token, no real cost-and-quality routing, no team budgets, USD-only billing, and an analytics surface that doesn't tell you what a customer costs. Mesh API is built for the next stage.

    Quick Migration

    diff
    - base_url = "https://openrouter.ai/api/v1"+ base_url = "https://api.meshapi.ai/v1"- api_key  = os.environ["OPENROUTER_API_KEY"]+ api_key  = os.environ["MESH_API_KEY"]

    Why teams switch from OpenRouter

    CapabilityOpenRouterMesh API
    OpenAI-compatible APIYesYes
    Model catalogue size400+1,000+
    Platform fee on each requestYes (markup baked into pricing)Zero. Pay only for what the model costs.
    Smart routing"auto" model exists, but opaqueLive scoring on cost, latency, context, and capability, visible per request
    Negotiated provider ratesLimitedAcross every major provider
    Multi-currency rechargeUSD-firstRecharge in any currency
    Team / RBAC / SSOLimitedBuilt in
    Per-team and per-key budgetsLimitedBuilt in
    Audit logLimitedFull audit log
    Per-request observabilityYesYes, with token-level cost and model-used trail
    ZDRLimitedAvailable
    Customer supportCommunity-firstDirect support, founder-accessible

    Migration steps

    1. Sign up and grab a key

    Takes a minute.

    2. Map your models

    OpenRouter uses provider-prefixed IDs (e.g., openai/gpt-4.1, anthropic/claude-opus-4-7). Mesh accepts the same strings, plus bare model IDs (gpt-4.1, claude-opus-4-7) and auto.

    OpenRouter modelMesh API model
    openai/gpt-4.1openai/gpt-4.1 or gpt-4.1
    anthropic/claude-opus-4-7anthropic/claude-opus-4-7 or claude-opus-4-7
    google/gemini-2.5-progoogle/gemini-2.5-pro or gemini-2.5-pro
    qwen/qwen3-maxqwen/qwen3-max or qwen3-max
    openrouter/autoauto (and you can actually see what it picked)

    3. Swap base URL and key

    Python:

    python
    from openai import OpenAI # Before | OpenRouterclient = OpenAI(    base_url="https://openrouter.ai/api/v1",    api_key=os.environ["OPENROUTER_API_KEY"],) # After | Mesh APIclient = OpenAI(    base_url="https://api.meshapi.ai/v1",    api_key=os.environ["MESH_API_KEY"],) resp = client.chat.completions.create(    model="auto",    messages=[{"role": "user", "content": "Hello!"}],)

    TypeScript:

    typescript
    import OpenAI from "openai"; const client = new OpenAI({  baseURL: "https://api.meshapi.ai/v1",  apiKey: process.env.MESH_API_KEY,});

    cURL:

    bash
    curl https://api.meshapi.ai/v1/chat/completions \  -H "Authorization: Bearer $MESH_API_KEY" \  -H "Content-Type: application/json" \  -d '{ "model": "auto", "messages": [{"role":"user","content":"Hello!"}] }'

    4. Move team management into Mesh

    If you've been juggling shared OpenRouter keys in a Slack channel, this is the part you'll feel right away. Create per-developer and per-environment keys with their own monthly cap, role-based access, and a single billing line.

    5. Watch the spend chart drop

    Mesh's smart routing picks the cheapest model that meets the quality bar for each request. Combined with zero platform fee and pre-negotiated provider rates, the blended bill typically lands ~40% lower than equivalent OpenRouter usage. Then you can decide whether to bank the savings or move to bigger models for the same budget.

    What you gain on Mesh

    • Zero platform fee. Whatever the model lists at, that's what you pay (often less, thanks to negotiated rates).
    • Routing you can audit. Every "auto" decision shows the candidates, the scores, and the winner.
    • Built for teams. RBAC, SSO, per-team budgets, audit log, ZDR.
    • Multi-currency. Recharge in INR, USD, EUR, GBP, AED, and more. Useful if you're not on a US balance sheet.
    • Real support. A founder is on the other end of the email, not a forum.

    Asia's largestsovereign AI gateway.

    1,000+ AI models. One endpoint. Your data stays inside your border.

    Get an API key