Ground model responses in real-time web data
The training data for large language models has a knowledge cutoff date, preventing them from answering real-time questions. Enabling web search lets a model retrieve real-time data from the internet and accurately answer time-sensitive questions, such as stock prices, weather forecasts, and breaking news.
Get an API key and set it as an environment variable.
For DashScope and Chat Completions, set
The Qwen3.8 Max, Flash, and open-source series, Qwen3.7-Flash, Qwen3.7-Plus, the Qwen3.6 series, and the Qwen3.5 series (including qwen3.5-plus, qwen3.5-flash, the qwen3.5-omni series, and Qwen open-source models) accept multimodal input (images, video) and are multimodal models.
Search strategy support varies by series: the qwen3.5-omni series supports only the
The following models support web search. Models with multimodal input (the Qwen3.8 series, Qwen3.7-Flash/Plus, the Qwen3.6 series, the Qwen3.5 series, and Qwen open-source models) must be called through the multimodal API. See Web search with multimodal models.
Supported models differ by region. Use an API key from the region you call. In Germany (Frankfurt), China (Hong Kong), and Japan (Tokyo), call from a workspace whose service deployment scope is Global.
Use the
When you set
Use these fields to render inline citations or a references list in your application. The model's response text may reference sources by index (e.g., "according to source [1]").
After a web search runs, the search sources are returned in the response. They appear in the element whose
Billing involves two aspects:
A: Search usage fields differ by protocol and model:
A: The web search results may contain controlled information that triggers content safety rules, causing the model to return the
If a call fails, see Error messages.
qwen4-max supports web search. Chat Completions does not support search_strategy: agent; use the Responses API web_search tool for multi-turn retrieval.
Enable web search
For DashScope and Chat Completions, set enable_search: true and configure agent or agent_max in search_options. For Responses and Anthropic, add the web_search tool.
- OpenAI compatible
- Responses API
- DashScope
- Anthropic-compatible
Set
enable_search: true and optionally pass search_options to choose a strategy.The OpenAI compatible Chat Completions endpoint does not return search sources. Use the Responses API or DashScope if you need citations.
Web search with multimodal models
The Qwen3.8 Max, Flash, and open-source series, Qwen3.7-Flash, Qwen3.7-Plus, the Qwen3.6 series, and the Qwen3.5 series (including qwen3.5-plus, qwen3.5-flash, the qwen3.5-omni series, and Qwen open-source models) accept multimodal input (images, video) and are multimodal models.
Search strategy support varies by series: the qwen3.5-omni series supports only the agent strategy; qwen4-max, qwen3.8-max, qwen3.8-max-0902, qwen3.8-flash, qwen3.8-2.4t-a95b, and qwen3.8-27b do not support the agent strategy on the multimodal API (use the default turbo or max)—to run Qwen3.8 with agent-style retrieval, use Web search with the Responses API; other models listed in this section support the turbo, max, and agent strategies. Call these models through the multimodal API (the multimodal-generation endpoint): use client.multimodal.chat.create in the Python SDK 2.0 and MultiModalConversation in Java, not the text-generation endpoint, which is for text-only models. For the basics of calling multimodal models, see the Visual reasoning and Image and video understanding topics.
- Calling the multimodal models above through the
text-generationendpoint returns400 url error, please check url. Use the multimodal API instead (themultimodal-generationendpoint;client.multimodal.chat.createin Python,MultiModalConversationin Java). - In the Java SDK,
MultiModalConversationParamprovidesenableSearch(true)to enable web search, but does not provide asearchOptions()method. Inject the search strategy and other options through the genericparameter("search_options", ...)method. In Python,client.multimodal.chat.createacceptssearch_optionsdirectly. - Web search on multimodal models requires streaming calls (use
streamCallin Java, or setstream=Truein Python); otherwise the request returns aNon-streaming mode does not support Web Searcherror.
Supported models
The following models support web search. Models with multimodal input (the Qwen3.8 series, Qwen3.7-Flash/Plus, the Qwen3.6 series, the Qwen3.5 series, and Qwen open-source models) must be called through the multimodal API. See Web search with multimodal models.
Supported models differ by region. Use an API key from the region you call. In Germany (Frankfurt), China (Hong Kong), and Japan (Tokyo), call from a workspace whose service deployment scope is Global.
- Singapore
- China North 2 (Beijing)
- Germany (Frankfurt)
- China (Hong Kong)
- Japan (Tokyo)
- US (Virginia)
Qwen
Third-party models
| Model series | Available models |
|---|---|
| Qwen4 series | qwen4-max (search_strategy: agent is not supported; for agent-style retrieval, use the web_search tool through the Responses or Anthropic API) |
| Qwen3.8 series | qwen3.8-max, qwen3.8-max-0902, qwen3.8-flash, qwen3.8-2.4t-a95b, qwen3.8-27b (search_strategy: agent is not supported; for agent-style retrieval, use the web_search tool through the Responses or Anthropic API) |
| Qwen3.7 series | qwen3.7-max, qwen3.7-max-preview, qwen3.7-max-2026-05-17 and later snapshots, qwen3.7-plus, qwen3.7-plus-2026-05-26 and later snapshots, qwen3.7-flash, qwen3.7-flash-2026-07-15 and later snapshots |
| Qwen3.6 series | qwen3.6-plus, qwen3.6-plus-2026-04-02 and later snapshots, qwen3.6-flash, qwen3.6-flash-2026-04-16 and later snapshots, qwen3.6-27b, qwen3.6-35b-a3b |
| Qwen3.5 series | qwen3.5-plus, qwen3.5-plus-2026-02-15 and later snapshots, qwen3.5-flash, qwen3.5-flash-2026-02-23 and later snapshots, qwen3.5-27b, qwen3.5-35b-a3b, qwen3.5-122b-a10b, qwen3.5-397b-a17b |
| Qwen-Omni | qwen3.8-omni-flash, qwen3.5-omni-plus, qwen3.5-omni-plus-2026-03-15, qwen3.5-omni-flash, qwen3.5-omni-flash-2026-03-15 (the search strategy must be set to agent) |
| Qwen-Omni-Realtime | qwen3.8-omni-flash-realtime, qwen3.5-omni-plus-realtime, qwen3.5-omni-plus-realtime-2026-03-15, qwen3.5-omni-flash-realtime, qwen3.5-omni-flash-realtime-2026-03-15 (the search strategy must be set to agent) |
| Provider | Available models |
|---|---|
| DeepSeek | deepseek-v4.1-flash, deepseek-v4.1-flash-1017, deepseek-v4-pro, deepseek-v4-pro-0813, deepseek-v4-flash-0731 (all listed models also support the agent / agent_max strategies and the web_search tool in the Responses and Anthropic APIs) |
| GLM | glm-5.2 (supported by the web_search tool in the Responses and Anthropic APIs) |
| Kimi | kimi-k3.1-pro (supports Responses web_search and Anthropic web_search; Chat Completions enable_search is not supported); kimi-k3 (supports Responses and Anthropic web_search; Chat Completions enable_search is not supported) |
Search strategies
Use the search_strategy field in search_options to choose the retrieval mode:
-
agent(default) -- Calls the web search tool and the model multiple times for multi-round information retrieval and integration. Suitable for complex queries and English scenarios. Applies to the Qwen3.5 series (including open-source models and the Omni series), the Qwen3.6 series, the Qwen3.7 series, and the DeepSeek V4/V4.1 series. Streaming calls are required when calling through the text endpoint. The Qwen3.8 series and Qwen4 do not supportagent; use theweb_searchtool through the Responses or Anthropic API instead. When enabled, onlyenable_source: true(returning search sources) is supported; other web search options are unavailable. Each invocation is billed additionally, see Billing. -
agent_max-- An enhanced multi-round mode that includes web search and web page extraction. Billed at the same rate asagent; web page extraction is free for a limited time.
agent is sufficient. For research or report generation that requires high accuracy and multi-source cross-validation, choose agent_max.
Read search results
When you set enable_source: true (DashScope only), the response includes a search_info.search_results array. Each entry contains:
| Field | Description |
|---|---|
index | Citation number referenced in the response text |
title | Page title of the source |
url | URL of the source |
Get search sources
After a web search runs, the search sources are returned in the response. They appear in the element whose type is web_search_call within the output array, and its action.sources field is the list of source links. You can extract them from the response in the example above as follows:
The Responses API does not support theenable_source,enable_citation, orcitation_formatparameters, and does not insert[1]citation markers into the response content. To use citation markers, use the DashScope API.
Billing
Billing involves two aspects:
- Model call fees: The web content from the web search is added to the prompt, which increases the number of input tokens for the model. You are charged based on the standard pricing of the model. For more information about pricing, see Pricing.
-
Search call fees (per 1,000 calls):
The
web_searchtool in the Responses and Anthropic APIs is billed at the same rate as theagentstrategy.The prices listed below are list prices. For current promotions and discounted pricing, visit the Model Marketplace.Strategy ( search_strategy)What it does Fee agent(default)Model searches the web as needed Singapore: $10.00. China North 2 (Beijing), Germany (Frankfurt), China (Hong Kong), Japan (Tokyo), US (Virginia): $0.573411 agent_max(limited-time offer)Includes web search and web extractor Singapore: $10.00. China North 2 (Beijing), Germany (Frankfurt), China (Hong Kong), Japan (Tokyo), US (Virginia): $0.573411. The web extractor is free for a limited time
Q: The number of web searches on the bill differs from the number returned by the API. How do I reconcile them?
A: Search usage fields differ by protocol and model:
- DashScope:
usage.plugins.search.count. - Chat Completions:
usage.x_tools.search.count. - Responses:
usage.x_tools.web_search.count/tool_usage.web_search.num_requests. - Anthropic:
usage.server_tool_use.web_search_requests.
count indicate that intent detection determined a web search was needed, not that retrieval completed. They may contain a count even when rate limits are reached or retrieval returns no results. num_requests and web_search_requests report the number of search requests returned by the API.
Billing is based on retrieval that the search service completes and returns successfully. API usage fields help you observe calls; use the issued bill to reconcile charges.
Q: After a web search, the model returns "unable to answer" or no response?
A: The web search results may contain controlled information that triggers content safety rules, causing the model to return the DataInspectionFailed error (HTTP 400) with the response "Sorry, I cannot answer this question". To troubleshoot, disable web search and resend the same query. If the model replies normally, the content returned by the search triggered the interception. Content safety interception is non-deterministic and depends on the specific content returned by the search; not all sensitive-topic queries trigger it.