Skip to content

Qwen Web Search

The Qwen series of models (such as qwen-max, qwen-plus, etc.) support real-time access to the internet via the Web Search tool and can automatically generate accurate answers with source citations based on multiple data sources.

This page references the official Web Search documentation to explain how to use Qwen's networking features on the new API platform, and adds information about some of its native advanced features.

Key Notes: - Our Platform Gateway for Qwen models is compatible with the official OpenAI interface specifications of Alibaba Cloud Bailian (DashScope), triggering networking capabilities by adding the "enable_search": true parameter in the request body. - Our Responses API also supports enabling the built-in networking function by injecting the type: "web_search_preview" tool.

Below, we will compare our platform's calling method with the advanced features provided by the native Qwen/Agent framework.


Quick Start

Our Platform Example

On this platform, if you use the standard chat interface to call the Qwen model, the easiest way is to pass the "enable_search": true parameter to /v1/chat/completions. The model will automatically trigger a search when needed.

curl https://api-cs-al.naci-tech.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
    "model": "qwen3-max",
    "messages": [
      { "role": "user", "content": "What is the weather like in Hangzhou today?" }
    ],
    "enable_search": true
  }'

Qwen Official and Advanced Features

Referring to the framework design of the official Web Search, the underlying networked search possesses capabilities such as aggregating multiple providers and precise citations. Although you only need to pass a simple parameter on this platform, understanding its underlying features will help you better understand the model's answer logic.

Supported Providers

In the native Qwen Agent environment (like Qwen Code), the web_search tool supports dynamically switching the underlying search engine via the provider parameter by default. The system will usually automatically downgrade and try others if a certain provider fails:

  1. DashScope (Default): Official free and high-quality engine.
  2. Tavily: Supports comprehensive long-form research and AI search services with inline answers.
  3. Google Custom Search: Suitable for specific fact-checking, using Google's retrieval quality.

In native development, the tool definition parameters are as follows:

Parameter Type Required Description
query string Yes The keywords to search for
provider string No Specify a specific provider, such as "dashscope", "tavily", "google"

Native logic example (for reference):

# Use default engine (DashScope)
web_search(query="best practices for React 19")

# Force switch to a specific engine for search
web_search(query="latest Node.js LTS version", provider="google")
web_search(query="latest advancements in AI", provider="tavily")

Citations & Response Format

A major feature of the Web Search tool is transparent source tracing.

  • Return Format: When the model uses networked information, it returns a concise answer with numbered source citations.
  • Inline Citations: Source links are appended directly to the response text as a numbered list, such as [1], [2].
  • If you use our platform's /v1/responses interface, you might also find web_search_call indicating a search was performed, and structured citations (url_citation) in the annotations output item in the response body.

Appendix: Function Calling

In addition to the built-in internet search tool of the platform, you can define your own business tools for Qwen (such as querying orders, querying databases), which are fully compatible with the OpenAI Function Calling format.

{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_order_status",
        "description": "Query order status",
        "parameters": {
          "type": "object",
          "properties": {
            "order_id": { "type": "string", "description": "Order ID" }
          },
          "required": ["order_id"]
        }
      }
    }
  ]
}

For more general instructions on tool calls, please refer to the tools overview document in this directory: index.md.