Skip to content

feat(deepseek): V4 Pro stays on its own card, and WebSearch via DeepSeek's Search API - #976

Merged
agentforce314 merged 1 commit into
mainfrom
feat/deepseek-v4-pro-continues-and-search-api
Nov 3, 2026
Merged

agentforce314 merged 1 commit into
mainfrom
feat/deepseek-v4-pro-continues-and-search-api

Conversation

@agentforce314

Copy link
Copy Markdown
Owner

DeepSeek has shipped three changes since #925 (2026-09-10), per its changelog, pricing page and live API (checked 2026-11-02/03). This PR applies them.

What DeepSeek changed Where clawcodex was This PR
V4 Pro is not retiring. The 09-10 notes said deepseek-v4-pro would run V4.1 Flash at the Flash price from 2026-09-14. DeepSeek then reversed it: "In response to user demand, we have decided to continue providing API services for DeepSeek V4 Pro after September 14, 2026, with the billing method remaining unchanged." services/pricing.py switched deepseek-v4-pro to the Flash card at 2026-09-14 04:00 UTC. Every V4 Pro request since then shows at about a fifth of what DeepSeek bills (the card is 4.4x low on input, 3.3x on output, 7.3x on cache read). The cutover is removed. V4 Pro prices at its published card at every instant, peak and off-peak. Provider docstrings, the model list and SETUP_GUIDE.md no longer describe it as retiring.
V4.1-Flash-1017 (10-17): deepseek-flash now serves the 1017 snapshot, with the same id and price. Nothing to change in code. Docs and comments name the snapshot.
Search & Fetch API (10-17): DeepSeek's own search engine at POST /v1/tools/search, using the same API key, billed at $0.75 per 1,000 searches from 2026-11-01. WebSearch was Tavily-only. Without TAVILY_API_KEY, every search failed with "not configured". A DeepSeek backend for WebSearch, used only when TAVILY_API_KEY is unset. Tavily stays first whenever its key is set.

Live evidence (2026-11-02/03)

  • GET /models lists exactly two models: deepseek-flash (DeepSeek-V4.1-Flash, image input) and deepseek-v4-pro (DeepSeek-V4-Pro, text only). Both have a 1,048,576-token context, 393,216 max output, and efforts low/high/max.
  • A deepseek-v4-pro chat request answers as model: deepseek-v4-pro under its own system_fingerprint. deepseek-v4-flash, deepseek-v4-flash-vision-exp, deepseek-chat and deepseek-reasoner all answer as deepseek-flash under one shared fingerprint. So Pro is really not routed to Flash.

Design notes

  • Pricing: the axis is deleted rather than moved. The cutover never took effect, so there is no Flash-priced history to preserve, and stored sessions re-priced by their timestamps get the right number too. deepseek_v4_pro_is_routed_to_flash had no callers outside pricing.py and its tests, so it is removed.
  • Subagent tiers stay on deepseek-flash. With Pro live again I considered pointing the opus tier back at it. I didn't, because DeepSeek's own claim is that V4.1 Flash "has comprehensively surpassed V4 Pro in performance, cost, speed, and total time", and 1017 improved on V4.1. An opus-tier escalation would pay 4.4x for the model DeepSeek ranks second. The DeepSeek Harness catalog still describes Pro as "stronger … at higher cost", but that text dates from 2026-08-24, when the comparison was V4 Flash. No built-in agent pins opus. Pro stays selectable for anyone who pins it.
  • Search key safety: the backend uses the key the DeepSeek provider would use (providers.deepseek.api_key, then DEEPSEEK_API_KEY), and only when providers.deepseek.base_url is unset or on api.deepseek.com. A base URL on another host means the key belongs to a gateway, so it is never sent to DeepSeek and that gateway isn't assumed to serve /v1/tools.
  • Search requests: count is clamped to the API's 1–50 range. A query over the API's 128-character limit fails locally with a precise message instead of a wasted request. The model sees each result's short snippet (the same as the DeepSeek Harness), not the 1–2K-char summary. HTTP 401/402/408/429/5xx errors carry DeepSeek's own message plus its documented remedy.
  • Not adopted: the Fetch API. WebFetch already works without a key, and keeps address and size checks that the Fetch API would hand to the vendor. Search costs are also not added to /cost; Tavily's never were.
  • ui-desktop described the DeepSeek key as "V3.x, R1", which is now "V4.1 Flash, V4 Pro".

