For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://modelgates.ai/docs/_mcp/server.

Cursor

What is Cursor?

Cursor is an AI-powered code editor built on VS Code. It features an agent mode for autonomous coding, tab completions, inline edits, a CLI, and cloud agents — all backed by frontier models from OpenAI, Anthropic, Google, and more.

By routing Cursor through ModelGates, you get access to hundreds of models through a single API key, automatic provider failover, and centralized usage tracking.

Quick Start

Cursor supports ModelGates through its Override OpenAI Base URL feature. This routes requests from Cursor's OpenAI provider slot through ModelGates instead of directly to OpenAI.

Step 1: Get Your ModelGates API Key

  1. Sign up or log in at ModelGates
  2. Navigate to your API Keys page
  3. Create a new API key
  4. Copy your key (starts with sk-mg-...)

Step 2: Configure Cursor

  1. Open Cursor Settings (gear icon or Cmd/Ctrl + ,)
  2. Navigate to Models, then expand the API Keys section
  3. Toggle on OpenAI API Key, then:
    • Paste your ModelGates API key into the OpenAI API Key field
    • Toggle on Override OpenAI Base URL and set it to:
text
https://modelgates.ai/api/v1

Step 3: Add Models

After connecting, add the models you want to use. In the Models section, click + Add model and enter an ModelGates model ID:

  • ~anthropic/claude-sonnet-latest
  • ~google/gemini-flash-latest
  • ~openai/gpt-mini-latest
  • ~anthropic/claude-haiku-latest

You can find the exact model ID for each model on the ModelGates models page.

Step 4: Select a Model

Open the model picker in the chat or agent panel and select one of the models you added. Your requests will now route through ModelGates.

Why Use ModelGates with Cursor?

Access to Hundreds of Models

Cursor's built-in BYOK only supports a handful of providers (OpenAI, Anthropic, Google, Azure, AWS Bedrock). With ModelGates, you can access models from DeepSeek, Meta, xAI, Mistral, Cohere, and many more — all through the single OpenAI provider slot.

Provider Failover

If one provider is unavailable or rate-limited, ModelGates automatically routes to another, keeping your coding sessions uninterrupted.

Organizational Controls

For teams, ModelGates provides centralized budget management. Set spending limits, allocate credits, and monitor usage across developers using Cursor from your ModelGates Activity Dashboard.

Usage Visibility

Track which models your team uses, monitor costs in real-time, and understand usage patterns — all from a single dashboard, regardless of the underlying provider.

Provider Routing

You can control which upstream providers handle your requests by appending routing suffixes to model names or by configuring provider preferences in the ModelGates Playground:

  • Append :nitro for throughput-optimized routing (e.g., ~anthropic/claude-sonnet-latest:nitro)
  • Append :floor for cost-optimized routing

For more routing options, see the Provider Routing docs.

Limitations

  • Tab completions are not affected by BYOK settings — they always use Cursor's built-in models.
  • Auto and Composer 2 modes may not be routed through your API key — check Cursor's docs for current behavior.
  • Only models accessible via ModelGates's OpenAI-compatible endpoint will work. Most chat and reasoning models are supported.

Troubleshooting

  • "Invalid API key": Make sure you're using your ModelGates API key (starts with sk-mg-...), not an OpenAI key.
  • Model not found: Ensure the model ID exactly matches the format on modelgates.ai/models (e.g., ~anthropic/claude-sonnet-latest, not claude-sonnet-latest).
  • Base URL: Make sure the override URL is https://modelgates.ai/api/v1 (with /v1 at the end).

Resources