Web search
Retrieve current information through OpenAI or Anthropic search conventions.
The platform includes a search service using compliant data sources in China. Use either protocol convention below; the gateway searches, injects results, and generates an answer, without a separate search service of your own.
Web search is currently free for a limited time, with no additional search charge. Model tokens are metered as usual. Any future pricing will be announced in advance.
OpenAI protocol: web_search_options
Add web_search_options to a Chat Completions request:
resp = client.chat.completions.create(
model="deepseek/deepseek-v4-pro",
messages=[{"role": "user", "content": "What technology news is there in Hangzhou today?"}],
extra_body={"web_search_options": {}},
)Anthropic protocol: web_search tool
Declare the search tool in a Messages request’s tools:
{
"model": "z-ai/glm-5.2",
"max_tokens": 1024,
"tools": [{"type": "web_search_20250305", "name": "web_search", "max_uses": 3}],
"messages": [{"role": "user", "content": "What technology news is there in Hangzhou today?"}]
}Results are returned as native Anthropic server_tool_use / web_search_tool_result blocks. The search count appears in usage.server_tool_use.web_search_requests.
Claude Code’s WebSearch tool works out of the box. The platform automatically handles its search requests without additional configuration.
Notes
- Search adds latency because it requires another retrieval round trip.
- Specify freshness requirements, such as “today” or “latest”, to obtain more targeted queries.
- For complex agent requests with many custom tools, prefer the agent framework’s search tool, such as Claude Code WebSearch, rather than mixing search conventions in one request.