Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Feature Request: Support DeepSeek Native Web Search via Anthropic-Compatible API
Evidence: DeepSeek API Natively Supports Web Search
DeepSeek's official documentation at https://api-docs.deepseek.com/quick_start/agent_integrations/claude_code states:
Using Web Search in Claude Code
The DeepSeek API natively supports the Web Search feature in Claude Code.
When using Claude Code, if the model determines that your question requires
a web search, it will invoke the Web Search tool and perform the search
through the API provided by DeepSeek.
This feature is available through DeepSeek's Anthropic-compatible API endpoint (https://api.deepseek.com/anthropic), which speaks the Anthropic Messages protocol. It works via the server_tool_use / web_search_tool_result mechanism — the model invokes the search server-side, and DeepSeek handles the entire search lifecycle without any client-side tools or third-party services.
The Anthropic API compatibility matrix (https://api-docs.deepseek.com/guides/anthropic_api) confirms:
| Message Field | Variant | Support Status |
|---|---|---|
| content array | type = "server_tool_use" | ✅ Supported |
| content array | type = "web_search_tool_result" | ✅ Supported |
Problem: OpenCode Currently Cannot Use This Feature
OpenCode integrates DeepSeek exclusively as an OpenAI-compatible chat provider (@ai-sdk/openai-compatible with baseURL: https://api.deepseek.com/v1). The OpenAI Chat Completions protocol has no concept of provider-executed tools like web_search — it only supports client-executed tool_calls.
This means:
- OpenCode users with a DeepSeek API key cannot access DeepSeek's native web search
- The feature works on Claude Code (as documented), but not on OpenCode
- Users must either use a separate search service or switch tools entirely
Root Cause
In packages/llm/src/providers/openai-compatible-profile.ts:10:
deepseek: { provider: "deepseek", baseURL: "https://api.deepseek.com/v1" }DeepSeek is registered as an OpenAI-compatible provider, using OpenAIChat.protocol (packages/llm/src/protocols/openai-compatible-chat.ts:17-22). This protocol has no support for provider-defined tools like web_search.
However, OpenCode's Anthropic Messages protocol (packages/llm/src/protocols/anthropic-messages.ts) already fully supports web_search as a provider-defined tool:
- Request lowering: converts
web_searchtool definitions →server_tool_useblocks (lines 281-303) - Response parsing: converts
web_search_tool_result→tool-resultevents withproviderExecuted: true(lines 614-636) - The V2 session runner already skips local dispatch for
providerExecutedtools (packages/core/src/session/runner/llm.ts:256)
This infrastructure is ready — it just needs DeepSeek to be connected to it.
Proposed Approach
Add a Dual-Protocol Route for DeepSeek
Register DeepSeek as an Anthropic Messages provider in addition to its existing OpenAI-compatible route. When web_search is in the request's tool set, route through the Anthropic-compatible endpoint (https://api.deepseek.com/anthropic) instead of the default OpenAI-compatible one.
This is similar to the xai provider pattern in packages/llm/src/providers/xai.ts, which exposes both chat() (OpenAI Chat) and responses() (OpenAI Responses) methods from a single provider facade.
Files to Modify
| File | Change |
|---|---|
packages/llm/src/providers/openai-compatible-profile.ts |
Add deepseekAnthropic profile with baseURL: "https://api.deepseek.com/anthropic" (3 lines) |
packages/llm/src/providers/openai-compatible.ts |
Add anthropic() method for DeepSeek, using AnthropicMessages.route (reference: xAI dual-route pattern) |
packages/opencode/src/session/llm/native-request.ts |
In the model() function (line 153), conditionally use Anthropic route when web_search is present (lines 165-178) |
packages/opencode/src/tool/registry.ts |
Conditionally inject web_search tool definition into request.tools for DeepSeek Anthropic route |
packages/core/src/session/runner/llm.ts |
Add web_search tool definition injection for DeepSeek at request.tools construction (lines 217-227) |
packages/core/src/session/runner/model.ts |
Add model resolution path for DeepSeek Anthropic route (lines 84-117) |
User Experience
- User connects to DeepSeek via
/connectas usual (no additional configuration) - All normal requests continue to use the OpenAI-compatible endpoint
- When the model decides web search is needed, the request automatically uses the Anthropic endpoint
- Only one
DEEPSEEK_API_KEYis needed — no third-party services
References
- DeepSeek Claude Code + Web Search docs: https://api-docs.deepseek.com/quick_start/agent_integrations/claude_code
- DeepSeek Anthropic API compatibility: https://api-docs.deepseek.com/guides/anthropic_api
- Anthropic Messages protocol support in OpenCode:
packages/llm/src/protocols/anthropic-messages.ts(lines 281-303, 614-636) - xAI dual-route pattern:
packages/llm/src/providers/xai.ts - Current DeepSeek profile:
packages/llm/src/providers/openai-compatible-profile.ts:10 - V2 runner provider-executed tool handling:
packages/core/src/session/runner/llm.ts:256
Activity
github-actions commentedon Jun 14, 2026
This issue might be a duplicate of existing issues. Please check:
Please review those issues to see if your request is already covered or can be tracked there.
Senpaiarham04 commentedon Jun 26, 2026
I would really appreciate it if you could add this feature. I can also assure you that it won't add much to your costs as a small business, because the web search is billed as usual—as a small number of tokens—through Deepseek, and they've made it very efficient. I really need to set up their web search; it would be a huge help.
sinfor1 commentedon Aug 1, 2026
hey guys,I meet same problems.That why I am here.
I find that opencode is f**king sh*t and no one responds
Now I back to claude code and use codex
maaoding commentedon Aug 5, 2026
Update (2026-08-06): Both halves of this feature have now landed upstream — the remaining gap is a small wiring change in the built-in DeepSeek profile.
1. DeepSeek officially shipped native web search (Jul 31, 2026)
DeepSeek's official announcement (X/@deepseek_ai + changelog) for the V4-Flash official release confirms native web search support. The Anthropic-compatible endpoint (
https://api.deepseek.com/anthropic) acceptsserver_tool_useblocks and returnsweb_search_tool_result— exactly the protocol path this issue asked for.2. OpenCode's runtime now handles provider-defined tools
Since the V2 runner rework, provider-hosted tools pass through untouched: tool-calls with
providerExecuted: trueskip local dispatch (see "Provider-defined / hosted tools" inpackages/llm/AGENTS.md).packages/llm/src/protocols/anthropic-messages.tsacceptsweb_searchas a provider-defined tool and encodes results back asserver_tool_use+web_search_tool_resultblocks.3. What's still missing: the built-in DeepSeek profile is registered as OpenAI-compatible
packages/llm/src/providers/openai-compatible-profile.tsstill maps deepseek →https://api.deepseek.com/v1(Chat Completions), and models.dev lists notoolscapability for DeepSeek models. So out of the box,/connect deepseekstill cannot exposeweb_search.Immediate workaround (works today): register DeepSeek as a custom Anthropic-protocol provider:
The Anthropic route lowers a declared
web_searchtool toserver_tool_useand DeepSeek executes it server-side.Ask: can the built-in DeepSeek profile be switched to the Anthropic protocol (or models.dev updated to mark DeepSeek with
web_searchtools)? DeepSeek's own integration docs already recommend opencode >= v1.14.24 for their Anthropic-compatible API, so this looks like a small change that closes the issue.github-actions commentedon Oct 6, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.