Skip to navigation

Cursor (gateway)

Route Cursor’s chat and agent requests through the Respan gateway for automatic logging, caching, and model switching. Cursor lets you override the OpenAI base URL, so only your RESPAN_API_KEY is needed.

This page covers gateway routing. To capture file edits, shell commands, and MCP tool calls from Cursor’s hook system, see Cursor (tracing).

Setup

1

Open the model settings

Open Cursor Settings (Cmd+, on macOS, Ctrl+, on Windows and Linux) and select Models in the sidebar.

2

Point Cursor at the Respan gateway

  1. Under OpenAI API Key, paste YOUR_RESPAN_API_KEY.
  2. Enable Override OpenAI Base URL and enter https://api.respan.ai/api/v1.
  3. Click Verify. Cursor sends a test request through the gateway.

Cursor appends /chat/completions to the base URL, so keep the /v1 suffix.

No separate OpenAI API key needed. The Respan gateway handles provider authentication.

3

Add the models you want

Click + Add Model and enter a model ID exactly as the gateway expects it, for example gpt-4o. Select it in the chat or agent model picker.

Custom keys apply to chat and agent requests. Tab autocomplete keeps using Cursor’s built-in models. Cursor’s backend still builds the final prompt and then calls the base URL you configured, so requests reach Respan from Cursor’s servers rather than from your machine.

Switch models

Add any of the 1000+ models available through the gateway with + Add Model and pick it from the model dropdown.

gpt-4o
claude-sonnet-4-5-20250929
gemini/gemini-3.5-flash

See the full model list.