Smart LLM routing across every major provider via one OpenAI-shape API.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Model Context Protocol (MCP) server for GammaInfra β intelligent LLM routing across every major provider via one OpenAI-shape API.
Drop this server into Claude Code, Claude Desktop, Cursor, Cline, Continue, or any MCP-compatible host, and your agent gets direct tool access to:
chat_completions β call any supported model (or gammainfra/auto for smart routing) with cost, latency, and quality controls. Routing metadata (which provider served, exact cost in USD, fallback chain) is returned as a structured routing_meta field.list_models β full model catalog with pricing and capability flags.get_balance β managed + BYOK balances.get_status β overall + per-provider health, 24h request count.The server runs via npx β no manual install needed. The first invocation downloads and caches the package.
Or edit ~/.claude.json and add to the mcpServers block:
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Restart Claude Desktop. The "GammaInfra" server should appear in the tools menu.
Edit ~/.cursor/mcp.json:
Open Cline's settings (gear icon β MCP Servers tab) and add:
| Var | Required | Default | Description |
|---|---|---|---|
GAMMAINFRA_API_KEY | yes | β | Your GammaInfra API key, format sk-gammainfra-{32_chars}. |
GAMMAINFRA_BASE_URL | no | https://api.gammainfra.com/v1 | Override for staging/dev. |
chat_completionsSend a chat completion request and receive the model response plus routing metadata.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | yes | gammainfra/auto for smart routing, gammainfra/fast/gammainfra/cheap for tier shortcuts, or pin a specific model like openai/gpt-5-mini. |
messages | array | yes | OpenAI-shape conversation messages. |
temperature | number | no | 0..2. |
max_tokens | int | no | |
max_completion_tokens | int | no | GPT-5 family requires this instead of max_tokens. |
cost_quality | float | no | 0.0..1.0 continuous dial. Sent as X-GammaInfra-Cost-Quality. |
max_latency_ms | int | no | 60..600000. Caps total wall-clock incl. fallback retries. Also enforced client-side as a hard request abort. |
preference | string | no | quality, cost, or latency. |
region | string | no | us, eu, apac, or specific AWS region. |
tools, tool_choice, response_format, top_p, frequency_penalty, presence_penalty | various | no | Standard OpenAI fields, forwarded as-is. |
Returns: { response: <OpenAI response>, routing_meta: { provider, endpoint, cost_usd, input_cost_usd, output_cost_usd, router_version, logical_model, fallback_chain, attempted_count, request_id, ... } }
Timeout note: Every request has a 10-minute client-side hard timeout (via AbortController) so a hung upstream can't wedge the MCP process. For chat_completions, a supplied max_latency_ms replaces that default as the hard abort bound.
Streaming note: MCP tool responses are non-streaming. The server always sends stream: false to the upstream and does not accept a stream parameter on the tool input (it's rejected by schema validation). For streaming, use the GammaInfra HTTP API directly.
list_modelsNo parameters. Returns the full model catalog including direct-pin slugs, per-token pricing, and capability flags (supports_tools, supports_vision).
get_balance| Name | Type | Required | Description |
|---|---|---|---|
include_byok | boolean | no | Default false. Also fetch the BYOK balance. Off by default to avoid an extra request β and a guaranteed 404 β for customers without BYOK enrollment. |
Returns { managed_balance_usd, byok_balance_usd, currency }. With include_byok omitted/false, byok_balance_usd is null and no BYOK request is made (no byok_error). With include_byok: true, if BYOK isn't enrolled, byok_balance_usd is null and a byok_error field describes the cause.
get_statusNo parameters. Returns GammaInfra's current overall health, per-provider state and live p50 latency, and 24h request count.
MIT β see LICENSE.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-server-27)<a href="https://allmcps.com/mcp/mcp-server-27"><img src="https://allmcps.com/api/badge/mcp-server-27?style=directory" alt="Mcp Server on AllMCPs" /></a>