Cloudflare Workers AI Launches DeepSeek V4 Flash & Pro: Edge Inference Goes 1M-Context
On August 14, 2026, Cloudflare added DeepSeek V4 Flash and DeepSeek V4 Pro to Workers AI — the first two models on the platform with a full 1,048,576-token (1M) context window. The move turns Cloudflare’s global edge network into a distribution channel for DeepSeek’s open-weights generation, and it lands barely a day after DeepSeek’s V4 Pro official release and just weeks after V4 Flash’s preview. This article walks through what actually shipped, the verified edge pricing, the 1M-context agent use cases, and how the Cloudflare route compares to calling DeepSeek directly or through an aggregator like OpenRouter.
What shipped on August 14
Cloudflare’s changelog for August 14, 2026 confirms both models went live under the handles @cf/deepseek-ai/deepseek-v4-pro-0813 and @cf/deepseek-ai/deepseek-v4-flash-0731. The headline feature is the context window: at 1,048,576 tokens, these are the first Workers AI models that can hold a large codebase, a long multi-step agent trajectory, or an entire book’s worth of reasoning in a single request — exceeding the limit of every other model previously hosted on the platform.
Both models support thinking mode (reasoning) for step-by-step problem solving and function calling so agents can invoke tools and APIs across multiple conversation turns. Cloudflare describes DeepSeek V4 Flash as “the faster, lower-cost sibling,” and this release supersedes the earlier preview with “substantially enhanced agentic capabilities.” The intended workloads are long-horizon agentic workflows, large-codebase reasoning and multi-step analysis — exactly the jobs that break smaller context windows.
Verified Workers AI edge pricing
| Model | Input ($/M) | Output ($/M) | Cached input ($/M) | Context |
|---|---|---|---|---|
| DeepSeek V4 Pro 0813 | $1.32 | $3.96 | $0.044 | 1M |
| DeepSeek V4 Flash 0731 | $0.44 | $1.32 | $0.014 | 1M |
These are the official rates on Cloudflare’s Workers AI model pages (verified August 16, 2026). Both models require a Workers Paid plan or prepaid AI Gateway credits — they are not available through the standard Workers Free billing tier. The cached-input discount is worth calling out: at $0.044/M for Pro and $0.014/M for Flash, prompt caching on Workers AI cuts the dominant cost of long-context, multi-turn agent loops dramatically. Cloudflare charges per token for inference and adds AI Gateway observability on top; the exact Gateway pass-through depends on your account’s request volume and is documented on the Workers AI pricing page.
1M context: the agent use case that matters
The 1M-token context is the real story here, not the price. A codebase agent that previously had to chunk a monorepo into hundreds of retrieval calls can now pass the relevant files — or an entire module graph — in one request. A research agent can hold the full source corpus, its notes and a long analysis chain without evicting earlier context. Long-horizon agents that loop over many function calls no longer need aggressive summarization to stay under a 128K or 200K ceiling.
For teams already running Workers, the binding is the simplest integration path: env.AI.run("@cf/deepseek-ai/deepseek-v4-pro-0813", { messages }) from a Worker, with no VM, no gateway and no key management beyond the account token. The same models are reachable through the REST API, the OpenAI-compatible endpoint, and AI Gateway (for caching, rate limiting, retries and observability across providers). If you want the fully portable OpenAI-style surface, our Cloudflare AI Gateway review covers the gateway layer in depth.
Prompt caching is the real cost lever
With a 1M-token context window, the input side of the bill can dominate fast. A long-horizon agent that starts each turn by re-sending 400K tokens of repo context would pay for that context on every single step if there were no caching. Cloudflare’s cached-input pricing is designed to defuse exactly that problem: DeepSeek V4 Pro drops from $1.32 to $0.044 per M for cached input (a 30x cut), and V4 Flash drops from $0.44 to $0.014 per M (also ~30x). The practical effect is that a multi-turn agent loop with a large stable prefix costs roughly as much as a much smaller one, because only the delta — the new tool results and new instructions appended each turn — is billed at the full input rate.
A quick cost model makes this concrete. Imagine a codebase-analysis agent that runs 200 turns per task over a stable 300K-token context, appending ~2K new tokens each turn, and emitting ~1K output tokens per turn. Without caching, one task is roughly 200 × 300K = 60M input tokens at $1.32/M — about $79 in input alone on V4 Pro. With prompt caching, the cached portion (298K of the 300K per turn) is billed at $0.044/M and only the 2K delta is billed at full rate: input drops to roughly $2.90 per task, a >25x reduction. That single switch — enabled by default on the Workers AI OpenAI-compatible endpoint with the right cache key — is the difference between a 1M-context agent being economically prohibitive and genuinely runnable. It is the same pattern DeepSeek and OpenRouter expose with their own prompt-cache pricing; the nuance on Workers AI is that the discount is built into the platform’s flat rate card rather than a separate plan toggle.
Workers AI vs the direct DeepSeek API vs OpenRouter
| Route | V4 Pro $/M (in/out) | V4 Flash $/M (in/out) | Best for |
|---|---|---|---|
| Workers AI (this release) | $1.32 / $3.96 | $0.44 / $1.32 | Edge colocation with Workers, AI Gateway, 1M context without infra |
| Direct DeepSeek API (peak) | $1.32 / $3.96 | ~$0.14–$0.28 | Simplest direct billing; China-hosted origin |
| Direct DeepSeek API (off-peak) | ~$0.66 / $1.98 | ~$0.07–$0.14 | Scheduled bulk workloads that can run off-peak — half price |
| OpenRouter (digitalocean / deepseek vendors) | varies by vendor | varies by vendor | Single-key multi-vendor routing and failover |
The most striking comparison: Workers AI prices DeepSeek V4 Pro at exactly DeepSeek’s own peak-hour rate ($1.32/$3.96), while the direct API drops to about half that off-peak (the peak/valley billing that shipped with V4 Pro’s release is covered in our DeepSeek V4 Pro peak-valley pricing article). So if your traffic is bursty and latency-sensitive, Workers AI’s flat rate and edge colocation win; if you can schedule heavy jobs into off-peak windows, the direct API’s ~50% discount is hard to beat.
For V4 Flash the picture is inverted in the other direction: Workers AI’s $0.44/$1.32 is above the direct API’s ~$0.14–$0.28 cache-miss range, but that gap buys you 1M context (the preview on the direct API was more limited) plus edge adjacency. And if you want to compare before committing, our DeepSeek V4 Flash API review and the OpenRouter agentic token-share analysis give the direct-to-aggregator picture.
What this means for API buyers in 2026
DeepSeek V4 on Workers AI is the latest sign that 2026’s inference market has split into tiers: frontier labs sell premium closed models, open-weights operators (DeepSeek, Qwen, Llama, Mistral) sell budget reasoning, and the distribution layer — Cloudflare, OpenRouter, Vercel, AI Gateway — is where the routing, the context-window and the failover decisions get made. Getting a 1M-context open-weights model from Cloudflare’s network, billed per token with prompt-cache discounts and AI Gateway observability, effectively commoditizes long-context agent inference the same way Workers commoditized serverless compute.
The practical playbook for a cost-sensitive agent team: run latency-critical, cache-heavy agent turns on Workers AI DeepSeek V4 (pro or flash) for the 1M context and edge adjacency; schedule bulk and non-interactive passes on the direct DeepSeek API during off-peak windows at ~50% off; and keep an OpenAI-compatible aggregator key in front for failover — the multi-provider architecture we document across the site. If you want one key that fronts several of these vendors with simpler cross-region failover, FreeModel’s multi-vendor routing is a clean starting point.
One caution: edge inference latency varies by region and by traffic, and the 1M-context models are still Beta on the platform — Cloudflare lists V4 Pro as Beta. For production, pin your Worker to a region close to your users and use AI Gateway caching. And note that Cloudflare’s positioning with DeepSeek gives mainland-connected teams a route that doesn’t require wrestling with DeepSeek’s China-hosted origin directly — relevant context in our Workers AI China models article.
The 1M-context landscape in 2026
Workers AI joining the 1M-context club is notable because the list of providers that can truly hold a million tokens is still short, and the ones that can price it very differently. DeepSeek’s own API serves V4 Pro and Flash with ~1M context and pioneered peak/valley pricing (off-peak halves the rate). Google’s Gemini family has shipped 1M+ context for years and leads on multimodal 1M work. xAI’s Grok and Alibaba’s Qwen have also pushed into multi-hundred-K and 1M territory, and open-weights hosts like Nebius and DigitalOcean Gradient are putting 1M-context DeepSeek-class models behind OpenAI-compatible endpoints. What differentiates Cloudflare is where the inference runs: on edge nodes that sit one network hop from your Workers, with AI Gateway observability and prompt-cache pricing built in, rather than on a regional cloud VM you have to reach over the public internet.
For an agent platform that already lives on Cloudflare — a Worker, a Pages function, a D1-backed job queue — that adjacency is the whole point. You do not manage a sidecar inference client, a second vendor account, or a regional endpoint; the model is just another binding, and AI Gateway gives you caching, rate limits and a single analytics pane. The trade-off is that you are coupling your inference to a single platform, so teams that want portability keep an OpenAI-compatible route (direct DeepSeek, OpenRouter, or another open-weights host) as a fallback — the same failover pattern the aggregators themselves encourage.
Getting started in one snippet
The fastest path is the OpenAI-compatible endpoint from a Worker or any HTTP client. A minimal chat completion against the edge model looks like this:
fetch("https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer {API_TOKEN}",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "@cf/deepseek-ai/deepseek-v4-pro-0813",
messages: [{ "role": "user", "content": "Summarize this 500K-token codebase audit and list the top refactor risks." }]
})
}).then(r => r.json()).then(console.log);
Swap the model handle for @cf/deepseek-ai/deepseek-v4-flash-0731 for the cheaper, faster sibling. For Workers-native use, call env.AI.run("...", { messages }) and stream the response. Both paths require a Workers Paid plan or prepaid AI Gateway credits, per Cloudflare’s documentation.
Cloudflare Workers AI DeepSeek V4 FAQ
When did Cloudflare Workers AI add DeepSeek V4 Flash and Pro?
Cloudflare shipped DeepSeek V4 Flash and Pro on Workers AI on August 14, 2026, under the handles @cf/deepseek-ai/deepseek-v4-pro-0813 and @cf/deepseek-ai/deepseek-v4-flash-0731.
How much does DeepSeek V4 on Cloudflare Workers AI cost?
Workers AI prices V4 Pro at $1.32 per M input, $3.96 per M output and $0.044 per M cached input. V4 Flash is $0.44 per M input, $1.32 per M output and $0.014 per M cached input. Both require the Workers Paid plan or prepaid AI Gateway credits.
Do the Workers AI DeepSeek V4 models support 1M token context?
Yes. DeepSeek V4 Flash and Pro are the first Workers AI models with a full 1,048,576-token context window, along with thinking-mode reasoning and function calling on both.
How do I call DeepSeek V4 on Workers AI?
Through the Workers AI binding (env.AI.run()), the REST API, the OpenAI-compatible endpoint, or the AI Gateway — all four surfaces are documented by Cloudflare.
Is Workers AI DeepSeek V4 cheaper than the direct DeepSeek API?
It depends. Workers AI V4 Pro matches DeepSeek’s peak price ($1.32/$3.96), while the direct API offers off-peak pricing at about half. Choose Workers AI for edge colocation and 1M context; choose the direct API off-peak for cheap bulk workloads.