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

# Cursor (gateway)

> Set up Cursor with the Respan gateway.

Route [Cursor](https://cursor.com)'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)](/docs/integrations/cursor).

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

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.

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

> **Note**
>
> 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.

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

See the [full model list](https://platform.respan.ai/platform/models).