AI Gateway
One line change. Full visibility into every AI request — what was sent, what came back, how many tokens, what it cost. Works with Claude Code, Cursor, Windsurf, Cline, Raycast and any app you build.How it works
You’re changing one thing: where your AI requests go.Why use AI Gateway?
Complete Visibility
See exactly what data is being sent to AI providers from your tools and apps — full request body, response, tokens, and cost per request.
Security & Privacy
Automatically detect and block sensitive data — API keys, passwords, PII — before they reach an AI provider.
Cost Optimization
Track token usage per tool, per user, per feature. Run A/B tests on prompts and models to reduce spend.
Drop-in Replacement
Works with existing SDKs and tools. Change one URL and one env var — nothing else in your workflow changes.
Supported providers
Where do you want to start?
I use Claude Code, Cursor, or Windsurf
Set up the gateway for your personal coding tools. See exactly what your AI assistant is sending — your code, context, token usage, and cost — in real time.
I'm building an app that calls an AI API
Add the gateway to your backend. Get per-user tracking, abuse prevention, rate limiting, and cost controls in production.
Quick setup (2 steps)
1
Get your API key
Top up credits at app.leanmcp.com/billing, then create a key at app.leanmcp.com/api-keys.
2
Point your tool at the gateway
Replace your provider’s base URL and API key with your LeanMCP key. That’s it.Pick your tool below for the exact config.
Setup guides by tool
Personal tools
Claude Code
Cursor
Windsurf
Cline
Raycast
OpenCode
Developers
SDK Integration
OpenAI and Anthropic SDK examples with user context headers.
LiteLLM
Route LiteLLM calls through the gateway for full observability of tool calls and conversations.
Full Integration Guide
All providers, auth patterns, rate limiting, and A/B testing.

