From 21846c48e59b604e92bbc0faab781609ce180317 Mon Sep 17 00:00:00 2001 From: nathaniel stacey Date: Tue, 1 Sep 2026 19:03:00 -0400 Subject: [PATCH] fix(deepseek): correct V4 Pro/Flash pricing to the published rate card The first-party DeepSeek entries were well below DeepSeek's published prices, most severely on cache reads (6x low for Pro), which dominate agentic traffic. Per https://api-docs.deepseek.com/quick_start/pricing/ (accessed 2026-09-01), off-peak, USD per 1M tokens: deepseek-v4-pro cache hit 0.022 cache miss 0.66 output 1.98 deepseek-v4-flash cache hit 0.007 cache miss 0.22 output 0.66 Verified against real billing: repricing 30 days of local DeepSeek traffic with these rates reproduces the DeepSeek console's daily spend to the cent ($3.4194 vs $3.42, $0.1920 vs $0.19 on two independent days). The previous rates came out ~3.7x under. Corroborated inside this repo: three other hosts of the same models already price as uniform multiples of the published card - opencode-go at 1.000x, above at 1.100x, aihubmix at 1.048x - while the first-party entry's ratios were non-uniform (0.66 / 0.44 / 0.16), the signature of a stale entry rather than a different pricing basis. Off-peak is used because models.dev has no time-of-day pricing and off-peak covers ~79% of hours; peak (01:00-04:00 and 06:00-10:00 UTC, Mon-Fri) is exactly double. Noted in a header comment on each file. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_018EmjRqNQurw9QJhKJGuYuU --- .../models/deepseek-v4-flash-vision-exp.toml | 13 ++++++++----- providers/deepseek/models/deepseek-v4-flash.toml | 13 ++++++++----- providers/deepseek/models/deepseek-v4-pro.toml | 13 ++++++++----- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/providers/deepseek/models/deepseek-v4-flash-vision-exp.toml b/providers/deepseek/models/deepseek-v4-flash-vision-exp.toml index ec428639dc9..8cb7c857d70 100644 --- a/providers/deepseek/models/deepseek-v4-flash-vision-exp.toml +++ b/providers/deepseek/models/deepseek-v4-flash-vision-exp.toml @@ -1,5 +1,8 @@ +# Prices are DeepSeek's published OFF-PEAK rates, USD per 1M tokens. +# Peak (01:00-04:00 and 06:00-10:00 UTC, Mon-Fri) is exactly double; models.dev +# has no time-of-day pricing, and off-peak covers ~79% of hours. +# https://api-docs.deepseek.com/quick_start/pricing/ (accessed 2026-09-01) # DeepSeek-V4-Flash-Vision-Exp is priced the same as DeepSeek V4 Flash. -# https://api-docs.deepseek.com/quick_start/pricing/ (accessed 2026-08-22) # https://api-docs.deepseek.com/guides/vision (accessed 2026-08-22) # OpenAI: `thinking.type = enabled|disabled`, `reasoning_effort = low|high|max`. # Anthropic: `thinking.type`, `output_config.effort = low|high|max`; budget ignored. @@ -17,7 +20,7 @@ values = ["low", "high", "max"] field = "reasoning_content" [cost] -input = 0.14 -output = 0.28 -reasoning = 0.28 -cache_read = 0.0028 +input = 0.22 +output = 0.66 +reasoning = 0.66 +cache_read = 0.007 diff --git a/providers/deepseek/models/deepseek-v4-flash.toml b/providers/deepseek/models/deepseek-v4-flash.toml index 9dca906c5c6..ca70dd62f1f 100644 --- a/providers/deepseek/models/deepseek-v4-flash.toml +++ b/providers/deepseek/models/deepseek-v4-flash.toml @@ -1,6 +1,9 @@ +# Prices are DeepSeek's published OFF-PEAK rates, USD per 1M tokens. +# Peak (01:00-04:00 and 06:00-10:00 UTC, Mon-Fri) is exactly double; models.dev +# has no time-of-day pricing, and off-peak covers ~79% of hours. +# https://api-docs.deepseek.com/quick_start/pricing/ (accessed 2026-09-01) # Reasoning tokens are billed at the output rate (no separate CoT price). # `completion_tokens_details.reasoning_tokens` is a subset of completion_tokens. -# https://api-docs.deepseek.com/quick_start/pricing/ (accessed 2026-07-31) # OpenAI: `thinking.type = enabled|disabled`, `reasoning_effort = low|high|max`. # Anthropic: `thinking.type`, `output_config.effort = low|high|max`; budget ignored. # Flash maps requested low→low (unlike Pro, which maps low→high). xhigh→high. @@ -19,7 +22,7 @@ values = ["low", "high", "max"] field = "reasoning_content" [cost] -input = 0.14 -output = 0.28 -reasoning = 0.28 -cache_read = 0.0028 +input = 0.22 +output = 0.66 +reasoning = 0.66 +cache_read = 0.007 diff --git a/providers/deepseek/models/deepseek-v4-pro.toml b/providers/deepseek/models/deepseek-v4-pro.toml index 4d5aff0281b..7fb3d586f55 100644 --- a/providers/deepseek/models/deepseek-v4-pro.toml +++ b/providers/deepseek/models/deepseek-v4-pro.toml @@ -1,6 +1,9 @@ +# Prices are DeepSeek's published OFF-PEAK rates, USD per 1M tokens. +# Peak (01:00-04:00 and 06:00-10:00 UTC, Mon-Fri) is exactly double; models.dev +# has no time-of-day pricing, and off-peak covers ~79% of hours. +# https://api-docs.deepseek.com/quick_start/pricing/ (accessed 2026-09-01) # Reasoning tokens are billed at the output rate (no separate CoT price). # `completion_tokens_details.reasoning_tokens` is a subset of completion_tokens. -# https://api-docs.deepseek.com/quick_start/pricing/ (accessed 2026-08-12) base_model = "deepseek/deepseek-v4-pro-0813" name = "DeepSeek V4 Pro" # OpenAI: `thinking.type = enabled|disabled`, `reasoning_effort = high|max`. @@ -18,7 +21,7 @@ values = ["high", "max"] field = "reasoning_content" [cost] -input = 0.435 -output = 0.87 -reasoning = 0.87 -cache_read = 0.003625 +input = 0.66 +output = 1.98 +reasoning = 1.98 +cache_read = 0.022