DeepSeek V4 API, OpenAI-compatible
Both official DeepSeek V4 releases — deepseek-v4-flash and deepseek-v4-pro — with a 1,048,576-token context window, served on Cloudflare Workers AI infrastructure through one OpenAI-compatible endpoint. Prepaid USD credits, per-token billing you can audit, and 40% off the list price for the launch period.
What you get
- Context window
- 1,048,576 tokens (input + max_tokens)
- Function calling
- Yes — verified in our contract tests on both models
- Reasoning
- Yes — streamed as reasoning_content, billed once at output rate
- Streaming
- SSE, flushed chunk by chunk
- Upstream IDs (public)
- @cf/deepseek-ai/deepseek-v4-flash-0731 · @cf/deepseek-ai/deepseek-v4-pro-0813
- Privacy
- Runs on Cloudflare infrastructure; we log metadata only — never prompt or response content
Pricing (40% off list, applied automatically)
- Input
$0.44$0.264- Output
$1.32$0.792
@cf/deepseek-ai/deepseek-v4-flash-0731
- Input
$1.32$0.792- Output
$3.96$2.376
@cf/deepseek-ai/deepseek-v4-pro-0813
Struck price = list. Cached-input rates and live prices for all seven models are on the models page; prices shown here are kept in sync with the billing database.
Measured, not quoted
Our own measurements, 2026-08-16. Live status and per-model numbers stay on the models page.
~1.0 s
time to first token, deepseek-v4-flash (p50, 5 streams)
~102 tok/s
streaming throughput, deepseek-v4-flash (p50)
~45 ms / 1K tokens
prefill rate at 100K–300K input on flash
76.5 s
first token on a real 600K-token prompt (pro) — use streaming for large jobs
Ship in two lines of config
If your code already talks to the OpenAI API — or to DeepSeek’s own OpenAI-style endpoint — you only change base_url and the key. Model IDs match DeepSeek’s official naming.
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-flash",
messages=[{"role": "user", "content": "Summarize this repository..."}],
stream=True,
)
for chunk in resp:
print(chunk.choices[0].delta.content or "", end="")DeepSeek V4 API — common questions
Yes — the official open-weight releases DeepSeek-V4-Flash-0731 and DeepSeek-V4-Pro-0813, served on Cloudflare Workers AI. We publish the exact upstream IDs on every response, so you can verify what is answering.
See upstream IDs →No. Inference runs on Cloudflare’s hosted deployment of the open-weight models. On our side we log request metadata only (tokens, latency, cost) — never prompt or completion content.
Data policy →The window is 1,048,576 tokens counting input plus your max_tokens. Prefill is real work at this size — roughly 45 ms per 1,000 input tokens in our tests — so use streaming for large requests, and expect retryable no_capacity errors at peak on very large prompts.
Context & caching docs →Prepaid credits, per real token, at the current per-model price — 40% off the list price during the launch period, applied automatically. Every request returns its exact cost, and a failed request that produced nothing costs $0.
Billing docs →deepseek-v4-flash is the value pick: fast (about 1 s to first token, ~100 tok/s measured) and a third of Pro’s price. deepseek-v4-pro is the flagship for the hardest reasoning over huge context, and queues longer under load.