Cursor

Route Cursor's chat through Merge Gateway to use any model with a single API key.

Cursor lets you override the OpenAI base URL and bring your own API key. Point that override at Merge Gateway and Cursor can use every model Gateway routes to (OpenAI, Anthropic, Google, Kimi, and more) under a single API key.

Cursor’s Agent mode does not currently support custom API keys. Only Ask and Plan modes work with a custom OpenAI base URL. Tab autocomplete uses Cursor’s proprietary model and isn’t routed through Gateway either.

Before you start

  • Grab an API key from gateway.merge.dev/settings/api-keys.
  • Decide which model you want to use. Gateway model names take the form provider/model. For example, anthropic/claude-opus-4.6, openai/gpt-5.2, or google/gemini-2.5-pro. List everything available via GET /v1/models.

Configure Cursor

1

Open Cursor Settings → Models

In Cursor, open Settings → Cursor Settings → Models. Scroll down to the API Keys section.

2

Paste your Gateway API key

Enable OpenAI API Key and paste your Merge Gateway API key into the field.

3

Override the base URL

Enable Override OpenAI Base URL and enter:

https://api-gateway.merge.dev/v1/openai
4

Add a custom model

Click + Add Custom Model and enter a Gateway model name in provider/model form, for example:

anthropic/claude-opus-4.6

Enable the toggle next to the model you just added. Repeat for any other models you want available in the picker.

5

Verify the key

Cursor will prompt you to verify the key. On success, your custom models become selectable.

6

Select the model and send a test message

Open the Cursor chat pane (Ask mode, Cmd+L / Ctrl+L), select your Gateway model from the dropdown, and send a test message. The request will show up in your Gateway dashboard within a few seconds.

Caveats

Cursor’s Agent mode currently requires Cursor’s own API credentials. Use Ask or Plan mode when working through Gateway. This is a Cursor-side restriction; Gateway itself handles agentic workloads fine. See Tool calling.

Tab autocomplete in Cursor uses a proprietary Cursor model and is not affected by the OpenAI base URL override. Only chat (Ask / Plan) traffic goes through Gateway.

When you select a non-native model, Cursor can show a warning about limited agentic support. For Ask and Plan modes, you can safely ignore it. Tool calling works through Gateway for any model whose capabilities.supports_tool_calling is true on the chosen vendor route.

Any model Gateway supports. Use GET /v1/models to list them, or open the Gateway dashboard and copy the model identifier. If you set a routing policy, the exact model in the picker becomes a fallback and Gateway picks the vendor per request.

Next steps