DeepSeek released DeepSeek-V4.1-Flash-1017 (often shortened to “1017”) on 17 October 2026 as a minor update to V4.1 Flash. The API model name stays deepseek-flash, and DeepSeek says the calling method and prices are unchanged (DeepSeek API changelog, 2026-10-17).
DeepSeek exposes an Anthropic-compatible endpoint, so you can point Claude Code at it with a few environment variables. This guide covers that setup, how the bill is calculated, and the settings that have the biggest effect on cost.
Summary
- Model name:
deepseek-flash. It is currently served by DeepSeek-V4.1-Flash-1017. - Set every model variable. If you only change
ANTHROPIC_BASE_URLand the key, DeepSeek maps anyclaude-opus-*request todeepseek-v4-proand bills it at V4 Pro rates. - The biggest cost levers are cache hits and timing. A cache-hit input token costs 1/50 of a cache-miss token, and off-peak rates are half of peak rates.
- From 00:00 Beijing time on 1 November 2026 (16:00 UTC, 31 October), web searches that Claude Code triggers through DeepSeek are billed per request.
- Harness choice changes the result. In one third-party benchmark, the same model scored between 37.6 and 42.7 out of 105 depending on the agent harness, at $0.83–$1.84 per run.
Disclaimer. Prices, model names and configuration below were checked against the official DeepSeek API docs and Anthropic’s Claude Code docs on 29 October 2026. Providers change prices and behavior; always confirm on the official pages before relying on them. This article is independent and not affiliated with, sponsored by, or endorsed by DeepSeek or Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic; “DeepSeek” is a trademark of its owner; other names belong to their respective owners and are used here only to identify the products. Benchmark numbers are third-party results that I have not independently reproduced. Nothing here is financial, legal, or procurement advice.
1. What 1017 is
- Name and date:
DeepSeek-V4.1-Flash-1017, released 17 October 2026. DeepSeek’s web app, mobile app and API switched to it at the same time (changelog). - Weights: published on Hugging Face under the MIT License. Hugging Face lists the model size as about 763B parameters, so local inference needs very large hardware.
- Context: 1M tokens; maximum output 384K tokens (Models & Pricing).
- Vendor-reported benchmarks (vs. the previous V4.1 Flash): Terminal-Bench 4.0 rose from 31.2 to 42.3, and DeepSWE v1.1 from 74.2 to 77.0. DeepSeek notes that Terminal-Bench 4.0 was run in the Claude Code harness and DeepSWE in the Mini-SWE-V2 harness (model card).
- Stated focus: shorter task times and outputs, with specific tuning for DeepSeek Harness (DSH), Tencent CodeBuddy and WorkBuddy. DeepSeek recommends DSH 0.2.1-rc.1 or later.
2. Before you connect: terms, data and support
Read this section before you send any code to a new provider.
- Your code leaves your machine. When Claude Code uses DeepSeek’s endpoint, your prompts, the files the agent reads, tool output and command output are sent to DeepSeek’s API instead of Anthropic’s. Treat that the same way you would treat any new third-party processor.
- Data location. DeepSeek’s privacy policy (last updated 10 February 2026) says it stores the information it collects on servers in the People’s Republic of China (privacy policy). Review the policy and the DeepSeek Open Platform terms for how API inputs are retained or used, and whether that fits your obligations (for example GDPR, customer contracts, or export-control and data-residency rules).
- Enterprise users: check with your security, legal or procurement team before routing company or client code to any external model API. Many organizations keep an approved-vendor list, and some require a data processing agreement first. If you need the data to stay in a specific region, the open weights also allow self-hosting or using a hosting provider in a region you choose. That is a separate setup not covered here.
- Support boundary. Anthropic’s documentation says it does not endorse, maintain or audit third-party gateways and does not support routing Claude Code to non-Claude models (Claude Code LLM gateway docs). The DeepSeek configuration below is documented by DeepSeek, not Anthropic. If something breaks, Anthropic support is unlikely to help.
- Terms of service. You are responsible for complying with the terms of every service involved, including Claude Code’s and DeepSeek’s.
- Secrets. Never commit an API key. Keep it in your shell profile, a secrets manager, or your user-level
~/.claude/settings.json, not in a project’s shared.claude/settings.json.
3. Setup: Claude Code with deepseek-flash
Step 1: Install Claude Code
Skip this step if Claude Code is already installed. Anthropic’s current setup docs recommend the native installer:
curl -fsSL https://claude.ai/install.sh | bash
claude --version
The npm package also works. Note that Anthropic now lists Node.js 22 or later for it; DeepSeek’s page still says 18+, which is out of date:
npm install -g @anthropic-ai/claude-code
Step 2: Set the environment variables (macOS / Linux)
Create an API key on the DeepSeek Platform. The block below matches DeepSeek’s Integrate with Claude Code page as of 29 October 2026:
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API key>
export ANTHROPIC_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
export CLAUDE_CODE_EFFORT_LEVEL=max
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=786432
Then start Claude Code in your project:
cd /path/to/my-project
claude
On Windows PowerShell, write each line as $env:NAME="value"; DeepSeek’s page has the full version.
What each variable does, per Anthropic’s environment variable reference:
| Variable | What it does |
|---|---|
ANTHROPIC_BASE_URL |
Sends API requests to DeepSeek’s Anthropic-compatible endpoint |
ANTHROPIC_AUTH_TOKEN |
Sent as Authorization: Bearer <value>; this is your DeepSeek key |
ANTHROPIC_MODEL |
The main session model |
ANTHROPIC_DEFAULT_OPUS_MODEL / _SONNET_ / _HAIKU_ |
What the opus, sonnet and haiku aliases resolve to. The Haiku slot is also used for background tasks. [1m] asks Claude Code to use a 1M-token context window |
CLAUDE_CODE_SUBAGENT_MODEL |
Default model for subagents that are not assigned one another way |
CLAUDE_CODE_EFFORT_LEVEL |
Effort level. It overrides /effort and --effort, so change or unset it if you want to adjust effort per session |
CLAUDE_CODE_AUTO_COMPACT_WINDOW |
Compacts the conversation at about 768K tokens instead of waiting for the full 1M (accepted range: 100,000–1,000,000) |
To avoid re-exporting every time, put the same keys in the "env" block of your user-level ~/.claude/settings.json, which the CLI and the IDE extensions both read (settings docs). DeepSeek’s awesome-deepseek-agent example uses this approach, but it still lists the older deepseek-v4-pro / deepseek-v4-flash names. Replace them with deepseek-flash if you want 1017.
Optional, for privacy-conscious setups: Anthropic documents CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1, which turns off auto-updates, telemetry, error reporting and other non-essential traffic. DeepSeek’s sample settings file includes it.
Step 3: Test the key with curl first
This is DeepSeek’s own first-call example:
curl https://api.deepseek.com/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
-d '{
"model": "deepseek-flash",
"messages": [{"role": "user", "content": "Hello!"}],
"thinking": {"type": "enabled"},
"reasoning_effort": "high",
"stream": false
}'
The usage object in the response includes prompt_cache_hit_tokens and prompt_cache_miss_tokens. You will use these to check your cache hit rate in section 5.
4. The billing gotcha: claude-opus-* maps to V4 Pro
DeepSeek’s Claude Code page states:
Models starting with claude-opus are mapped to
deepseek-v4-pro. Models starting with claude-haiku or claude-sonnet are mapped todeepseek-flash. The claude-opus mapping points todeepseek-v4-pro, which is billed at the V4 Pro price.
So if you set only ANTHROPIC_BASE_URL and the key, and Claude Code sends an Opus model name, you are running V4 Pro, not 1017, and paying V4 Pro rates. Official rates per 1M tokens on 29 October 2026 (Models & Pricing):
| Per 1M tokens (off-peak / peak) | deepseek-flash (1017) |
deepseek-v4-pro |
|---|---|---|
| Input, cache hit | $0.003 / $0.006 | $0.022 / $0.044 |
| Input, cache miss | $0.15 / $0.30 | $0.66 / $1.32 |
| Output | $0.60 / $1.20 | $1.98 / $3.96 |
That is roughly 4.4× the Flash rate for cache-miss input and 3.3× for output. In the third-party Bug Hunt Bench, V4 Pro in Claude Code at max effort also scored lower: 16/105 (a single run) vs. 39.1/105 for 1017 (mean of 7 runs) (Bug Hunt Bench, README updated 27 Oct 2026).
How to check: open the usage details in the DeepSeek Platform and confirm which model is billed: deepseek-flash or deepseek-v4-pro.

5. What 1017 costs, and four settings that move the bill
Official price list (USD, 29 October 2026)
| Item | Off-peak | Peak |
|---|---|---|
| Input, cache hit | $0.003 / 1M tokens | $0.006 / 1M tokens |
| Input, cache miss | $0.15 / 1M tokens | $0.30 / 1M tokens |
| Output | $0.60 / 1M tokens | $1.20 / 1M tokens |
| Search API | $0.75 / 1,000 successful requests | same |
| Fetch API | $0.75 / 1,000 successful requests | same |
Peak hours are 01:00–04:00 and 06:00–10:00 UTC, Monday to Friday, excluding Chinese public holidays. That is 09:00–12:00 and 14:00–18:00 in Beijing / Singapore time (UTC+8). Everything else is off-peak, including weekends. Source: Models & Pricing. DeepSeek states that prices may change.
Setting 1: Keep the cache warm
DeepSeek’s disk cache is on by default and matches on prefixes: a request only gets a cache hit if it fully matches a prefix unit that has already been stored (Context Caching). A coding agent resends the system prompt, tool definitions and conversation history every turn, so it is a good fit. Things that break the prefix:
- changing the system prompt, the MCP tool list, or
CLAUDE.mdin the middle of a session; - frequent
/clear, or switching back and forth between sessions; - long gaps. The cache is best-effort and is usually cleared within a few hours to a few days, so resuming a session the next day may not hit.
A hypothetical example (10M input tokens and 200K output tokens in one session, off-peak):
| Cache hit rate | Input | Output | Total |
|---|---|---|---|
| 90% | 9M × $0.003 + 1M × $0.15 ≈ $0.18 | $0.12 | ≈ $0.30 |
| 0% | 10M × $0.15 = $1.50 | $0.12 | ≈ $1.62 |
Same work, about 5× apart. At peak rates, double both rows. For comparison, the same 90%-hit session billed at V4 Pro off-peak rates (the mapping mistake in section 4) would be about $1.25.

