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.
Trace Cursor sessions
This page covers gateway routing. To capture file edits, shell commands, and MCP tool calls from Cursor’s hook system, see Cursor (tracing).
Setup
Open the model settings
Open Cursor Settings (Cmd+, on macOS, Ctrl+, on Windows and Linux) and select Models in the sidebar.
Point Cursor at the Respan gateway
- Under OpenAI API Key, paste
YOUR_RESPAN_API_KEY. - Enable Override OpenAI Base URL and enter
https://api.respan.ai/api/v1. - 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.
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.
See the full model list.