Cursor
Route Cursor's chat through Gateway with the OpenAI base URL override
Cursor’s OpenAI base URL override lets Ask and Plan modes use any Gateway model. Shared setup: Building with coding agents.
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
- Open Settings → Cursor Settings → Models and scroll to API Keys
- Enable OpenAI API Key and paste your Gateway key
- Enable Override OpenAI Base URL and enter
https://api-gateway.merge.dev/v1/openai - Click + Add Custom Model, enter a Gateway model name such as
anthropic/claude-opus-5or an alias such as@alias/support-agent, and turn on its toggle - Verify the key when prompted, select the model in the chat pane (Ask mode,
Cmd+LorCtrl+L), and send a message. The request appears in 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