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

> Source: <https://dev.to/xhuoapi/deepseek-v41-flash-in-claude-code-and-opencode-setup-test-runs-and-what-it-costs-on-four-4jjm>
> Published: 2026-10-24 07:35:44+00:00

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)
