AIWave API

Cursor + DeepSeek: Configure Chinese AI Models in Cursor

Pointing Cursor at DeepSeek, GLM or Qwen takes about two minutes and one setting: Cursor lets you override the OpenAI base URL, so any OpenAI-compatible endpoint becomes a model provider. This guide walks through the exact configuration, explains which Cursor features keep working and which do not, and does the cost arithmetic on what a full-time developer actually spends.

Get an API key →Compare live pricing →

What this changes and what it does not

Cursor’s custom-model setting routes chat and inline edit requests to your endpoint instead of Cursor’s own backend. That gives you model choice and per-token billing you control. It is worth being precise about the trade-off up front, because a lot of writing on this topic is not:

If tab completion is the feature you value most, a custom endpoint supplements Cursor rather than replacing it. If chat and inline edit are where your time goes, this configuration covers the bulk of your usage.

Step 1: Get an API key

Create a key in the console. Email or GitHub signup is sufficient — no Chinese phone number, no real-name verification, and billing is in USD. That access barrier is the main reason developers outside mainland China route these models through a gateway at all; see accessing Chinese AI models without a Chinese phone number.

Step 2: Open Cursor’s model settings

Go to Settings → Models. You will find an OpenAI API key field and, below the model list, an option to override the base URL.

Base URL:  https://aiwave.live/v1
API Key:   sk-YOUR_KEY

Cursor sends requests to {base_url}/chat/completions, so the /v1 suffix is required. Omitting it is the single most common configuration error and produces a 404 that looks like an authentication problem.

Step 3: Add the model names

Cursor’s model list is fixed unless you add entries. Use Add model and enter the model ID exactly as the endpoint serves it:

deepseek-v4-pro
deepseek-v4-flash
glm-5
qwen3-coder-480b-a35b-instruct
kimi-k2.5

Model IDs are versioned and do change. Rather than trusting a list from a blog post, read the current one from the endpoint:

curl https://aiwave.live/v1/models \
  -H "Authorization: Bearer sk-YOUR_KEY" | jq -r '.data[].id' | sort

The full catalogue is also on the model directory, and the endpoint is documented in the API reference.

Step 4: Verify before you rely on it

Cursor’s verify button confirms the key and base URL. If it fails, check these in order:

  1. Missing /v1 in the base URL. Most common by a wide margin.
  2. Model name not served. Compare against the /v1/models output above; a 404 model_not_found means the ID is wrong, not the key.
  3. Other providers still enabled. Cursor can hold several providers at once; disable the ones you are not using so requests are not silently routed elsewhere.
  4. Key scope. A 401 means the header is wrong; a 403 means the key is valid but lacks access to that model. The distinction is explained in error codes.

You can confirm the endpoint independently of Cursor with a plain curl, which isolates whether the problem is the API or the editor:

curl https://aiwave.live/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -d '{
    "model": "deepseek-v4-pro",
    "messages": [{"role": "user", "content": "Reply with OK"}]
  }'

Step 5: Pick the right model for the task

Editor work splits into two very different workloads, and using one model for both wastes money or quality depending on which you pick.

Current rates for models commonly used in editors:

Model IDInput / 1M tokensOutput / 1M tokens
deepseek-v4-flash$0.206$0.412
deepseek-v4-pro$1.09$2.17
qwen3-coder-480b-a35b-instruct$0.12$0.36
glm-4.7-flashfreefree
glm-5$1.55$4.96
kimi-k2.5$0.66$3.30

Rates read from the AIWave pricing endpoint on 2026-07-26. Check live pricing before budgeting — providers revise rates.

Switch per request from Cursor’s model picker. Because the model is a configuration value, the right habit is to default to cheap and escalate deliberately, rather than paying premium rates for “add a docstring”.

Step 6: Work out what it actually costs you

Editor usage is bursty and easy to underestimate. A reasonable working assumption for a developer using chat and inline edit through the day is on the order of 20M input and 4M output tokens a month — context windows in an editor are large because the file, and often the surrounding files, go into every request.

The arithmetic is (input tokens ÷ 1,000,000) × input price + (output tokens ÷ 1,000,000) × output price. Run your own numbers against the table above rather than trusting a generic estimate; token consumption in an editor varies enormously with how much context you attach. The live pricing page always has current rates.

Two habits reduce the bill more than model choice does. Attach only the files that matter instead of whole directories, and start a new chat when you change task — a long thread resends its entire history on every message.

Cursor rules: making the model behave like your codebase

A .cursorrules file at the repository root gives the model persistent project context. This matters more with a smaller model, which benefits from explicit constraints rather than inferring conventions from surrounding code.

# .cursorrules
- TypeScript strict mode. No `any` without a comment explaining why.
- React function components only. No class components.
- Tests use Vitest, colocated as *.test.ts next to the source file.
- Prefer early returns over nested conditionals.
- Do not add dependencies without asking; this repo pins versions deliberately.
- Error handling: throw typed errors from lib/errors.ts, never bare strings.

Keep it short and specific. Long rule files consume context on every request, which costs money and crowds out the code you actually want the model to read.

Privacy considerations