Testing

  • Live, headless, real DeepSeek API, isolated profile (DeepSeek provider only, no Tavily key):
    • -p … --model deepseek-v4-pro: the persisted session reports total_cost_usd: 0.02837736 for 21,489 input + 3 output tokens at 07:10 UTC Tuesday (peak). That is exactly the published peak Pro card. origin/main's pricing module re-prices the same usage at 0.0064503, the Flash card.
    • -p "Use the WebSearch tool …" --model deepseek-flash: the model called WebSearch, results came back from DeepSeek's Search API, and it answered correctly about the 10-17 update with sources.
    • A bogus key surfaces DeepSeek's real 401 text: DeepSeek search error 401: Authentication Fails, Your api key: ****0000 is invalid (request_id: …). DeepSeek rejected the API key.
  • Unit tests:
    • tests/test_deepseek_peak_pricing.py replaces the cutover tests with ones pinning the Pro card across the cancelled instant, against the published numbers, for the agent-mix dollar figure, and on the live (clock-reading) path.
    • New tests/test_web_search_deepseek.py (25 tests): backend selection, gateway-key protection, request shape, limits, result mapping, domain filters, error mapping.
    • The existing "unconfigured" WebSearch tests now also clear DEEPSEEK_API_KEY.
  • Full suite (local, Python 3.10 venv): 10,994 passed, 16 skipped, 33 failed. The same 33 fail on a clean origin/main worktree with the same venv (retry lane, stop hooks, teammate runner, memory recall; several are a query.query patch-target error). None of them touch pricing, providers or WebSearch. Every DeepSeek, pricing and web-search test passes.

🤖 Generated with Claude Code

…eek's Search API

DeepSeek has shipped three changes since #925.

V4 Pro is not retiring. The 2026-09-10 release notes said every
deepseek-v4-pro request would run V4.1 Flash at the Flash price from
2026-09-14, and pricing switched V4 Pro to the Flash card at that instant.
DeepSeek reversed it before it took effect ("we have decided to continue
providing API services for DeepSeek V4 Pro after September 14, 2026, with
the billing method remaining unchanged"). Probed live: a deepseek-v4-pro
request answers as deepseek-v4-pro under its own system fingerprint. So
/cost has shown every V4 Pro request since 09-14 at about a fifth of what
DeepSeek bills. The cutover axis is removed: V4 Pro prices at its
published card at every instant, peak and off-peak. Docs and the model
list stop calling it retiring. Subagent tiers stay on deepseek-flash,
which DeepSeek ranks above V4 Pro.

deepseek-flash now serves the V4.1-Flash-1017 snapshot (2026-10-17), with
the same id and price; docs and comments name it.

DeepSeek opened its search engine as an API on 2026-10-17, using the same
key as its chat models. WebSearch now falls back to it when
TAVILY_API_KEY is unset, instead of failing with "not configured"; Tavily
stays first whenever its key is set. The key is used only when the
deepseek provider's base_url is unset or on api.deepseek.com, so a
gateway's key is never sent to DeepSeek. The Fetch API is not adopted:
WebFetch already works without a key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Test Results

     5 files   1 028 suites   14m 8s ⏱️
16 337 tests 16 314 ✅ 22 💤 1 ❌
32 607 runs  32 535 ✅ 71 💤 1 ❌

For more details on these failures, see this check.

Results for commit a05b457.

@agentforce314
agentforce314 merged commit dd3b8f7 into main Nov 3, 2026
6 of 8 checks passed
@agentforce314
agentforce314 deleted the feat/deepseek-v4-pro-continues-and-search-api branch November 3, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant