# Use Xantly with Cursor (chat-only BYOK, with caveats)

If you're committed to staying in Cursor and want to route its **chat panel** through Xantly, this is the real-world guide, including the known bugs and which features won't work. If you're willing to switch editors for full BYOK, see [Migrate from Cursor](/docs/migrate-from-cursor) instead.

## The scope of Cursor's BYOK

Cursor's BYOK setting affects **only** the chat panel. It does **not** reach:

- **Agent mode**: uses Cursor's proprietary fine-tuned models, billed to Cursor.
- **Cmd+K inline edit**: same, proprietary models.
- **Cursor Tab**: proprietary custom autocomplete.
- **Composer**: proprietary.
- **Bug Finder**: proprietary.

Cursor's own error text on the setting reads: *"Agent and Edit rely on custom models that cannot be billed to an API key."*

So you're paying Cursor Pro ($20/mo) for the features you actually use, and BYOK only helps you on the chat panel. Still useful if you chat a lot, but know the boundary.

## Prerequisites

- Cursor installed
- A Xantly API key, [create one](/dashboard/api-keys)

## Setup

1. Open Cursor → **Settings** → **Models**.
2. Scroll to **OpenAI API Key** section.
3. Toggle **Custom API Key** on.
4. Fill:

| Field | Value |
|---|---|
| OpenAI API Key | `xantly_sk_...` |
| Base URL | `https://api.xantly.com/v1` |

5. Click **Verify**: Cursor pings `/v1/models`.
6. Under **Chat Model**, select a Xantly-catalog model (e.g. `xantly/auto-quality`).

## ⚠️ The base-URL override bug

There's a long-standing Cursor bug: after setting a custom base URL, **Cursor's internal model router sometimes refuses to use any model** until you toggle the Custom API Key off and on again.

Thread: [forum.cursor.com, "Cannot use any models if OpenAI base URL overridden"](https://forum.cursor.com/t/cannot-use-any-models-if-openai-base-url-overridden/140266)

It's intermittent, no fix timeline from the Cursor team. Workarounds:

- Toggle Custom API Key **off**, then **on**, then **Verify** again.
- Restart Cursor after changing the base URL.
- Remove your OpenAI-provider API key from the non-BYOK field; sometimes Cursor tries both and gets confused.

If you hit this regularly, it's a strong signal to consider [migrating to Cline](/docs/migrate-from-cursor), Cline has no equivalent bug.

## Model choice (chat panel only)

| Model ID | When |
|---|---|
| `xantly/auto-quality` | BaRP picks the best T1 chat model. Recommended. |
| `xantly/auto-value` | Balanced cost. |
| `anthropic/claude-sonnet-4.6` | Pin to Claude. |
| `openai/gpt-5.4` | Pin to GPT. |

## Verify

In the Cursor chat panel:

```
Reply with just the word "pong".
```

Check your Xantly dashboard, the call logs with routed-to model + cost.

## What you get (chat only)

- **Semantic cache on chat prompts**: re-asked questions hit cache.
- **Waterfall fallback** inside the chat model, a 500 from one provider silently falls back.
- **Cost visibility** on chat calls.
- **Memory** via `X-Xantly-Memory-Mode`, if Cursor supports custom headers on BYOK requests (experimental).

## What you don't get

- Agent mode routing, still goes to Cursor's proprietary models.
- Cmd+K edits, still proprietary.
- Cursor Tab, still proprietary.
- **Full Xantly benefits**: these kick in when all requests flow through, which only Cline/Continue/OpenCode/etc. give you.

## Cost math

Cursor Pro: **$20/month flat**, includes 500 fast requests/mo on proprietary agent.

With BYOK:
- You still pay $20/mo for Cursor Pro (agent/edit/tab require it).
- **Chat calls** go through Xantly at a few dollars per month, semantic cache saves ~30%.
- Net: You add $2-5/month to your existing $20/mo.

Compare with Cline + Xantly at **$0 subscription**, $4-8/mo in tokens total. If chat is where you spend most of your AI budget, the math is still with Cursor Pro + BYOK. If you use agent mode heavily, the math flips hard toward Cline.

## Gotchas

**Base URL bug (see above).** Budget time for toggling on/off.

**`/v1` suffix required.**

**Model ID format.** Cursor requires OpenAI-style model IDs (`openai/...`, `anthropic/...`) in its dropdown. The `xantly/auto-*` aliases work.

**"Verify" button fails intermittently.** Often a transient issue. Retry.

**Chat panel context.** Cursor sends aggressive file context with each chat. If you see truncation, set model to `anthropic/claude-sonnet-4.6` (200k context).

## Next steps

- [Migrate from Cursor](/docs/migrate-from-cursor), if BYOK's chat-only limitation frustrates you, the 10-minute move to Cline + Xantly is here.
- [Cline](/docs/use-with-cline), full BYOK everywhere in VS Code.
- [Continue.dev](/docs/use-with-continue-dev), per-role config, also in JetBrains.
- [Cost-Optimized Routing](/docs/cost-optimized-routing), maximize savings on chat calls.