Setting 2: Run batch work off-peak
Off-peak prices are half of peak. Non-urgent jobs such as bulk bug fixing, test runs and repository scans are cheaper outside 09:00–12:00 and 14:00–18:00 UTC+8 on weekdays.
Setting 3: Match effort to the task
DeepSeek has three real effort levels: low, high and max. Other values are mapped: minimal → low, medium and xhigh → high, ultra → max (Thinking Mode). DeepSeek’s guidance is low for simple tasks, high for everyday agent work, and max for complex tasks.
Bug Hunt Bench results for 1017 in Claude Code:
| Effort | Fixed / 105 | Cost per run (API bill) | Runs |
|---|---|---|---|
| max | 39.1 | $1.01 | 7 |
| high | 36.4 | $0.82 | 5 |
| low | 34.4 | $0.71 | 5 |
Moving from low to max fixed 4.7 more bugs for about 42% more cost in this test. Remember that CLAUDE_CODE_EFFORT_LEVEL overrides /effort, so edit or unset the variable to change it.
Setting 4: Decide how web search should behave after 1 November
DeepSeek supports Claude Code’s Web Search tool: when the model decides it needs to search, the search runs through DeepSeek’s Search API. According to DeepSeek’s pricing page, these server-side calls are free until 00:00 Beijing time on 1 November 2026, then billed at $0.75 per 1,000 successful Search requests and $0.75 per 1,000 Fetch requests. Summarizing the results also uses model tokens.
A hypothetical heavy user making 300 searches and 300 fetches a day would pay about 18,000 × $0.75 / 1,000 ≈ $13.50 per month in search fees alone, before tokens. If you want a prompt before each search, set WebSearch and WebFetch to ask in Claude Code’s permission rules (permissions docs).
6. Same model, different harness: third-party data
The table below comes from Paweł Huryn’s Bug Hunt Bench. It plants 105 real bugs in two production codebases, gives the agent one round per repository to find and fix them, and grades the diffs blind. The rows below are means of 5–7 runs dated 17–18 October 2026; cost is the actual DeepSeek API bill as reported by the author (README updated 27 October 2026).
| Harness (1017, max effort) | Fixed / 105 | Cost per run | Wall time | Runs |
|---|---|---|---|---|
| DeepSeek Harness (DSH) | 42.7 | $1.84 | 62 min | 7 |
| Pi | 42.2 | $0.83 | 54 min | 5 |
| Claude Code | 39.1 | $1.01 | 58 min | 7 |
| OpenCode | 37.6 | $0.96 | 56 min | 5 |
| Reference: previous V4.1 Flash + Claude Code | 21.7 | $0.78 | 56 min | 3 |

