DEV Community

XHuoAPI
XHuoAPI

Posted on Originally published at xhuoapi.ai

DeepSeek V4.1 Flash in Claude Code and OpenCode: setup, test runs, and what it costs on four platforms

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.

Does it work in coding agents?

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.

What it costs (USD per 1M tokens, checked 2026-10-24)

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
DeepInfra deepseek-ai/DeepSeek-V4.1-Flash $0.14 / $0.42 Promotional price, fp8; $0.20 / $0.60 without the promotion. source
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
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

How I'd pick:

  • Cheapest per token: OpenRouter's low-cost providers (check the quantization) or XHuoAPI's Spot tier; then DeepInfra's promotion and DeepSeek's off-peak hours.
  • First-party: DeepSeek's own API. It also has an Anthropic-format endpoint.
  • One account for many vendors: OpenRouter or XHuoAPI. On XHuoAPI the Saver tier equals DeepSeek's off-peak price at any hour, and the same key calls Qwen, GLM, Kimi, GPT and Claude.

Setup

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
Enter fullscreen mode Exit fullscreen mode

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" } }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Then opencode run -m xhuoapi/deepseek-v4.1-flash "...".

Two things worth knowing:

  • Thinking is on by default. On our endpoint, thinking: {"type": "disabled"} (or reasoning_effort: "none") turned it off, and reasoning_effort low / max changed how much it reasons.
  • Third-party hosts often serve quantized weights. If you compare outputs between providers, check the precision column first.

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 and https://xhuoapi.ai/en/guides/chinese-models-in-coding-agents.html?utm_source=devto&utm_medium=article&utm_campaign=deepseek-v41-flash

Top comments (0)