# Cursor

> Use Deference models in Cursor through its OpenAI key override. In beta.

Cursor can send chat requests to an OpenAI-compatible base URL. This integration is in beta: Cursor's tool-call format and its handling of custom models change between releases.

## Set up

1. Create a key in [API keys](https://deference.si/keys).
2. In Cursor, open **Settings**, then **Models**.
3. Under **API Keys**, turn on **OpenAI API Key** and paste your `sk-df-...` key.
4. Turn on **Override OpenAI Base URL** and enter `https://deference.si/v1`.
5. Select **Add model** and enter an exact id from the [Models](https://deference.si/models) page, for example `anthropic/claude-sonnet-5.5`.
6. Pick the model in the chat model picker.

Cursor reads the key from this screen only. There is no environment variable or file for it.

## Verify

Open a chat in Ask mode, pick the model you added and send a prompt. Then open [Activity](https://deference.si/activity). The request is the top row, with the endpoint Chat completions and the model you added.

## Know the limits

* Requests go through Cursor's servers, so the base URL must be public. `https://deference.si/v1` is. A local or private address fails.
* Tab completion never uses your key.
* Cursor's zero data retention setting does not apply to requests sent with your own key.
* The override is global. While it is on, Cursor can send its own OpenAI models to Deference too, and they fail there. Turn the override off to use Cursor's models.
* Ask mode is the most reliable. Agent mode sends tool definitions and Responses-style payloads that depend on the model and the Cursor version, so try another model if tool calls fail.

## Troubleshooting

| You see                                                  | Cause                                            | Fix                                                                                                         |
| -------------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| No **Override OpenAI Base URL** toggle                   | Cursor does not show it on every plan or version | Update Cursor and check your plan                                                                           |
| Cursor rejects the model name                            | The id differs from the catalog                  | Copy the id from the Models page                                                                            |
| `401 invalid_api_key`                                    | The key field holds extra characters             | Paste the key again                                                                                         |
| Agent mode fails on tool calls, or returns a blank error | Cursor's Agent payload does not suit the model   | Use Ask mode, pick another model, or set **Settings**, **Network**, **HTTP Compatibility Mode** to HTTP/1.1 |
| A Cursor model says it is not available                  | The override captures Cursor's own OpenAI models | Turn off **Override OpenAI Base URL**                                                                       |
| The override does not apply                              | The toggle is off                                | Turn on **Override OpenAI Base URL**                                                                        |
| `402 insufficient_credit`                                | No available credit                              | [Add credit](https://deference.si/wallet?tab=add)                                                                               |
