Skip to content

Integrations / Cursor

Use Cursor with your own API key

Use a Yunshu Router key in Cursor for chat with DeepSeek, GLM and Kimi models. Settings, checks, limits of custom keys, and fixes.

Get an API key

Cursor can send chat requests with your own OpenAI-format key. Point that key at Yunshu Router and Cursor’s chat runs on the model you choose, billed per token to your prepaid balance.

What you need

  • A Yunshu Router account with credit on the balance.
  • An API key from the console. Use a separate key for Cursor.

Set it up

  1. Create a key in the console (API keys → Create key) and copy it.

  2. In Cursor, open Cursor Settings → Models.

  3. Under the OpenAI API key, paste your Yunshu Router key.

  4. https://api.yunshurouter.com/v1

    Keep the /v1. Cursor adds /chat/completions after it.

  5. Add a custom model with the model ID, for example deepseek-v4-pro, exactly as it appears on our models page.

  6. Cursor sends a test request with the key.

  7. In the chat panel’s model picker, choose the model you added.

Settings at a glance:

OpenAI API Key:            YOUR_YUNSHU_KEY
Override OpenAI Base URL:  https://api.yunshurouter.com/v1
Add model:                 deepseek-v4-pro   (then Verify)

Check it works

  1. Open a new chat, pick your model and ask a short question.
  2. In the console, open Usage: the request appears under the Cursor key with its model and cost.

If Verify fails, test the key outside Cursor:

curl https://api.yunshurouter.com/v1/models -H "Authorization: Bearer YOUR_YUNSHU_KEY"

A JSON list of models means the key works and the problem is in Cursor’s settings.

Model ID Use it for
deepseek-v4-pro Everyday chat about code at a low price
glm-5.3 Quick questions and edits
kimi-k3 Long questions over many files

Set a budget on the key

In the console, open API keys, pick the Cursor key and set a monthly budget, a model allow-list with the models you added, and a budget alert. A request that would pass the budget is refused with 402 budget_exceeded, so Cursor shows an error instead of spending more.

Known limitations

  • Tab completion never uses your key. Cursor states that Tab always runs on Cursor’s own models.
  • Chat only. Cursor’s help page says own keys work with chat models.
  • Requests go through Cursor’s servers. Cursor builds the final prompt on its backend and sends it to us from there, with your key. Your prompts pass through Cursor, and Cursor’s Zero Data Retention setting does not apply to own-key requests.
  • The override applies to all OpenAI models in Cursor. While it is on, OpenAI model names in Cursor are sent to us too. Turn it off to go back to Cursor’s own OpenAI access.
  • Teams and Enterprise plans add Cursor’s token rate ($0.25 per million tokens) to own-key requests. That charge is Cursor’s, not ours.

Troubleshooting

What you see Likely cause Fix
Verify fails / 401 Key mistyped or revoked Paste the key again; create a new one if you lost it.
404 on every request Base URL without /v1, or with /v1/chat/completions Use exactly https://api.yunshurouter.com/v1.
Model not found The model ID differs from our catalogue Copy the ID from the models page.
403 naming the model Model not on the key’s allow-list Add it in the console.
402 Budget or balance used up Raise the key’s budget or top up.
Tab completions still work but chat fails Expected: Tab doesn’t use your key Fix the chat settings above; Tab is unaffected.
Tool calls or edits fail in Agent mode — Use chat, or switch to a tool listed in integrations that supports custom keys fully (Cline, Roo Code, Kilo Code).

Questions

Does Cursor Tab use my Yunshu Router key?

No. Tab completion always uses Cursor’s own models.

Why does Cursor need my API to be reachable from the internet?

Cursor sends own-key requests from its servers, not from your computer. Our API is public, so this works; a local or private endpoint would not.

Do I still need a Cursor subscription?

Yes. Your own key replaces Cursor’s model billing for chat, not the Cursor plan itself.

Can I use Claude or GPT models through the OpenAI slot?

Not yet. Claude and GPT models can’t be called today.