# LLM Gateway

LLM Gateway is an MCP server for Claude Code that routes prompts across model providers and tracks token spending and response latency inside the agent.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 1755 repo stars
- Author: theopenco
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/theopenco/llmgateway/tree/HEAD/apps/gateway
- Updated: 2026-10-29
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/llm-gateway

## What it does

LLM Gateway acts as an intermediary layer between your development environment and providers such as Anthropic, OpenAI, or Google Vertex AI. It normalizes requests using the OpenAI API standard, giving you a centralized spot to supervise token consumption, track response latency, and compare model costs.

You can link your tools to the hosted cloud endpoint at `https://api.llmgateway.io/mcp` or run your own instance via Docker. When deploying the unified image locally, mount named Docker volumes for PostgreSQL data to avoid container permission crashes during database setup.

## Requirements
- Needs: Docker
- Remote server: `https://api.llmgateway.io/mcp`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http gateway https://api.llmgateway.io/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add gateway --url https://api.llmgateway.io/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "gateway": {
            "url": "https://api.llmgateway.io/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "gateway": {
            "type": "http",
            "url": "https://api.llmgateway.io/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http gateway https://api.llmgateway.io/mcp
```

## When to use it
- route agent queries to multiple inference vendors from one place
- audit token usage and spending across different models
- monitor latency variations between providers
- consolidate vendor API credentials into a single gateway

## Example prompts
- Check my total token usage and expenses across all models
- Send this prompt to an Anthropic model via the gateway
- Inspect response latency metrics for recent queries

## Similar
- [llm-gateway](https://affpapa.org/en/nevibecode/skills/llm-gateway.md) — skill · 370 installs
- [azure-apim-ai-gateway](https://affpapa.org/en/nevibecode/rules/azure-apim-ai-gateway.md) — rule · ★ 41430 repo stars
- [llm-application-dev](https://affpapa.org/en/nevibecode/skills/llm-application-dev.md) — skill · 467 installs
- [llm-cost-optimizer](https://affpapa.org/en/nevibecode/skills/llm-cost-optimizer.md) — skill · 73 installs
- [api-gateway-mcp-server](https://affpapa.org/en/nevibecode/skills/api-gateway-mcp-server.md) — skill · 499 installs
- [openclaude-multi-llm](https://affpapa.org/en/nevibecode/skills/openclaude-multi-llm.md) — skill · 725 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
