DeepSeek V4 Flash on OpenRouter: Setup, Pricing & BYOK
DeepSeek V4 Flash on OpenRouter: slugs, $0.0896/$0.1792 pricing vs official, BYOK setup, thinking params, and direct-API tradeoffs.
Why Route DeepSeek V4 Flash Through OpenRouter?
OpenRouter is a unified AI router: one API key and one OpenAI-compatible endpoint give you access to hundreds of models, including DeepSeek V4 Flash. For DeepSeek specifically, OpenRouter is the largest third-party host — DeepSeek is the platform's #1 model author with a 16.7% token share as of July 13, 2026, and DeepSeek V4 Flash ranks #3 in model usage[3].
A single OpenRouter slug like `deepseek/deepseek-v4-flash` can route to several independent hosting companies behind the scenes. If one provider goes down, OpenRouter can fail over to another without touching your code. That is the core argument for a router over a direct connection.
OpenRouter states it does not mark up models: the catalog price is the price you pay, and it charges a 5.5% platform fee on pay-as-you-go traffic. V4 models also drive the platform's agentic traffic — they accounted for roughly 70% of DeepSeek's agentic token volume on OpenRouter within about a month of the April 24 release.
| Spec | DeepSeek V4 Flash |
|---|---|
| Total parameters | 284B |
| Active parameters | 13B (MoE) |
| Context window | 1M (1,048,576 tokens) |
| Max output | 384,000 tokens |
| Released | April 24, 2026 (preview) |
| License | MIT (open weights) |
| Input | Text only |
The Two Slugs: deepseek-v4-flash vs deepseek-v4-flash-0731
OpenRouter lists two DeepSeek V4 Flash slugs. `deepseek/deepseek-v4-flash` is the April 24 preview[1]. `deepseek/deepseek-v4-flash-0731` is the official re-post-trained build DeepSeek shipped on July 31, 2026 as a public beta[2].
The 0731 build has the same architecture and the same size as the preview — it is re-post-training, not a new model. The update only applies to the Flash API; V4 Pro is unchanged. When the 0731 slug launched on OpenRouter, only two providers hosted it, and only the DeepSeek provider serves the official 0731 build — other providers still run the 0424 preview.
The 0731 update adds native Responses API support and a dedicated Codex integration. For agentic coding, DeepSeek reports the 0731 build scores 82.7 on Terminal-Bench 2.1 and 54.4 on DeepSWE. These are vendor-reported figures from DeepSeek's own changelog, not independent testing.
| Agent benchmark (0731, vendor-reported) | Score |
|---|---|
| Terminal-Bench 2.1 | 82.7 |
| Cybergym | 76.7 |
| Toolathlon (verified) | 70.3 |
| DeepSWE | 54.4 |
| NL2Repo | 54.2 |
| Agent Last Exam | 25.2 |
| Automation Bench (Public) | 25.1 |
Benchmark scores come from DeepSeek's July 31, 2026 changelog and are vendor-reported. Independent measurements may differ.
OpenRouter Pricing: $0.0896/$0.1792 vs Official $0.14/$0.28
As of August 1, 2026, OpenRouter lists DeepSeek V4 Flash at $0.0896 per 1M input tokens and $0.1792 per 1M output tokens, marked 36% off. The 0731 variant lists at $0.09 / $0.18. DeepSeek's official API prices V4 Flash at $0.14 input (cache miss) and $0.28 output[7].
Today OpenRouter is roughly 36% cheaper than DeepSeek's official list price. That is an OpenRouter promotional discount, not an official DeepSeek price change — the two marketplaces can diverge over time.
The catch is cache pricing. DeepSeek's official API drops cache-hit input to $0.0028 per 1M tokens, a 98% discount. OpenRouter charges one flat price for DeepSeek and does not list a separate cache-hit tier. Applications with high cache hit rates — long repeated system prompts, agent sessions — can end up paying significantly less going direct.
| Route (per 1M tokens) | Input | Output | Cache-hit input |
|---|---|---|---|
| OpenRouter deepseek/deepseek-v4-flash | $0.0896 | $0.1792 | Flat (no cache tier) |
| OpenRouter deepseek-v4-flash-0731 | $0.09 | $0.18 | Flat (no cache tier) |
| DeepSeek official API | $0.14 (miss) | $0.28 | $0.0028 |
OpenRouter adds a 5.5% platform fee on pay-as-you-go traffic. For scale: at the official $0.14/M input price, $1 covers roughly 7 million input tokens on V4 Flash.
Set Up OpenRouter: Account, API Key & Credits
Create an account at openrouter.ai, generate an API key from the dashboard (keys start with `sk-or-v1-`), and add credits[4]. Third-party guides recommend a $5 minimum top-up with $20 as a comfortable starting balance; credits do not expire, and new accounts get a $1 trial credit.
- Sign up at openrouter.ai and open the dashboard.
- Create an API key from the Keys page — it looks like `sk-or-v1-...`.
- Add credits: $5 minimum, $20 recommended. Credits do not expire.
- Store the key as the `OPENROUTER_API_KEY` environment variable in your terminal or project `.env` file.
Never commit API keys to git. Keep them in environment variables or a `.env` file that is gitignored.
First Call: curl & the OpenAI SDK
OpenRouter exposes an OpenAI-compatible API. Point the OpenAI SDK at `https://openrouter.ai/api/v1`, set the model to `deepseek/deepseek-v4-flash`, and everything else works as usual. OpenRouter also accepts Anthropic Messages and Responses formats.
To switch model versions, change one string: `deepseek/deepseek-v4-flash` becomes `deepseek/deepseek-v4-flash-0731`. Nothing else in the request needs to change.
When calling from an app, add the optional `HTTP-Referer` and `X-Title` headers. OpenRouter uses them for app rankings on the platform. See Step 8 for a Python example using the OpenAI SDK.
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-v4-flash",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'Enable Thinking Mode: reasoning.enabled & reasoning_effort
OpenRouter exposes an optional reasoning switch for V3.2 and V4 models. Pass `"reasoning": {"enabled": true}` to turn on chain-of-thought and receive the reasoning steps in the response. Omit it to run the faster, cheaper non-thinking mode.
V4 models also accept a `reasoning_effort` parameter. OpenRouter's model page states: "Reasoning efforts `high` and `xhigh` are supported; `xhigh` maps to max reasoning." Use `xhigh` when you want maximum reasoning depth.
The official DeepSeek API uses `low` / `high` / `max` for effort, with `low` and `medium` mapped to `high` and `xhigh` mapped to `max`; complex agent requests are auto-set to `max`[8]. Note the asymmetry: community bug reports (pi issue #4055, LiteLLM issue #27439) show OpenRouter's normalized reasoning API accepts `xhigh` directly, while passing `max` can be ignored or fall back to defaults. On OpenRouter, use `xhigh`.
Thinking mode returns reasoning steps in the response. In multi-turn conversations, pass the assistant message back as usual — the reasoning content is not replayed as input.
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-v4-flash-0731",
"messages": [{"role": "user", "content": "Plan the refactor steps."}],
"reasoning": {"enabled": true},
"reasoning_effort": "xhigh"
}'BYOK: Connect Your DeepSeek Key
BYOK stands for Bring Your Own Key. In your OpenRouter workspace, open the BYOK settings and bind your DeepSeek provider key. OpenRouter stores the key encrypted and uses it for every request routed to DeepSeek[5], so traffic bills against your own DeepSeek key instead of OpenRouter's list price.
The economics are attractive: the first 1M BYOK requests per month are free, and after that you pay 5% of OpenRouter's normal price, deducted from your OpenRouter credits. That 5% is a routing convenience fee — you keep failover, unified billing, and one key for every model.
OpenRouter lets you manage multiple keys per provider with prioritized and backup partitions. A primary DeepSeek key is used first, and a fallback key absorbs the overflow when the primary is exhausted or down.
| Traffic type | Fee |
|---|---|
| OpenRouter pay-as-you-go (no own key) | 5.5% platform fee, no model markup |
| BYOK, first 1M requests per month | Free |
| BYOK, after 1M requests per month | 5% of OpenRouter's normal price, from OpenRouter credits |
Because BYOK bills against your DeepSeek key, it combines OpenRouter's routing with DeepSeek's official rates — including the $0.0028 cache-hit input tier[6].
OpenRouter vs the Official API: Which Should You Pick?
Both routes serve the same model. Direct access hits `https://api.deepseek.com` with model `deepseek-v4-flash`; OpenRouter uses `https://openrouter.ai/api/v1` with `deepseek/deepseek-v4-flash`. For running DeepSeek V4 Flash on OpenRouter the deciding factors are failover, cache utilization, and how many models you juggle.
Provider quality is why routing exists. V4 Pro on OpenRouter is hosted by 16 providers with roughly a 4x spread in input pricing ($0.435–$1.74 per 1M tokens) and throughput from 4 to 57 tokens/s. When hosts vary that much, a router that locks a known-good provider or sorts by throughput or price is genuinely useful.
OpenRouter exposes per-request routing controls: `sort: 'throughput'` for speed or `sort: 'price'` for the cheapest host, a `max_price` cost cap, and `order` / `only` / `ignore` to pin or exclude providers. Long sessions can pass a `session_id` for sticky routing, and a `models` array gives model-level fallback.
One caution: OpenRouter has a free variant, `deepseek/deepseek-v4-flash:free`, with reasoning support, but the community reports it is unstable — frequent 429 rate limits and downtime. Treat it as a test tier, not production.
| Dimension | DeepSeek official direct | OpenRouter |
|---|---|---|
| Base URL | https://api.deepseek.com | https://openrouter.ai/api/v1 |
| Model name | deepseek-v4-flash | deepseek/deepseek-v4-flash |
| Price per 1M (Aug 1, 2026) | $0.14 in / $0.28 out; cache hit $0.0028 | $0.0896 / $0.1792, flat (36% off) |
| Platform fee | None | 5.5%; BYOK first 1M requests/month free, then 5% |
| Concurrency | 2,500 | Provider-dependent |
| Strengths | Floor price, cache discount, high concurrency | One key for all models, multi-provider failover, switch versions by string change, lock known providers |
| Weaknesses | Single provider, no failover | Flat cache pricing hurts high-cache apps, platform fee |
Bottom line: if you need floor pricing and run cache-heavy workloads, go direct. If you need failover, run long agent sessions, or want one key for many models, OpenRouter — especially with BYOK — is the practical choice.
from openai import OpenAI
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="sk-or-v1-...", # your OPENROUTER_API_KEY
)
resp = client.chat.completions.create(
model="deepseek/deepseek-v4-flash",
messages=[{"role": "user", "content": "Hello"}],
extra_headers={"HTTP-Referer": "https://your-site.com", "X-Title": "Your App"},
)
print(resp.choices[0].message.content)- [1]OpenRouter Model Page — deepseek/deepseek-v4-flash
- [2]OpenRouter Model Page — deepseek/deepseek-v4-flash-0731
- [3]OpenRouter Insights: Why OpenRouter for DeepSeek?
- [4]OpenRouter Quickstart
- [5]OpenRouter BYOK Guide
- [6]OpenRouter BYOK Use Cases
- [7]DeepSeek Official Models & Pricing
- [8]DeepSeek Thinking Mode Guide