Third-party data, not independently reproduced.
How to read it:
- DSH had the highest mean score and the highest bill (about 80% more than Claude Code).
- Pi scored close to DSH at less than half of DSH’s cost in this test.
- Claude Code was 3.6 points below DSH at about 45% lower cost. If you already use Claude Code, it means changing only the backend, not your workflow.
- 1017 improved substantially over the previous V4.1 Flash in the same harness and effort level (21.7 → 39.1).
- Single runs vary. The benchmark averages repeated runs for a reason; do not draw conclusions from one or two of your own runs.
Scores from different benchmarks, or the same benchmark in different harnesses, are not directly comparable. Compare harnesses only within one test.
7. Not using Claude Code? Codex and DSH
Codex: DeepSeek provides a setup script. Make sure Codex has been launched at least once so ~/.codex exists. The script backs up ~/.codex/config.toml to ~/.codex/backup-deepseek/; menu option 1 configures deepseek-flash, option 2 deepseek-v4-pro, and option 9 restores your previous setup (Integrate with Codex). As with any script piped from the internet, read it before running it:
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh)
Codex’s built-in web search works only with deepseek-v4-pro, so the script sets web_search = "disabled" for deepseek-flash.
DSH: select deepseek-flash as the model and use version 0.2.1-rc.1 or later, as DeepSeek recommends. See DeepSeek’s DeepSeek Harness guide in the API docs for installation.
8. FAQ
What is the model name for 1017? deepseek-flash on the DeepSeek API. The legacy name deepseek-v4-flash is still accepted, but it is also served by 1017 and billed at the Flash price. Third-party platforms use their own model IDs.
Did the price change with 1017? No. DeepSeek’s changelog says the calling method and prices are unchanged.
Can I run 1017 locally? The weights are open (MIT), but the model is about 763B parameters according to Hugging Face, so it needs very large memory. For a typical development machine, the API is the practical route.
Why does it sometimes think for a long time? The documented Claude Code setup uses max effort. For small edits, set CLAUDE_CODE_EFFORT_LEVEL to high or low (see Setting 3).
Is this setup supported by Anthropic? No. Anthropic’s docs say it does not support routing Claude Code to non-Claude models. The configuration is DeepSeek’s.
Takeaways
If you already use Claude Code, the practical checklist is short: set every model variable, confirm in the usage dashboard that you are billed for deepseek-flash, avoid breaking the prompt cache, and decide how web search should behave before 1 November. Before any of that, confirm that sending your code to this provider is acceptable for you or your organization.
Benchmarks are a starting point. Before you switch, run 10–20 of your own real tasks and compare completion rate and cost.
References
All accessed 29 October 2026.
- DeepSeek API changelog (2026-10-17: DeepSeek-V4.1-Flash-1017; Search API) (in Chinese)
- DeepSeek API: Models & Pricing
- DeepSeek API: Integrate with Claude Code
- DeepSeek API: Integrate with Codex
- DeepSeek API: Context Caching
- DeepSeek API: Thinking Mode
- DeepSeek privacy policy (last updated 10 February 2026)
- deepseek-ai/DeepSeek-V4.1-Flash-1017 on Hugging Face
- Claude Code docs: Environment variables, Settings, Setup, LLM gateway
- phuryn/bug-hunt-bench on GitHub (README updated 27 October 2026)
This post is an English adaptation of the Chinese original: DeepSeek V4.1 Flash 1017 接入 Claude Code:配置、价格与 4 个省钱设置. The English version uses USD prices and adds the terms, data and support notes in section 2.
Comments