# Cursor

> Point Cursor's custom OpenAI base URL at this gateway and use 103 text models in Cursor Chat

来源：https://zhonkemodel.dflop.top/en/docs/integrations/cursor

> Cursor supports a custom OpenAI API under Settings → Models.

## Setup

1. Open Cursor → ⚙️ **Settings** → **Models**
2. Scroll to the bottom → the **OpenAI API Key** section
3. Tick **Override OpenAI Base URL**
4. Fill in:
   - Base URL: `https://zhonkezhonkeapi.dflop.top/v1`
   - API Key: `sk-gpushare-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` (`sk-gpushare-` plus 64 hex characters, 76 in total)
5. In the model list above, **Add Model** and enter the model IDs you want, for example:
   - `claude-sonnet-4-6`
   - `gpt-5.5`
   - `glm-5.1`
   - `gemini-2.5-pro`
   - Full list: [Models](../reference/models.md)
6. **Untick Cursor's built-in OpenAI models** (`gpt-4o`, `gpt-4o-mini` and friends) — they aren't in our catalog, and leaving them on makes the next step fail
7. Click **Verify** to confirm the connection

> **Why add models before verifying?** Cursor's Verify sends a test request using whichever models are currently enabled. If the built-in `gpt-4o` is still ticked, the gateway returns `model_not_found` — and Verify fails even though your base URL and key are both correct.

## What actually goes through the gateway

Cursor speaks the **OpenAI Chat protocol**, so the available models are every text model returned by `GET /v1/models` (101, and the list moves). See the [compatibility matrix](../reference/compatibility-matrix.md) and [Models](../reference/models.md). Image, video and embedding models use separate endpoints and don't go through this protocol — see [Image / video / music APIs](../reference/media-apis.md).

## Things to know

### Composer, Agent and Tab autocomplete use Cursor's own service

- **Cursor Chat** — ✅ uses the custom base URL you configured (this platform)
- **Composer (Cmd+I)** — ❌ goes to Cursor's own service, not through this gateway
- **Tab autocomplete** — ❌ same
- **Agent (Cmd+Shift+I)** — ❌ same

There is currently **no official way** to route all of Cursor through this gateway; Cursor ties those features to its subscription.

### Suggested split

| Situation | Use |
|---|---|
| Long conversations / complex tasks | Cursor Chat (through this gateway, with Claude or GPT-5.x) |
| Short completions / inline edits | Cursor's native features (included in the subscription) |
| Full AI coding through this gateway | [FlopCode](./flopcode.md) or [Cline](./cline.md) |

## Troubleshooting

| Symptom | What to check |
|---|---|
| Verify fails but the URL and key are right | Cursor's built-in OpenAI models (`gpt-4o` etc.) aren't in our catalog, so the gateway returns `model_not_found`. Turn them off, leave only the model IDs you added, then verify again |
| Verify fails, no connection | Base URL spelling — `/v1` is required |
| Model missing from the dropdown | You must **Add Model** with the model ID first |
| `401` (`invalid_api_key`) | Key invalid, revoked or expired. Check you copied the whole thing (`sk-gpushare-` plus 64 hex characters); the full key can be re-revealed any time on its [console detail page](https://zhonkezhonkemodel.dflop.top/dashboard/keys) |
| `400` (`model_not_allowed`) | This key has an `allowed_models` allowlist that excludes the model → edit it in the [console](https://zhonkezhonkemodel.dflop.top/dashboard/keys) or use an unrestricted key |
| `402` (`insufficient_quota`, code `quota_exceeded`) | Account balance exhausted. Every key shares one balance, so a new key won't help → top up at dflop.top/dashboard/billing (Stripe, $1 minimum) |

Full error reference: [Error handling](../reference/errors.md).

## Other clients

- [Claude Code](./claude-code.md) — AI coding on the command line
- [Cline (VS Code)](./cline.md) — fully custom base URL
- [Continue.dev](./continue.md) — VS Code / JetBrains
- [Open WebUI](./open-webui.md) — self-hosted ChatGPT UI
- [FlopCode](./flopcode.md) — this platform's official fork
