Docs
Everything you need to integrate Leanroute.
Point your existing OpenAI SDK at api.leanroute.dev/v1 and you're running. Everything else — model catalog, integration playbooks, guardrails, compliance posture, competitor comparisons — is below.
Build with Leanroute
Pointing your existing OpenAI SDK at Leanroute. The 5-minute path.
Developer Guide
OpenAI-compatible endpoints, request shapes, response headers, error codes, code samples in cURL and Python. Start here.
Set up your gateway
After your first request: spend caps, guardrails, cheaper-model routing, caching and MCP tools. What is on by default, where to change it, and how to check it works.
Caching
Exact-match and semantic caching, on by default. What is cached, for how long, and how to turn it off.
Models & Pricing
Interactive catalog of every model we route to. Filter by tier, region, vision support. Live per-1M-token prices.
Gateway Headers Reference
Every x-gateway-* header the API emits — direction, when it appears, example values, and JS/Python snippets to consume each.
MCP on any model
newAdd mcp_servers to any /v1/chat/completions request. The gateway connects to your MCP servers, runs the tool loop on whichever model you chose, and returns one OpenAI-shape answer.
Agent runs
newTwo headers turn agent traffic into runs: cost per run, runs per agent, models used and every tool called. Recipes for the OpenAI SDK, LangChain, Vercel AI SDK and Claude Code.
MCP server for coding agents
Install @leanroute/mcp-server so Claude Code, Cursor, Windsurf and Cline can list models, compare prices, check usage and manage keys on your account.
Examples
End-to-end walkthroughs of real Leanroute integrations you can lift wholesale for your own product.
Integration Guides
Drop-in playbooks for the tools developers actually use.
All integrations
The full catalog — Cursor, Continue, Cline, Aider, OpenWebUI, n8n, plus guardrails vendors Presidio, Lakera, Rebuff.
Coding tools
Cursor, Continue, Cline, Aider, OpenWebUI — each with the exact OPENAI_BASE_URL config and a working example.
Automation
n8n liveInstall the n8n-nodes-leanroute community node for a Leanroute Chat Model in AI Agent workflows, or use the built-in OpenAI node with a custom base URL.
Guardrails vendors
If our built-in guardrails (block + redact + moderation) aren't enough, here's how to layer Presidio, Lakera Guard, or Rebuff in front.
Platform Features
Behavior built into the gateway. No code required on your side.
Compare to alternatives
Side-by-side with every LLM gateway you might also be considering.
Missing something?
We document what we ship, not what we plan to ship. If you can't find an integration guide for a tool you use, the OpenAI-compatible base URL configuration usually works directly — see the Developer Guide for the canonical pattern. If you'd like us to add a dedicated guide, tell us.