DeepSeek V4.1 Flash in Claude Code and OpenCode: setup, test runs, and what it costs on four platforms 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. 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? 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. I 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. | Tool | Version | Passed | |---|---|---| | Claude Code Anthropic Messages format | 2.1.310 | 3 / 3 | | OpenCode 2 OpenAI Chat Completions format | 2.1.3 | 3 / 3 | Claude 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. | Where | Model ID | Input / Output | Notes | |---|---|---|---| | 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 | | 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 | | 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 | | 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 | How I'd pick: Claude Code any Anthropic-compatible endpoint works the same way; leave /v1 off the base URL : export ANTHROPIC BASE URL=https://api.xhuoapi.ai export ANTHROPIC AUTH TOKEN=YOUR KEY export ANTHROPIC MODEL=deepseek-v4.1-flash export ANTHROPIC DEFAULT HAIKU MODEL=deepseek-v4.1-flash OpenCode 2 , opencode.jsonc in your project: { "$schema": "https://opencode.ai/config.json", "providers": { "xhuoapi": { "name": "XHuoAPI", "env": "XHUOAPI API KEY" , "package": "@opencode/ai/providers/openai-compatible", "settings": { "baseURL": "https://api.xhuoapi.ai/v1" }, "models": { "deepseek-v4.1-flash": { "name": "DeepSeek V4.1 Flash" } } } } } Then opencode run -m xhuoapi/deepseek-v4.1-flash "..." . Two things worth knowing: thinking: {"type": "disabled"} or reasoning effort: "none" turned it off, and reasoning effort low / max changed how much it reasons. The 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