LLM Gateway MCP Server

Ask your AI assistant about your usage, costs, and most-used models, providers, and coding apps. Generate text and images through the same MCP connection.

Model Access

Discover and use models from the live catalog

Image Generation

Generate images directly from your AI assistant

Usage & Costs

Explore spending, trends, and your most-used apps

Easy Setup

Works with Claude Code, Cursor, and any MCP client

Available Tools

get-account

No params

See your connected account, project, access scope, and API key spending limits. Owners and admins can also check the credit balance.

{}

get-usage

fromtogranularity

Track requests, tokens, costs, trends, and your most-used provider, model, and coding app. Defaults to the last 30 UTC dates.

{ "granularity": "day" }

get-usage-breakdown

group_bysort_byfrom+3

Rank providers, models, coding apps, or API keys by requests, cost, or tokens. Page through the results to explore further.

{
  "group_by": "app",
  "sort_by": "cost",
  "limit": 10
}

chat

modelmessagestemperature+1

Send messages to a model from the live catalog. Use list-models to choose a model and inspect its pricing.

{
  "model": "MODEL_ID",
  "messages": [{ "role": "user", "content": "Hello!" }]
}

generate-image

promptmodelsize+1

Generate images from text prompts using AI image models like Qwen Image. Returns images directly in the response.

{
  "prompt": "A serene mountain landscape at sunset",
  "model": "qwen-image-3.0",
  "size": "1024x1024"
}

generate-nano-banana

promptfilenameaspect_ratio

Generate images with Gemini 3 Pro Image Preview. Returns inline image data. Set UPLOAD_DIR on the server to also save images to disk.

{
  "prompt": "A pixel-art cat sitting on a rainbow",
  "filename": "hero-image.png",
  "aspect_ratio": "16:9"
}

list-models

familylimitinclude_deactivated+1

Discover available models with their capabilities, pricing, and provider information.

{
    "limit": 10
}

list-image-models

No params

Get a list of all available image generation models with pricing and usage examples.

{}

Ask about your usage

“What did I spend this month?” “Which model do I use most?” “Which coding app costs the most?”

Owners and admins see the connected project. Developers see their own keys in that project. Analytics calls are read-only and have no model charges. Hourly statistics may lag recent requests; results flag incomplete app history.

Quick Start

Claude Code
claude mcp add --transport http --scope user llmgateway https://api.llmgateway.io/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Run this command in your terminal to add the MCP server globally.

Alternative: Manual JSON configuration
Add to ~/.claude.json
{
  "mcpServers": {
    "llmgateway": {
      "url": "https://api.llmgateway.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
Codex
codex mcp add llmgateway --url https://api.llmgateway.io/mcp \
  --bearer-token-env-var LLM_GATEWAY_API_KEY

Set LLM_GATEWAY_API_KEY env var first, then run this command.

Alternative: Manual TOML configuration
Add to ~/.codex/config.toml
[mcp_servers.llmgateway]
url = "https://api.llmgateway.io/mcp"
bearer_token_env_var = "LLM_GATEWAY_API_KEY"
Cursor
{
  "mcpServers": {
    "llmgateway": {
      "url": "https://api.llmgateway.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

Direct API Call
curl -X POST https://api.llmgateway.io/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "get-usage",
      "arguments": {}
    }
  }'

Ready to get started?

Get your API key and start using LLM Gateway with your favorite AI assistant.