Skip to content
deepseek-v4.1-flash · 1M context · vision

DeepSeek V4.1 Flash API

The DeepSeek-V4.1-Flash release (1017): a 1,048,576-token context window, and it actually reads images. In our measurements it streams at ~120 tokens/second and its prefix cache really hits. OpenAI-compatible, Cloudflare-hosted, 60% off list.

Specs

Context window
1,048,576 tokens (input + max_tokens)
Image input
Yes — read both of our probe images (2/2); send base64 data URIs
Function calling
Yes — calls tools with correct schemas in our contract tests
Reasoning
reasoning_effort none/low/medium/high/xhigh/max. none really turns thinking off (0 reasoning tokens in 6/6 runs); low and high both solved our logic puzzle 6/6, low with fewer tokens — gateway default low
Prompt caching
Real — a repeated prefix is billed at the cached-input rate
Upstream ID (public)
@cf/deepseek-ai/deepseek-v4.1-flash-1017
Privacy
Cloudflare-hosted; metadata-only logging on our side

Pricing (60% off list)

deepseek-v4.1-flash60% off
Input
$0.30$0.12
Output
$1.20$0.48

@cf/deepseek-ai/deepseek-v4.1-flash-1017

Struck price = list. Full live pricing for every model on the models page.

Measured, not quoted

Our measurements, 2026-10-29, from a development machine. Live status and per-model numbers stay on the models page.

~0.6 s

time to first token (p50, 5 streams)

~120 tok/s

streaming throughput (p50)

8.1 s

first token at ~100K input tokens

590,144 / 590,272

prompt tokens served from cache when we re-sent a 590K-token prompt a minute later

Quickstart

OpenAI SDK unchanged — set base_url, use model id deepseek-v4.1-flash.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.clfaigateway.dev/v1",
    api_key="sk-gw-...",  # app.clfaigateway.dev
)

resp = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Summarize this repository..."}],
    stream=True,
)
for chunk in resp:
    print(chunk.choices[0].delta.content or "", end="")

deepseek-v4.1-flash — common questions

Both were retired upstream on 2026-11-20 and now return 404 model_not_found naming the replacement. Switch the model id to deepseek-v4.1-flash: same 1M window, a lower list price than V4 Flash, and image input that works. Nothing else in your code changes.

All models →

Yes, and we checked rather than copied a spec sheet: our standard probe sends two solid-color images and asks for the color — it answered both correctly, at the upstream default and at the gateway default effort.

Vision docs →

In our measurements, yes: re-sending a 590K-token prompt a minute later, all but 128 tokens came back as cached_tokens and were billed at the cached-input rate. Caching is decided upstream per request, so treat it as a saving you will usually get, not a guarantee.

Context & caching docs →

It switches the thinking phase off for real — no reasoning_content at all. On simple prompts that is the fastest and cheapest setting; on hard problems the model then works step by step inside the visible answer, so it is not automatically cheaper there.

reasoning_effort by model →