> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Cursor

> Configure Cursor's OpenAI base URL override and custom models to send chat requests through Gateway.

Cursor's OpenAI base URL override lets Ask and Plan modes use any Gateway model. Shared setup: [Building with coding agents](/merge-gateway/coding-agents/overview).

> **Agent mode and Tab don't use custom keys**
>
> Agent mode doesn't support custom API keys, and Tab autocomplete always uses Cursor's own model.

## Configure Cursor

1. Open **Settings → Cursor Settings → Models** and scroll to **API Keys**
2. Enable **OpenAI API Key** and paste your Gateway key
3. Enable **Override OpenAI Base URL** and enter `https://api-gateway.merge.dev/v1/openai`
4. Click **+ Add Custom Model**, enter a Gateway model name such as `anthropic/claude-opus-5` or an alias such as `@alias/support-agent`, and turn on its toggle
5. Verify the key when prompted, select the model in the chat pane (Ask mode, `Cmd+L` or `Ctrl+L`), and send a message. The request appears in [Logs](https://gateway.merge.dev/logs) once it completes.

## Gotchas

* Ignore Cursor's warning about limited agentic support for non-native models in Ask and Plan modes
* Requests come from Cursor's servers with no session header, so they don't group into a thread in Logs

## Next steps

#### [Building with coding agents](/merge-gateway/coding-agents/overview)

Keys, models, aliases, and project scoping

#### [Model aliases](/merge-gateway/routing/model-aliases)

Change the model behind Cursor without editing its settings