# Cursor setup

Cursor can send its chat, agent and inline-edit requests to any OpenAI-compatible API. This guide connects it to Claudech. It takes about two minutes.

## Before you start

- **A paid Cursor plan.** Cursor accepts custom API keys and custom models only on its paid plans. On Free or Hobby, Cursor rejects the key on its own servers and the request never reaches Claudech.
- **A Claudech API key.** Create one under [API keys](https://claudech.com/api-keys). API access unlocks after your first purchase; any token package is enough.
- **The model ids you want.** They are listed on [Models](https://claudech.com/docs/models) and returned by `GET /v1/models`.

## 1. Check the key works

Run this once before touching Cursor. If it returns a reply, the key and balance are fine and any later error is a Cursor setting.

**curl**

```bash
curl https://api.claudech.com/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-opus-5-5", "messages": [{"role": "user", "content": "Say hello"}]}'
```

**PowerShell**

```powershell
$headers = @{ Authorization = "Bearer sk-..."; "Content-Type" = "application/json" }
$body = '{"model": "claude-opus-5-5", "messages": [{"role": "user", "content": "Say hello"}]}'
(Invoke-RestMethod -Method Post -Uri "https://api.claudech.com/v1/chat/completions" -Headers $headers -Body $body).choices[0].message.content
```

## 2. Enter the key and base URL

1. Open **Cursor Settings → Models**.
2. Under **OpenAI API Key**, paste your Claudech `sk-...` key into the **API Key** field.
3. Switch on **Override OpenAI Base URL** and enter exactly `https://api.claudech.com/v1`: with `/v1`, without a trailing slash, nothing after it.

## 3. Add the model ids

Cursor does not read the Claudech model list by itself, so add each model you want:

1. Scroll to the model list and type a Claudech model id in its search box, for example `claude-opus-5-5`.
2. Click **Add Custom Model**.
3. Repeat for any others: `claude-fable-5-1`, `claude-opus-5`, `claude-sonnet-5`.

The name must be exactly the Claudech model id and must not match one of Cursor's built-in models.

```text
Base URL : https://api.claudech.com/v1
API key  : sk-...
Models   : claude-opus-5-5, claude-fable-5-1, claude-opus-5, claude-sonnet-5
```

## 4. Send a first message

Current Cursor versions have no Verify button; the key is checked on the first request. Open **Chat**, pick the Claudech model in the model picker and send a message. The request then appears on your [Usage](https://claudech.com/usage) page with its tokens and cost.

## What runs on Claudech

| Cursor feature | Served by |
| --- | --- |
| Chat with a Claudech model selected | Claudech |
| Agent mode, tool calls and multi-step edits | Claudech |
| Inline edits | Claudech |
| Tab completions | Cursor |
| Auto (Cursor's model router) | Cursor |
| Background agents | Cursor |

Cursor calls the API from its own servers, so the base URL must be publicly reachable; a local proxy will not work. While the override is on, Cursor sends *every* OpenAI-format request to Claudech, including requests for Cursor's built-in OpenAI model names, which are served by your default Claudech model. Turn the override off to use Cursor's own models again.

## Troubleshooting

| Symptom | Cause | Fix |
| --- | --- | --- |
| "Invalid API key. Unauthorized User API key" and nothing on your Claudech Usage page | Cursor refused the request before contacting Claudech: a Free/Hobby Cursor plan, a model name that collides with a Cursor built-in, or a base URL that was not saved | Check your Cursor plan, re-enter the base URL, save, restart Cursor and start a new chat. If step 1 above works, Claudech is fine |
| **Add Custom Model** does nothing | The name matches one of Cursor's built-in models | Use the Claudech model id exactly, not a vendor model name |
| "Verification failed" or 401 on the first message | Trailing slash, missing `/v1`, or a space copied with the key | Use exactly `https://api.claudech.com/v1`; re-copy the key |
| `402 insufficient_balance` | Your balance is empty | Top up under [Billing](https://claudech.com/billing) |
| Response says a different model ran | Cursor asked for one of its own model names | Select the Claudech model id in the picker; the `x-claud-model` response header names the model that ran |
| Long agent replies stop early | Cursor's timeout is shorter than the response | Ask for smaller steps, or use a faster model such as `claude-sonnet-5` |

More tools, including Cline, Continue, Zed and Aider, are on [Other tools](https://claudech.com/docs/integrations). For Claude Code, see [Claude Code setup](https://claudech.com/docs/integrations/claude-code).

Claudech is an independent service and is not affiliated with Anysphere, the maker of Cursor.

---

Source: https://claudech.com/docs/integrations/cursor