Routing through a custom endpoint means your code snippets go to that endpoint rather than to Cursor’s backend. That is a change in who processes your source, not a removal of processing. Enable Cursor’s privacy mode if you want to keep code out of Cursor’s own storage, and treat the API provider as you would any third-party service in your supply chain. For regulated codebases, confirm your own compliance requirements before enabling any AI editor, custom endpoint or not.

Common problems and their causes

Verification fails but curl works

Almost always a stale setting: another provider still enabled, or a model name with a typo. Disable unused providers and re-add the model.

Chat works, tab completion does not use my model

Expected. Tab completion runs on Cursor’s proprietary model and is not routed through custom endpoints.

Agent mode behaves erratically

Agent flows lean heavily on tool calling, which is an upstream model capability. If a model handles tools inconsistently, agent mode will be unreliable with it. Check the model page, and see function calling with Chinese AI models for the protocol-level detail.

Occasional 503 errors

The upstream provider is overloaded. Switch to another model in the picker — that is the practical benefit of having several configured. Error codes covers which failures are transient.

Other editors

The same base-URL override works in most AI editor tooling, because they all speak the OpenAI wire format: Cline and Continue in VS Code, Aider on the command line, Zed’s assistant, and JetBrains plugins that accept a custom endpoint. Related walkthroughs: DeepSeek V4 in Cursor, Continue in VS Code, Kilo Code in VS Code and OpenCode on the CLI.

Prompting patterns that work in an editor

Editor prompting is a different discipline from chat prompting. The model already has code in front of it, so the value you add is constraint, not description. Three patterns account for most of the difference between useful and frustrating results.

State the invariant, not the change

“Make this faster” invites the model to rewrite whatever it likes. “Reduce the allocations in this loop without changing the public signature or the error semantics” produces a diff you can actually review. The more precisely you fence the change, the smaller and safer the result.

Give it the failing output

Pasting the stack trace, the failing assertion or the actual versus expected value is worth more than any amount of prose. Models are good at pattern-matching an error to a cause and poor at guessing what went wrong from a description of intent.

Ask for the diff, not the file

Requesting a minimal patch rather than a rewritten file keeps output tokens down, keeps review tractable, and dramatically reduces the chance of the model silently dropping code it did not understand. This matters more with cheaper models, which are likelier to omit sections when regenerating long files.

Bad:   "Refactor this file."
Good:  "Extract the retry logic from lines 40-72 into a helper in lib/retry.ts.
        Keep the existing exponential backoff behaviour. Show only the diff."

Managing context deliberately

Cursor sends what you attach. That is both the feature and the cost driver — every attached file is input tokens on every message in the thread, not just the first.

# .cursorignore
node_modules/
dist/
build/
coverage/
*.lock
**/__snapshots__/
**/fixtures/**

A useful mental model: you are paying for the model to read. Give it the chapter, not the library.

A two-tier workflow that keeps the bill low

Configuring several models is only useful if you actually switch between them. The workflow that works in practice is deliberately boring:

  1. Default to a cheap fast model for everything: renames, docstrings, small extractions, “what does this function do”. This is the majority of editor interactions by volume.
  2. Escalate on failure, not in advance. When the cheap model gets it wrong or produces something you would not merge, re-ask the same question on the stronger model with the same context.
  3. Use the strong model directly for known-hard work — multi-file refactors, concurrency bugs, unfamiliar codebases — where a wrong answer wastes more of your time than the price difference.

The second step is where the saving is. Most teams that adopt a premium model everywhere are paying premium rates for work a cheap model handles indistinguishably. The same principle applied programmatically is covered in building a multi-model router, and the cost side in AI API cost optimisation.

Reviewing AI-written code

The failure mode of a fast editor assistant is not bad code that obviously breaks. It is plausible code that passes review because it looks like the surrounding style.

None of this is specific to Chinese models — it applies to every AI coding assistant. It is worth stating because the speed of a cheap fast model makes it easy to accept changes faster than you can genuinely evaluate them.

Team rollout

If you are moving a team rather than yourself, a few things smooth it considerably.

When a custom endpoint is the wrong choice

Being honest about this matters more than selling the configuration.

Where it clearly wins: you want a specific model Cursor does not offer, you want to control per-token spend, or you need models that would otherwise require a Chinese phone number and a mainland payment method to access.

Frequently asked questions

Can I use DeepSeek in Cursor?

Yes. Set the OpenAI base URL to an OpenAI-compatible endpoint, add your key, and add the DeepSeek model IDs manually. Chat and inline edit then run on DeepSeek.

Does tab autocomplete work with a custom model?

No. Cursor’s tab completion uses its own proprietary model and is not routed through custom endpoints. Chat and inline edit are.

Do I need a Cursor Pro subscription?

Custom API keys work without one, though feature availability varies by Cursor version. You pay the API provider per token either way.

Which model is best for coding in Cursor?

Try a code-specialised model such as the Qwen coder variant and a strong general model such as DeepSeek V4 Pro on your own repository. Editor performance depends heavily on your language and codebase, so a week of real use tells you more than any leaderboard.

Get an API key →Compare live pricing →

Sources

Every claim above traces back to one of these. Pricing figures come from the AIWave pricing endpoint on 2026-07-26; capability claims come from the vendors’ own documentation.