Goal
Add an experimental DeepSeek V4 transport that uses DeepSeek's Anthropic-compatible Messages API instead of the current OpenAI Chat Completions path, then compare behavior, token accounting, tool support, and web-search availability.
This is a spike for a possible simpler provider architecture: DeepSeek V4 through Anthropic Messages format, OpenAI Codex through Responses API, and less reliance on OpenAI Chat Completions if the alternate routes are comparable.
Current evidence
- CodeWhale docs currently say shipped providers use Chat Completions today (
docs/PROVIDERS.md, docs/ARCHITECTURE.md).
- DeepSeek's official docs say the Anthropic API format is supported at
https://api.deepseek.com/anthropic.
- DeepSeek's V4 update says V4-Pro and V4-Flash are available through both OpenAI ChatCompletions and the Anthropic interface.
- Anthropic's official API docs include server tools such as
web_search, where the provider runs web search on its infrastructure.
- It is not yet verified whether DeepSeek's Anthropic-compatible endpoint supports Anthropic server tools like web search, or only the Messages API request/response/tool-call shape.
References:
Scope
- Add an opt-in provider/request mode for DeepSeek V4 using the Anthropic Messages wire format.
- Map CodeWhale messages, system prompt, tool definitions, tool results, stop reasons, streaming deltas, thinking/reasoning fields, and usage fields to/from Anthropic Messages format.
- Smoke test
deepseek-v4-pro and deepseek-v4-flash over both Chat Completions and Anthropic Messages against the same small tasks.
- Explicitly test whether Anthropic server tools such as
web_search are accepted, ignored, rejected, or behave differently through DeepSeek's Anthropic endpoint.
- Compare the Anthropic path against current Chat Completions for correctness, latency, token usage, cache/reasoning telemetry, and tool reliability.
- Document the result before changing defaults.
Non-goals
- Do not make Anthropic Messages the default route until smoke tests show it is at least comparable.
- Do not remove Chat Completions support in this issue.
- Do not promise web search support unless DeepSeek's endpoint proves it supports Anthropic server tools in live testing.
- Do not conflate Anthropic's Claude API capabilities with DeepSeek's Anthropic-compatible endpoint; they may differ.
Acceptance criteria
Related: #2952, #2955, #2961, #964, #755, #2915
Goal
Add an experimental DeepSeek V4 transport that uses DeepSeek's Anthropic-compatible Messages API instead of the current OpenAI Chat Completions path, then compare behavior, token accounting, tool support, and web-search availability.
This is a spike for a possible simpler provider architecture: DeepSeek V4 through Anthropic Messages format, OpenAI Codex through Responses API, and less reliance on OpenAI Chat Completions if the alternate routes are comparable.
Current evidence
docs/PROVIDERS.md,docs/ARCHITECTURE.md).https://api.deepseek.com/anthropic.web_search, where the provider runs web search on its infrastructure.References:
Scope
deepseek-v4-proanddeepseek-v4-flashover both Chat Completions and Anthropic Messages against the same small tasks.web_searchare accepted, ignored, rejected, or behave differently through DeepSeek's Anthropic endpoint.Non-goals
Acceptance criteria
deepseek-v4-proanddeepseek-v4-flash.web_searchworks with DeepSeek's Anthropic endpoint and includes the exact request/response evidence.nullfor unsupported fields.Related: #2952, #2955, #2961, #964, #755, #2915