{"slug": "deepseek-v4-1-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-on", "title": "DeepSeek V4.1 Flash in Claude Code and OpenCode: setup, test runs, and what it costs on four platforms", "summary": "A developer tested DeepSeek's V4.1 Flash 1017 snapshot as the model behind two coding agents, finding it passed a simple file-creation task 3/3 in both Claude Code 2.1.310 (16–27 s per run) and OpenCode 2.1.3 (9–11 s per run). The writeup compares pricing across four providers — DeepSeek's own API at $0.30/$1.20 per million input/output tokens, DeepInfra at $0.14/$0.42 promotional, OpenRouter's cheapest of 33 providers at $0.07/$0.15, and XHuoAPI at $0.24/$0.96 — noting that Claude Code runs sent roughly 32k–55k input tokens each, making input price the dominant cost for agent use.", "body_md": "DeepSeek's newest Flash snapshot (V4.1 Flash 1017) is now what you get behind the `deepseek-flash` model name on DeepSeek's API. I wanted two answers: does it hold up as the model behind a coding agent, and what does it actually cost depending on where you call it?\n\n*Disclosure: I run XHuoAPI, one of the four places compared below. Prices for all four are listed with sources so you can check them yourself.*\n\nI ran the same small task three times in each tool: in an empty folder, \"Create a file hello.py that prints 'hello from xhuo'\", and counted a run as passed only if the file existed with the right content.\n\n| Tool | Version | Passed | \n|---|---|---|\n| Claude Code (Anthropic Messages format) | 2.1.310 | 3 / 3 | \n| OpenCode 2 (OpenAI Chat Completions format) | 2.1.3 | 3 / 3 | \n\nClaude Code runs took 16–27 s; OpenCode 9–11 s. Each Claude Code run sent roughly 32k–55k input tokens, almost all of it Claude Code's own system prompt and tool definitions, so the input price matters more than the output price for agent use.\n\n| Where | Model ID | Input / Output | Notes | \n|---|---|---|---|\n| DeepSeek's own API | `deepseek-flash` | $0.30 / $1.20 | Peak hours (01:00–04:00 and 06:00–10:00 UTC, Mon–Fri). Off-peak: $0.15 / $0.60. [source](https://api-docs.deepseek.com/quick_start/pricing) | \n| DeepInfra | `deepseek-ai/DeepSeek-V4.1-Flash` | $0.14 / $0.42 | Promotional price, fp8; $0.20 / $0.60 without the promotion. [source](https://deepinfra.com/deepseek-ai/DeepSeek-V4.1-Flash) | \n| OpenRouter | `deepseek/deepseek-v4.1-flash-1017` | $0.30 / $1.20 | DeepSeek's own endpoint on OpenRouter; the cheapest of 33 providers is $0.07 / $0.15, mostly fp4 / fp8 quantized. [source](https://openrouter.ai/deepseek/deepseek-v4.1-flash-1017) | \n| XHuoAPI | `deepseek-v4.1-flash` | $0.24 / $0.96 | Standard tier (default). Saver $0.15 / $0.60, Spot $0.09 / $0.36; cheaper tiers are less stable. [source](https://xhuoapi.ai/en/models/deepseek-v4.1-flash.html?utm_source=devto&utm_medium=article&utm_campaign=deepseek-v41-flash) | \n\nHow I'd pick:\n\n**Claude Code** (any Anthropic-compatible endpoint works the same way; leave `/v1` off the base URL):\n\n```\nexport ANTHROPIC_BASE_URL=https://api.xhuoapi.ai\nexport ANTHROPIC_AUTH_TOKEN=YOUR_KEY\nexport ANTHROPIC_MODEL=deepseek-v4.1-flash\nexport ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4.1-flash\n```\n\n**OpenCode 2**, `opencode.jsonc` in your project:\n\n```\n{\n  \"$schema\": \"https://opencode.ai/config.json\",\n  \"providers\": {\n    \"xhuoapi\": {\n      \"name\": \"XHuoAPI\",\n      \"env\": [\"XHUOAPI_API_KEY\"],\n      \"package\": \"@opencode/ai/providers/openai-compatible\",\n      \"settings\": { \"baseURL\": \"https://api.xhuoapi.ai/v1\" },\n      \"models\": { \"deepseek-v4.1-flash\": { \"name\": \"DeepSeek V4.1 Flash\" } }\n    }\n  }\n}\n```\n\nThen `opencode run -m xhuoapi/deepseek-v4.1-flash \"...\"`.\n\nTwo things worth knowing:\n\n`thinking: {\"type\": \"disabled\"}` (or `reasoning_effort: \"none\"`) turned it off, and `reasoning_effort` `low` / `max` changed how much it reasons.\nThe full price table (including V4 Pro) and the per-tool test results are here: [https://xhuoapi.ai/en/guides/deepseek-api-outside-china.html?utm_source=devto&utm_medium=article&utm_campaign=deepseek-v41-flash](https://xhuoapi.ai/en/guides/deepseek-api-outside-china.html?utm_source=devto&utm_medium=article&utm_campaign=deepseek-v41-flash) and [https://xhuoapi.ai/en/guides/chinese-models-in-coding-agents.html?utm_source=devto&utm_medium=article&utm_campaign=deepseek-v41-flash](https://xhuoapi.ai/en/guides/chinese-models-in-coding-agents.html?utm_source=devto&utm_medium=article&utm_campaign=deepseek-v41-flash)", "url": "https://wpnews.pro/news/deepseek-v4-1-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-on", "canonical_source": "https://dev.to/xhuoapi/deepseek-v41-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-costs-on-four-4jjm", "published_at": "2026-10-24 07:35:44+00:00", "updated_at": "2026-10-24 07:43:45.953502+00:00", "lang": "en", "topics": ["large-language-models", "ai-agents", "ai-tools", "developer-tools"], "entities": ["DeepSeek", "DeepSeek V4.1 Flash", "Claude Code", "OpenCode", "DeepInfra", "OpenRouter", "XHuoAPI", "Anthropic"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/deepseek-v4-1-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-on", "markdown": "https://wpnews.pro/news/deepseek-v4-1-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-on.md", "text": "https://wpnews.pro/news/deepseek-v4-1-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-on.txt", "jsonld": "https://wpnews.pro/news/deepseek-v4-1-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-on.jsonld"}}