{"repo":"NousResearch/hermes-agent","public_id":"24141","display_label":"DeepSeek v4 and Claude pricing data gaps","summary":"Most members concern missing or incorrect pricing entries for DeepSeek v4-pro and v4-flash models, including a reported 4x overcharge on v4-pro rates. A smaller subset addresses a missing Claude Fable 5 pricing entry with similar unknown-cost symptoms.","subsystem":"agent","counts":{"members":14,"open_issues":2,"open_issues_distinct":2,"open_prs":0,"closed_issues":2,"merged_prs":2,"attempt_prs":8},"landed_fix":{"status":"merged_to_main","basis":"structural","pr":24579},"resolution":{"state":"partially_resolved","by":"pr-65607"},"freshness":{"state":"verified","last_verified_at":"2026-07-16T12:56:23+00:00","is_stale":false},"grouping":{"backbone":"STRUCTURAL_PARTIAL","link_density":0.13670329670329667},"fix_edges":[{"issue_number":24141,"pr_number":65607,"tier":"verified","basis":"superseded_ref","confidence":0.9,"recoverable_from_timeline":false},{"issue_number":24218,"pr_number":24579,"tier":"verified","basis":"superseded_ref","confidence":0.9,"recoverable_from_timeline":false},{"issue_number":41710,"pr_number":65607,"tier":"verified","basis":"closing_ref","confidence":0.95,"recoverable_from_timeline":true}],"members":[{"kind":"issue","number":24141,"title":"insights: DeepSeek v4-pro/v4-flash pricing not matching + cost not rendered in output","url":null,"state":"open"},{"kind":"issue","number":24218,"title":"[Bug]: deepseek-v4-pro sessions show as unknown cost in `hermes insights`","url":null,"state":"closed"},{"kind":"issue","number":41710,"title":"deepseek-v4-flash missing from _OFFICIAL_DOCS_PRICING → $0/unknown cost","url":null,"state":"closed"},{"kind":"issue","number":43321,"title":"claude-fable-5 missing from _OFFICIAL_DOCS_PRICING → $0/unknown cost on direct Anthropic","url":null,"state":"open"},{"kind":"pr","number":24195,"title":"fix(insights): show DeepSeek costs","url":null,"state":"closed","close_reason":{"category":"silent_close","implication":"active"},"merged":false},{"kind":"pr","number":24216,"title":"feat(pricing): add deepseek-v4-pro to docs pricing snapshot","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#24579","number":24579},{"kind":"pr","value":"#24327","number":24327}],"category":"superseded_by_pr","implication":"superseded"},"merged":false},{"kind":"pr","number":24327,"title":"fix: add pricing for deepseek-v4-pro model","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#24579","number":24579}],"category":"merged_via","implication":"superseded"},"merged":false},{"kind":"pr","number":24579,"title":"fix(pricing): add deepseek-v4-pro to official docs pricing table","url":null,"state":"merged","close_reason":{"category":"merged","implication":"superseded"},"merged":true,"is_fix_pr":true,"fix_tier":"verified","files_changed":["agent/usage_pricing.py","scripts/release.py","tests/agent/test_usage_pricing.py"]},{"kind":"pr","number":32035,"title":"fix(pricing): add deepseek-v4-flash to official docs pricing table","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#40127","number":40127},{"kind":"pr","value":"#41719","number":41719},{"kind":"pr","value":"#40127","number":40127},{"kind":"pr","value":"#65607","number":65607}],"category":"merged_via","implication":"superseded"},"merged":false},{"kind":"pr","number":41719,"title":"feat(pricing): add deepseek-v4-flash pricing entry","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#40127","number":40127},{"kind":"pr","value":"#65607","number":65607},{"kind":"pr","value":"#41710","number":41710}],"category":"merged_via","implication":"superseded"},"merged":false},{"kind":"pr","number":41723,"title":"fix(pricing): refresh stale deepseek-v4-pro rates (4x overstated)","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#65607","number":65607},{"kind":"pr","value":"#41719","number":41719}],"category":"implemented_elsewhere","implication":"superseded"},"merged":false},{"kind":"pr","number":43317,"title":"fix(pricing): add Claude Fable 5 usage pricing","url":null,"state":"closed","close_reason":{"category":"uncategorized","implication":"needs_llm"},"merged":false},{"kind":"pr","number":59095,"title":"[codex] refresh DeepSeek v4 pricing","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#32035","number":32035},{"kind":"pr","value":"#32035","number":32035},{"kind":"pr","value":"#41723","number":41723},{"kind":"pr","value":"#41719","number":41719},{"kind":"pr","value":"#40127","number":40127},{"kind":"pr","value":"#41710","number":41710}],"category":"duplicate_of","implication":"duplicate"},"merged":false},{"kind":"pr","number":65607,"title":"fix(pricing): add deepseek-v4-flash entry + refresh stale DeepSeek snapshot to 2026-07 rates","url":null,"state":"merged","close_reason":{"category":"merged","implication":"superseded"},"merged":true,"is_fix_pr":true,"fix_tier":"verified","files_changed":["agent/usage_pricing.py","scripts/release.py","tests/agent/test_usage_pricing.py"],"fix_hunks":[{"file":"agent/usage_pricing.py","hunks":["@@ -446,36 +446,52 @@ class CostResult:\n         pricing_version=\"anthropic-pricing-2026-05\",\n     ),\n     # DeepSeek\n+    # Snapshot of https://api-docs.deepseek.com/quick_start/pricing (2026-07).\n+    # deepseek-chat / deepseek-reasoner are deprecated 2026-07-24 and now alias\n+    # deepseek-v4-flash's non-thinking / thinking modes — same rates.\n     (\n         \"deepseek\",\n         \"deepseek-chat\",\n     ): PricingEntry(\n         input_cost_per_million=Decimal(\"0.14\"),\n         output_cost_per_million=Decimal(\"0.28\"),\n+        cache_read_cost_per_million=Decimal(\"0.0028\"),\n         source=\"official_docs_snapshot\",\n         source_url=\"https://api-docs.deepseek.com/quick_start/pricing\",\n-        pricing_version=\"deepseek-pricing-2026-03-16\",\n+        pricing_version=\"deepseek-pricing-2026-07\",\n     ),\n     (\n         \"deepseek\",\n         \"deepseek-reasoner\",\n     ): PricingEntry(\n-        input_cost_per_million=Decimal(\"0.55\"),\n-        output_cost_per_million=Decimal(\"2.19\"),\n+        input_cost_per_million=Decimal(\"0.14\"),\n+        output_cost_per_million=Decimal(\"0.28\"),\n+        cache_read_cost_per_million=Decimal(\"0.0028\"),\n         source=\"official_docs_snapshot\",\n         source_url=\"https://api-docs.deepseek.com/quick_start/pricing\",\n-        pricing_version=\"deepseek-pricing-2026-03-16\",\n+        pricing_version=\"deepseek-pricing-2026-07\",\n     ),\n     (\n         \"deepseek\",\n         \"deepseek-v4-pro\",\n     ): PricingEntry(\n-        input_cost_per_million=Decimal(\"1.74\"),\n-        output_cost_per_million=Decimal(\"3.48\"),\n-        cache_read_cost_per_million=Decimal(\"0.0145\"),\n+        input_cost_per_million=Decimal(\"0.435\"),\n+        output_cost_per_million=Decimal(\"0.87\"),\n+        cache_read_cost_per_million=Decimal(\"0.003625\"),\n+        source=\"official_docs_snapshot\",\n+        source_url=\"https://api-docs.deepseek.com/quick_start/pricing\",\n+        pricing_version=\"deepseek-pricing-2026-07\",\n+    ),\n+    (\n+        \"deepseek\",\n+        \"deepseek-v4-flash\",\n+    ): PricingEntry(\n+        input_cost_per_million=Decimal(\"0.14\"),\n+        output_cost_per_million=Decimal(\"0.28\"),\n+        cache_read_cost_per_million=Decimal(\"0.0028\"),\n         source=\"official_docs_snapshot\",\n         source_url=\"https://api-docs.deepseek.com/quick_start/pricing\",\n-        pricing_version=\"deepseek-pricing-2026-05-12\",\n+        pricing_version=\"deepseek-pricing-2026-07\",\n     ),\n     # Google Gemini\n     ("]},{"file":"scripts/release.py","hunks":["@@ -351,6 +351,7 @@\n     \"[redacted:email]\": \"dirtyren\",\n     \"[redacted:email]\": \"Code-suphub\",\n     \"[redacted:email]\": \"Code-suphub\",\n+    \"[redacted:email]\": \"shuangxinniao\",\n     \"[redacted:email]\": \"brendandebeasi\",\n     \"[redacted:email]\": \"dorokuma\",\n     \"[redacted:email]\": \"liuwei666888\","]},{"file":"tests/agent/test_usage_pricing.py","hunks":["@@ -223,7 +223,8 @@ def test_deepseek_v4_pro_pricing_entry_exists():\n \n     Before this fix, deepseek-v4-pro sessions showed as unknown cost\n     in hermes insights because the _OFFICIAL_DOCS_PRICING table had no\n-    entry for that model.  See #24218.\n+    entry for that model.  See #24218.  Rates track the 2026-07 price cut\n+    ($1.74/$3.48 → $0.435/$0.87).\n     \"\"\"\n     entry = get_pricing_entry(\n         \"deepseek-v4-pro\",","@@ -233,9 +234,9 @@ def test_deepseek_v4_pro_pricing_entry_exists():\n     assert entry is not None\n     assert entry.input_cost_per_million is not None\n     assert entry.output_cost_per_million is not None\n-    assert float(entry.input_cost_per_million) == 1.74\n-    assert float(entry.output_cost_per_million) == 3.48\n-    assert float(entry.cache_read_cost_per_million) == 0.0145\n+    assert float(entry.input_cost_per_million) == 0.435\n+    assert float(entry.output_cost_per_million) == 0.87\n+    assert float(entry.cache_read_cost_per_million) == 0.003625\n \n \n def test_deepseek_v4_pro_estimate_usage_cost():","@@ -248,8 +249,39 @@ def test_deepseek_v4_pro_estimate_usage_cost():\n \n     assert result.status == \"estimated\"\n     assert result.amount_usd is not None\n-    # 1M input × $1.74/M + 500K output × $3.48/M = $1.74 + $1.74 = $3.48\n-    assert float(result.amount_usd) == 3.48\n+    # 1M input × $0.435/M + 500K output × $0.87/M = $0.435 + $0.435 = $0.87\n+    assert float(result.amount_usd) == 0.87\n+\n+\n+def test_deepseek_deprecated_aliases_price_as_v4_flash():\n+    \"\"\"Invariant: deepseek-chat / deepseek-reasoner are deprecated aliases for\n+    deepseek-v4-flash's non-thinking / thinking modes (deprecation 2026-07-24)\n+    — they must bill at identical rates to the flash entry, or sessions on the\n+    legacy names over/under-report cost.\"\"\"\n+    flash = get_pricing_entry(\"deepseek-v4-flash\", provider=\"deepseek\")\n+    assert flash is not None\n+    for alias in (\"deepseek-chat\", \"deepseek-reasoner\"):\n+        entry = get_pricing_entry(alias, provider=\"deepseek\")\n+        assert entry is not None, alias\n+        assert entry.input_cost_per_million == flash.input_cost_per_million, alias\n+        assert entry.output_cost_per_million == flash.output_cost_per_million, alias\n+        assert (\n+            entry.cache_read_cost_per_million == flash.cache_read_cost_per_million\n+        ), alias\n+\n+\n+def test_deepseek_rows_all_carry_cache_read_pricing():\n+    \"\"\"Invariant: DeepSeek publishes a cache-hit rate for every current model;\n+    every deepseek snapshot row must carry cache_read < input so cached\n+    sessions estimate correctly instead of billing reads at full price.\"\"\"\n+    from agent.usage_pricing import _OFFICIAL_DOCS_PRICING\n+\n+    ds_rows = [k for k in _OFFICIAL_DOCS_PRICING if k[0] == \"deepseek\"]\n+    assert ds_rows, \"expected at least one deepseek pricing row\"\n+    for key in ds_rows:\n+        entry = _OFFICIAL_DOCS_PRICING[key]\n+        assert entry.cache_read_cost_per_million is not None, key\n+        assert entry.cache_read_cost_per_million < entry.input_cost_per_million, key\n \n \n def test_bedrock_claude_rows_all_carry_cache_pricing():","@@ -415,3 +447,37 @@ def test_fireworks_rows_all_carry_cache_read_pricing():\n         entry = _OFFICIAL_DOCS_PRICING[key]\n         assert entry.cache_read_cost_per_million is not None, key\n         assert entry.cache_read_cost_per_million < entry.input_cost_per_million, key\n+\n+\n+def test_deepseek_v4_flash_pricing_entry_exists():\n+    \"\"\"Regression test: deepseek-v4-flash must have a pricing entry.\n+\n+    Before this fix, deepseek-v4-flash sessions showed $0.00 / cost_source\n+    \"none\" because the _OFFICIAL_DOCS_PRICING table had an entry for\n+    deepseek-v4-pro but not the (newer) flash model.  DeepSeek's /models\n+    endpoint returns no pricing, so the official-docs snapshot is the only\n+    source for direct-provider routes.\n+    \"\"\"\n+    entry = get_pricing_entry(\n+        \"deepseek-v4-flash\",\n+        provider=\"deepseek\",\n+    )\n+\n+    assert entry is not None\n+    assert float(entry.input_cost_per_million) == 0.14\n+    assert float(entry.output_cost_per_million) == 0.28\n+    assert float(entry.cache_read_cost_per_million) == 0.0028\n+\n+\n+def test_deepseek_v4_flash_estimate_usage_cost():\n+    \"\"\"Ensure deepseek-v4-flash sessions get a dollar estimate, not $0/none.\"\"\"\n+    result = estimate_usage_cost(\n+        \"deepseek-v4-flash\",\n+        CanonicalUsage(input_tokens=[redacted:secret-assignment] output_tokens=[redacted:secret-assignment]\n+        provider=\"deepseek\",\n+    )\n+\n+    assert result.status == \"estimated\"\n+    assert result.amount_usd is not None\n+    # 1M input × $0.14/M + 500K output × $0.28/M = $0.14 + $0.14 = $0.28\n+    assert float(result.amount_usd) == 0.28\n"]}]}],"trust":{"default_tier":"verified","includes_suggested":false}}