Blog

Migrating from OpenRouter to Leanroute

5 min readLeanroute Team

Goodbye OpenRouter: Migrate to Leanroute with flat BYOK, no per-request markup

TL;DR

Already using OpenRouter and considering a move? Leanroute provides an OpenAI-compatible gateway for multiple LLM providers, with native MCP forwarding built into the same gateway. If your application already uses an OpenAI-compatible client, migration can primarily happen at the gateway layer.

Why Migrate?

If OpenRouter is already working for your application, why change anything?

That's the right question.

The answer isn't that you need another way to call LLMs.

The question is whether your gateway should stop at models.

Modern AI applications increasingly need both:

Models
   +
Tools

If you're adding MCP to an application already using an LLM gateway, you may end up introducing another piece of infrastructure:

Application
    │
    ├──────► LLM Gateway ──────► Models
    │
    └──────► MCP Infrastructure ──────► Tools

With Leanroute:

Application
       │
       ▼
   Leanroute
    /     \
   ▼       ▼
Models    MCP

One gateway for both.


The Migration

The goal is simple:

Change the gateway, not your application.

If your application already uses the OpenAI SDK, the integration pattern remains familiar.

Before

const client = new OpenAI({
  baseURL: "https://openrouter.ai/api/v1",
  apiKey: process.env.OPENROUTER_API_KEY,
});

After

const client = new OpenAI({
  baseURL: "YOUR_LEANROUTE_ENDPOINT",
  apiKey: process.env.LEANROUTE_API_KEY,
});

Your application can continue using the same OpenAI-compatible interface.

No new provider SDK.

No application-wide rewrite.

No need to rebuild your model integration.

Same SDK. Same application. Different gateway.

Note: Use the exact Leanroute endpoint and authentication values from the current documentation when implementing the migration.


Keep Your Existing Model Integrations

Your application can continue working with the models and providers it already uses.

The gateway remains the abstraction layer between your application and model providers.

Your Application
       │
       ▼
   Leanroute
       │
   ┌───┼───────────┐
   ▼   ▼           ▼
 OpenAI  Anthropic  Google

Your application doesn't need to know how the underlying provider connection is implemented.


Then Add MCP

This is where the migration becomes more interesting.

Instead of adding a separate MCP proxy or changing your application's architecture:

Application
    │
    ├── LLM Gateway
    │
    └── MCP Proxy

Leanroute puts both behind the same gateway:

             Application
                  │
                  ▼
              Leanroute
             /         \
            ▼           ▼
       LLM Providers   MCP Servers

Add mcp_servers to the request, and Leanroute handles the MCP connection server-side.

Your application continues talking to one endpoint.


OpenRouter vs Leanroute

The goal isn't to claim that one gateway is universally better than another.

The important question is what your application needs.

OpenRouter Leanroute
OpenAI-compatible API
Multiple LLM providers
Model routing
BYOK
MCP forwarding
Models + tools through one gateway
Flat monthly pricing
Zero per-request markup

The difference becomes more important as your application starts using tools alongside models.

With Leanroute, MCP forwarding is part of the gateway rather than another piece of infrastructure your application needs to manage.


Why This Matters

The benefit isn't simply replacing one LLM gateway with another.

It's reducing the number of infrastructure components your application needs to understand.

Instead of:

LLM Gateway
+
MCP Proxy
+
Provider SDKs

You get:

             Leanroute
          Models + Tools

That's the direction we think AI infrastructure is heading.


The Migration in Three Steps

1. Change the endpoint

Point your existing OpenAI-compatible client at Leanroute.

2. Change the credentials

Use your Leanroute credentials and provider keys.

3. Add MCP when you need it

Add mcp_servers to requests that need tool access.

That's it.

Your application remains focused on the application.


Who Should Consider Migrating?

If you're already using OpenRouter and you're happy with it, you don't need to migrate just because another gateway exists.

But Leanroute may be worth considering if you:

  • Want model routing and MCP behind one gateway
  • Don't want to introduce a separate MCP proxy
  • Want to keep an OpenAI-compatible integration
  • Want BYOK with a predictable flat monthly cost
  • Want your application to remain independent of individual provider SDKs

The decision should be about where you want your AI infrastructure to live, not about replacing one API endpoint with another.


One Gateway for Models and Tools

AI applications are becoming more than model consumers.

They use models to reason and tools to act.

That means the infrastructure layer needs to support both.

That's why we built Leanroute:

One Gateway for Models and Tools.

And our broader philosophy is simple:

AI infrastructure should disappear behind a simple interface so developers can focus on building the actual product.


Key Takeaways

  • If you're already using OpenRouter, you don't need to relearn the gateway model.
  • Leanroute provides an OpenAI-compatible interface.
  • Migration can primarily happen at the gateway layer.
  • Native MCP forwarding lets you add tools without introducing a separate MCP gateway.
  • The goal is one infrastructure layer for both models and tools.

About Leanroute

Leanroute is One Gateway for Models and Tools.

Route requests across major AI providers and connect to MCP servers through a single OpenAI-compatible endpoint.

Flat $15/month. BYOK. Zero per-request markup. Singapore-hosted.

Learn more about Leanroute

OpenRouterAI GatewayLLM GatewayMCPAI InfrastructureLLM Routing