Skip to navigation

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

  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 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