AI agents · OpenClaw · self-hosting · automation

Quick Answer

How to Use DeepSeek V4 in Cursor: Setup Guide (2026)

Published:

How to Use DeepSeek V4 in Cursor: Setup Guide (2026)

DeepSeek V4 launched April 24, 2026 with frontier-class coding benchmarks at a fraction of the cost. Cursor users can now wire it in directly. This is the practical setup guide as of April 26, 2026.

Last verified: April 26, 2026

Why bother

TaskClaude Opus 4.7DeepSeek V4-Pro
Cost per million input$15$1.74
Cost per million output$75$3.48
SWE-bench Verified80.8%80.6%
Terminal-Bench 2.065.4%67.9%
LiveCodeBench88.8%93.5%
Open weights

You’re trading roughly 0.2 SWE-bench points for a 22× input price reduction. Even using V4-Pro for everything, a heavy Cursor day costs cents instead of dollars.

Two paths to set this up

Path A: Direct DeepSeek API (cheapest)

Best if you want the lowest possible price and you’re OK managing one more API key.

  1. Get an API key from api-docs.deepseek.com — sign up, top up $5
  2. Open Cursor → Settings (Cmd/Ctrl + ,) → Models
  3. Scroll to OpenAI API Key section and toggle Override OpenAI Base URL
  4. Set Base URL: https://api.deepseek.com/v1
  5. Paste your DeepSeek API key into the OpenAI API Key field
  6. Click Add Model and add:
    • deepseek-v4-pro (or current Pro identifier from DeepSeek docs)
    • deepseek-v4-flash
  7. Verify — Cursor will ping the endpoint
  8. Toggle the new models on in the model picker

The catch: this routes through Cursor’s OpenAI-compatible path, so you can’t simultaneously use the Cursor-hosted models. If you want both, use Path B.

Path B: Via OpenRouter (cleanest if you mix providers)

Best if you already use OpenRouter or want to keep Cursor’s hosted models alongside DeepSeek.

  1. Get an OpenRouter API key at openrouter.ai
  2. Top up your OpenRouter balance
  3. Cursor → Settings → Models
  4. Base URL: https://openrouter.ai/api/v1
  5. API Key: your OpenRouter key
  6. Add models:
    • deepseek/deepseek-v4-pro
    • deepseek/deepseek-v4-flash
  7. Verify and toggle on

OpenRouter adds a small markup (typically 5%) but gives you instant access to DeepSeek, Kimi K2.6, GLM 5.1, Llama 5, and more — all behind one key.

Configure model per surface

Cursor lets you pick different models per use case. Recommended setup post-V4:

SurfaceRecommended modelWhy
Tab autocompleteDeepSeek V4-FlashLow latency, near-zero cost
Cmd-K inline editDeepSeek V4-FlashFast iteration, cheap
ChatDeepSeek V4-ProBest quality at 22× cost reduction
Composer (agent mode)DeepSeek V4-Pro or Claude Opus 4.7Pick by task — V4 for code-heavy, Claude for cross-file reasoning
Bug fix runsClaude Opus 4.7Slight SWE-bench lead, better at multi-file diff coherence

Set per-surface model in Cursor → Settings → Models → Default Models dropdowns.

Cost in practice

A real heavy-Cursor day from a working developer (rough numbers, your mileage will vary):

  • ~150 chat exchanges (avg 1K input / 2K output)
  • ~30 Composer runs (avg 10K input / 5K output)
  • ~3000 tab autocompletes (avg 500 input / 100 output)

On Claude Opus 4.7:

  • Chat: 0.15M in × $15 + 0.3M out × $75 = $24.75
  • Composer: 0.3M in × $15 + 0.15M out × $75 = $15.75
  • Tab: not typically Opus
  • ~$40+/day

On DeepSeek V4-Pro:

  • Chat: 0.15M × $1.74 + 0.3M × $3.48 = $1.30
  • Composer: 0.3M × $1.74 + 0.15M × $3.48 = $1.04
  • Tab on V4-Flash: nearly free
  • ~$2.50/day

That’s a 16× cost reduction on a typical workload.

Latency notes

  • DeepSeek V4-Flash is the fastest tier (sub-second time-to-first-token from EU/US)
  • V4-Pro is comparable to Claude Sonnet 4.7 on latency
  • Routing through OpenRouter adds 30–80ms of overhead
  • Tab autocomplete on V4-Flash feels at least as snappy as Cursor-hosted models

Quality tips

  1. Composer agent mode with V4-Pro shines on backend code, scripts, refactors, and tests. It’s slightly less polished than Claude on multi-file frontend refactors with subtle stylistic decisions.
  2. Long context (>200K tokens) — V4-Pro holds up well to ~500K tokens. Above that, latency and cost scale linearly. Use a chunking + summarize pass for repos >1M tokens.
  3. Diff quality is excellent — V4 is trained heavily on code patches, so its diff -u-style output is reliable in Composer.
  4. Tool use in Composer agent mode is solid in V4-Pro. V4-Flash’s tool-use reliability is noticeably worse — keep Flash for completion-only tasks.

Common gotchas

  • Cursor’s “Privacy Mode” — when enabled, custom endpoints are still used, but Cursor won’t store prompts. Verify in Settings → Privacy.
  • Rate limits on free DeepSeek tier — top up the API account; the free tier hits 429s under Cursor load.
  • Token counter mismatch — DeepSeek’s tokenizer differs from OpenAI’s. Cursor’s in-app cost estimates may be off by ±10%; trust your DeepSeek dashboard.
  • Region selection — DeepSeek’s API serves from China and Singapore primarily. EU/US latency is fine but for the absolute lowest, use OpenRouter (which load-balances across providers like Together, Fireworks, DeepInfra).

When to keep Claude or GPT-5.5 around

DeepSeek V4 is now the right default. But keep at least one of these on hand:

  • Claude Opus 4.7 — best for autonomous overnight Composer runs and cross-file refactors with subtle style requirements
  • GPT-5.5 — best for non-coding research questions, Browse-style tasks, multimodal
  • Sonnet 4.7 as a quality floor — when V4 produces something weird, a Sonnet rerun usually catches it

A common pattern: 70% V4 / 25% Claude Opus 4.7 / 5% GPT-5.5 — saves ~80% on monthly Cursor spend with no quality regression.

Quick sanity test

After setup, ask DeepSeek V4-Pro in Cursor:

Refactor this function to be O(n log n) instead of O(n²). 
Show the diff and explain the change.

You should get back a tight diff, a complexity analysis, and a suggested test in under 10 seconds. If you do, you’re set.


Last verified: April 26, 2026. Sources: api-docs.deepseek.com (DeepSeek V4 launch April 24, 2026), DeepSeek V4-Pro pricing page, Cursor official docs (cursor.com/docs), OpenRouter pricing dashboard, public benchmark posts (Terminal-Bench, SWE-bench Verified leaderboards).