Web search

更新时间:
复制 MD 格式

The training data for large language models has a knowledge cutoff date, preventing them from answering real-time questions. Enabling web search lets the model retrieve real-time data and accurately answer time-sensitive questions, such as stock prices, weather forecasts, and breaking news.

Usage

You can enable web search using the three API calls below, each requiring different parameters.

For web search with models such as qwen3.7-plus and qwen3.7-max, use the web search feature of the Responses API.

OpenAI-compatible: Responses API

Add the web_search tool to the tools parameter to enable web search.

The Responses API only supports the Qwen3.7 Max series, Qwen3.6, Qwen3.5, qwen3-max, and qwen3-max-2026-01-23 models.
# Import dependencies and create a client...
response = client.responses.create(
    model="qwen3.7-max",
    input="Hangzhou weather",
    tools=[
        {"type": "web_search"},
        {"type": "web_extractor"},
        {"type": "code_interpreter"}
    ],
    extra_body={"enable_thinking": True}
)

OpenAI-compatible: Chat Completions API

Set enable_search: true to enable web search.

# Import dependencies and create a client...
completion = client.chat.completions.create(
    # Use a model that supports web search.
    model="qwen-plus",
    messages=[{"role": "user", "content": "What is the weather in Hangzhou tomorrow?"}],
    # Since enable_search is not a standard OpenAI parameter, pass it via extra_body when using the Python SDK. For the Node.js SDK, pass it as a top-level parameter.
    extra_body={"enable_search": True}
)

DashScope

Set enable_search: true to enable web search.

# Import dependencies...
response = dashscope.Generation.call(
    # If the DASHSCOPE_API_KEY environment variable is not set, replace the next line with your Model Studio API key (e.g., api_key="sk-xxx",).
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # Use a model that supports web search.
    model="qwen-plus",
    messages=[{"role": "user", "content": "What is the weather in Hangzhou tomorrow?"}],
    # Enable web search
    enable_search=True,
    result_format="message"
)

Supported models

Chinese mainland

  • Qwen

    • Qwen-Max

      • Qwen3.7-Max: qwen3.7-max, qwen3.7-max-preview, qwen3.7-max-2026-05-17 and later snapshots (Supported only by the Responses API)

      • Qwen3.6-Max: qwen3.6-max-preview

      • Qwen3-Max: qwen3-max, qwen3-max-2025-09-23 and later snapshots, qwen3-max-preview

      • Qwen-Max: qwen-max and later snapshots

    • Qwen-Plus

      • Qwen3.7-Plus: qwen3.7-plus, qwen3.7-plus-2026-05-26 and later snapshots (Supported only by the Responses API)

      • Qwen3.6-Plus: qwen3.6-plus, qwen3.6-plus-2026-04-02 and later snapshots (Supported only by the Responses API)

      • Qwen3.5-Plus: qwen3.5-plus, qwen3.5-plus-2026-02-15 and later snapshots

      • Qwen-Plus: qwen-plus, qwen-plus-latest, qwen-plus-2025-07-14 and later snapshots

    • Qwen-Flash

      • Qwen3.6-Flash: qwen3.6-flash, qwen3.6-flash-2026-04-16 and later snapshots (Supported only by the Responses API)

      • Qwen3.5-Flash: qwen3.5-flash, qwen3.5-flash-2026-02-23 and later snapshots

      • Qwen-Flash: qwen-flash, qwen-flash-2025-07-28 and later snapshots

    • Qwen-Turbo: qwen-turbo

    • QwQ: qwq-plus

    • Qwen-Omni: qwen3.5-omni-plus, qwen3.5-omni-plus-2026-03-15, qwen3.5-omni-flash, qwen3.5-omni-flash-2026-03-15

    • Qwen-Omni-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

    • Role-playing: qwen-plus-character, qwen-flash-character, qwen-flash-character-2026-02-26

    Qwen-Max, Qwen-Plus, and Qwen-Flash models released after July 2025 automatically support web search.

  • Third-party models

    • DeepSeek: deepseek-v4-pro, deepseek-v4-flash, deepseek-v3.2, deepseek-v3.2-exp, deepseek-v3.1, deepseek-r1-0528, deepseek-r1, deepseek-v3

    • Kimi: Moonshot-Kimi-K2-Instruct

    • MiniMax: MiniMax-M2.1

Global

  • Qwen-Max

    • Qwen3.7-Max: qwen3.7-max, qwen3.7-max-2026-05-20 and later snapshots (Supported only by the Responses API)

  • Qwen-Plus

    • Qwen3.7-Plus: qwen3.7-plus, qwen3.7-plus-2026-05-26 and later snapshots (Supported only by the Responses API)

    • Qwen3.6-Plus: qwen3.6-plus, qwen3.6-plus-2026-04-02 and later snapshots (Supported only by the Responses API)

    • Qwen3.5-Plus: qwen3.5-plus, qwen3.5-plus-2026-02-15 and later snapshots

  • Qwen-Flash

    • Qwen3.6-Flash: qwen3.6-flash, qwen3.6-flash-2026-04-16 and later snapshots (Supported only by the Responses API)

    • Qwen3.5-Flash: qwen3.5-flash, qwen3.5-flash-2026-02-23 and later snapshots

International

  • Qwen-Max

    • Qwen3.7-Max: qwen3.7-max, qwen3.7-max-2026-05-20 and later snapshots (Supported only by the Responses API)

  • Qwen-Plus

    • Qwen3.7-Plus: qwen3.7-plus, qwen3.7-plus-2026-05-26 and later snapshots (Supported only by the Responses API)

    • Qwen3.6-Plus: qwen3.6-plus, qwen3.6-plus-2026-04-02 and later snapshots (Supported only by the Responses API)

    • Qwen3.5-Plus: qwen3.5-plus, qwen3.5-plus-2026-02-15 and later snapshots

  • Qwen-Flash

    • Qwen3.6-Flash: qwen3.6-flash, qwen3.6-flash-2026-04-16 and later snapshots (Supported only by the Responses API)

    • Qwen3.5-Flash: qwen3.5-flash, qwen3.5-flash-2026-02-23 and later snapshots

  • qwen3-max and qwen3-max-2026-01-23

    • In non-thinking mode, the search strategy must be set to agent.

    • In thinking mode, the search strategy must be set to agent or agent_max (which adds web extractor support).

  • qwen3-max-2025-09-23: The search strategy must be set to agent.

  • Qwen-Omni: 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.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.

Quick start

This example shows how to query weather information using web search.

OpenAI compatible

Python

import os
from openai import OpenAI

client = OpenAI(
    # If the environment variable is not set, provide your Model Studio API key directly: api_key="sk-xxx",
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
    model="qwen-plus",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is the weather in Hangzhou tomorrow?"},
    ],
    extra_body={"enable_search": True}
)
print(completion.choices[0].message.content)
Sample response
According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:

- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.
- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.
- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.
- **Humidity**: Relative humidity of about 77%.
- **Air quality**: Good, with an air quality index of about 34 to 38.
- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.

In addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.

Please pay attention to the weather changes and adjust your travel and clothing plans accordingly.

Node.js

import OpenAI from "openai";

const openai = new OpenAI(
    {
        // If the environment variable is not set, provide your Model Studio API key directly: apiKey: "sk-xxx",
        apiKey: process.env.DASHSCOPE_API_KEY,
        // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
        baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
    }
);
async function main() {
    const completion = await openai.chat.completions.create({
        model: "qwen-plus",
        messages: [
            { role: "system", content: "You are a helpful assistant." },
            { role: "user", content: "What is the weather in Hangzhou tomorrow?" }
        ],
        enable_search:true
    });
    console.log(completion.choices[0].message.content);
}

main();
Sample response
According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:

- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.
- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.
- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.
- **Humidity**: Relative humidity of about 77%.
- **Air quality**: Good, with an air quality index of about 34 to 38.
- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.

In addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.

Please pay attention to the weather changes and adjust your travel and clothing plans accordingly.

Curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user", 
            "content": "What is the weather in Hangzhou tomorrow?"
        }
    ],
    "enable_search": true
}'

DashScope

Python

import os
import dashscope

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "What is the weather in Hangzhou tomorrow?"},
]
response = dashscope.Generation.call(
    # If the environment variable is not set, provide your Model Studio API key directly: api_key="sk-xxx",
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=messages,
    enable_search=True,
    result_format="message"
)
print(response["output"]["choices"][0]["message"]["content"])
Sample response
According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:

- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.
- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.
- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.
- **Humidity**: Relative humidity of about 77%.
- **Air quality**: Good, with an air quality index of about 34 to 38.
- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.

In addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.

Please pay attention to the weather changes and adjust your travel and clothing plans accordingly.

Java

// Use DashScope SDK version 2.19.4 or later.
import java.util.Arrays;
import com.alibaba.dashscope.aigc.generation.Generation;
import com.alibaba.dashscope.aigc.generation.GenerationParam;
import com.alibaba.dashscope.aigc.generation.GenerationResult;
import com.alibaba.dashscope.common.Message;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;

public class Main {
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
    static {Constants.baseHttpApiUrl="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1";}
    public static GenerationResult callWithMessage() throws ApiException, NoApiKeyException, InputRequiredException {
        Generation gen = new Generation();
        Message systemMsg = Message.builder()
                .role(Role.SYSTEM.getValue())
                .content("You are a helpful assistant.")
                .build();
        Message userMsg = Message.builder()
                .role(Role.USER.getValue())
                .content("What is the weather in Hangzhou tomorrow?")
                .build();
        GenerationParam param = GenerationParam.builder()
                // If the environment variable is not set, provide your Model Studio API key directly: .apiKey("sk-xxx")
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                .model("qwen-plus")
                .messages(Arrays.asList(systemMsg, userMsg))
                .resultFormat(GenerationParam.ResultFormat.MESSAGE)
                .enableSearch(true)
                .build();
        return gen.call(param);
    }
    public static void main(String[] args) {
        try {
            GenerationResult result = callWithMessage();
            System.out.println(result.getOutput().getChoices().get(0).getMessage().getContent());
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            System.err.println("An error occurred while calling the generation service: " + e.getMessage());
        }
    }
}
Sample response
According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:

- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.
- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.
- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.
- **Humidity**: Relative humidity of about 77%.
- **Air quality**: Good, with an air quality index of about 34 to 38.
- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.

In addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.

Please pay attention to the weather changes and adjust your travel and clothing plans accordingly.

Curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "input":{
        "messages":[      
            {
                "role": "system",
                "content": "You are a helpful assistant."
            },
            {
                "role": "user",
                "content": "What is the weather in Hangzhou tomorrow?"
            }
        ]
    },
    "parameters": {
        "enable_search": true,
        "result_format": "message"
    }
}'

Core features

In addition to basic search, web search supports advanced features such as forced search, search policy settings, and returning search sources. The DashScope protocol supports all of these features. By contrast, the OpenAI-compatible protocol does not support returning search sources or superscript annotation. The table below details these differences.

Feature

DashScope

OpenAI compatible: Chat completions

OpenAI compatible: Responses

basic web search

Supported

Supported

Supported

forced web search

Supported

Supported

Not supported

search volume strategy

Supported

Supported

Not supported

domain-specific search

Supported

Supported

Not supported

search timeliness

Supported

Supported

Not supported

source site restriction

Supported

Supported

Not supported

natural language scope control

Supported

Supported

Not supported

search source citation

Supported

Not supported

Not supported

citation markers

Supported

Not supported

Not supported

early source return

Supported

Not supported

Not supported

mixed text and image output

Supported

Supported

Not supported

Search strategy

Use the search_strategy parameter to balance cost, quality, and response speed.

Valid values for search_strategy:

  • turbo (default): Balances response speed and search quality. Suitable for most scenarios.

  • max: Uses a more comprehensive search strategy that queries multiple search engines for more detailed results but may increase response time.

  • agent: Integrates information over multiple rounds by repeatedly calling the web search tool and the large model.

    This strategy is only applicable to qwen3.5-plus, qwen3.5-plus-2026-02-15, qwen3.5-flash, qwen3.5-flash-2026-02-23, qwen3-max, qwen3-max-2026-01-23, qwen3-max-2025-09-23, qwen3.5-omni-plus, qwen3.5-omni-plus-2026-03-15, qwen3.5-omni-flash, qwen3.5-omni-flash-2026-03-15, qwen3.5-omni-plus-realtime, qwen3.5-omni-plus-realtime-2026-03-15, qwen3.5-omni-flash, and qwen3.5-omni-flash-realtime-2026-03-15.
    When this strategy is enabled, only return search sources (enable_source: true) is supported. Other web search features are unavailable.
    Enabling this strategy incurs an additional fee per call. For more information, see billing.
  • agent_max: Expands on the agent strategy by adding support for the web extractor. For more information, see web extractor.

    This strategy is only applicable to the thinking mode of qwen3-max and qwen3-max-2026-01-23.
    When this strategy is enabled, only return search sources (enable_source: true) is supported. Other web search features are unavailable.
    Enabling this strategy incurs an additional fee per call. For more information, see billing.

Use the default turbo strategy for routine queries. For high-precision tasks like research or report generation that require multi-source cross-validation, choose the max or agent strategy. The agent strategy is particularly effective for queries in English.

OpenAI compatible

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
    model="qwen-plus",
    messages=[
        {"role": "user", "content": "What models did Qwen release in September 2025?"},
    ],
    extra_body={
        "enable_search": True,
        "search_options": {
            "search_strategy": "max"  # Use the "max" strategy for more comprehensive results
        }
    }
)
print(completion.choices[0].message.content)
Sample response
Based on the information from the knowledge base, Alibaba released the following models in September 2025:

1. **Qwen3-Max-Preview**:
   - Release Date: September 5, 2025.
   - Features: This is the first model in the Qwen series with over **1 trillion** parameters, marking a major breakthrough for Chinese AI technology in the field of ultra-large-scale models.
   - Other Functions: Supports a context window of up to 256K tokens and covers over 100 languages.

2. **Qwen3-Next**:
   - Release Date: September 12, 2025.
   - Architectural Features: Adopts a **high-sparsity Mixture-of-Experts (MoE) architecture**, with a total of 80 billion (80B) parameters, but activates only 3 billion parameters for each inference, significantly reducing inference cost.
   - Performance: Performance is comparable to the 235-billion-parameter Qwen3 flagship model, while training cost is reduced by over 90% compared to the previous dense model (Qwen3-32B).
   - Technical Innovations: Introduces a hybrid attention mechanism and a multi-token prediction mechanism, significantly improving long-text processing efficiency and inference speed (in 32K+ context scenarios, the speed is more than 10 times that of Qwen3-32B).

3. **Qwen3-Next-80B-A3B Series Models**:
   - Developed based on the Qwen3-Next architecture and open-sourced concurrently.
   - Features: Supports an ultra-long context of millions of tokens, suitable for complex tasks and large-scale data processing.

Summary:
- **Qwen3-Max-Preview** is an ultra-large-scale model focused on achieving a new milestone in parameter count.
- **Qwen3-Next** and its series of models (such as Qwen3-Next-80B-A3B) achieve a better balance between performance, efficiency, and cost through architectural innovation.

Node.js

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: process.env.DASHSCOPE_API_KEY,
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
    baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
});

async function main() {
    const completion = await openai.chat.completions.create({
        model: "qwen-plus",
        messages: [
            { role: "user", content: "What models did Qwen release in September 2025?" }
        ],
        enable_search: true,
        search_options: {
            search_strategy: "max" // Use the "max" strategy for more comprehensive results
        }
    });
    console.log(completion.choices[0].message.content);
}

main();
Sample response
Based on the information from the knowledge base, Alibaba released the following models in September 2025:

1. **Qwen3-Max-Preview**:
   - Release Date: September 5, 2025.
   - Features: This is the first model in the Qwen series with over **1 trillion** parameters, marking a major breakthrough for Chinese AI technology in the field of ultra-large-scale models.
   - Other Functions: Supports a context window of up to 256K tokens and covers over 100 languages.

2. **Qwen3-Next**:
   - Release Date: September 12, 2025.
   - Architectural Features: Adopts a **high-sparsity Mixture-of-Experts (MoE) architecture**, with a total of 80 billion (80B) parameters, but activates only 3 billion parameters for each inference, significantly reducing inference cost.
   - Performance: Performance is comparable to the 235-billion-parameter Qwen3 flagship model, while training cost is reduced by over 90% compared to the previous dense model (Qwen3-32B).
   - Technical Innovations: Introduces a hybrid attention mechanism and a multi-token prediction mechanism, significantly improving long-text processing efficiency and inference speed (in 32K+ context scenarios, the speed is more than 10 times that of Qwen3-32B).

3. **Qwen3-Next-80B-A3B Series Models**:
   - Developed based on the Qwen3-Next architecture and open-sourced concurrently.
   - Features: Supports an ultra-long context of millions of tokens, suitable for complex tasks and large-scale data processing.

Summary:
- **Qwen3-Max-Preview** is an ultra-large-scale model focused on achieving a new milestone in parameter count.
- **Qwen3-Next** and its series of models (such as Qwen3-Next-80B-A3B) achieve a better balance between performance, efficiency, and cost through architectural innovation.

curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "messages": [
        {
            "role": "user", 
            "content": "What models did Qwen release in September 2025?"
        }
    ],
    "enable_search": true,
    "search_options": {
        "search_strategy": "max"
    }
}'
Sample response
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Based on the information from the knowledge base, Alibaba released the following models in September 2025:\n\n1. **Qwen3-Max-Preview**:\n   - Release Date: September 5, 2025.\n   - Features: This is the first model in the Qwen series with over **1 trillion** parameters, marking a major breakthrough for Chinese AI technology in the field of ultra-large-scale models.\n   - Other Functions: Supports a context window of up to 256K tokens and covers over 100 languages.\n\n2. **Qwen3-Next**:\n   - Release Date: September 12, 2025.\n   - Architectural Features: Adopts a **high-sparsity Mixture-of-Experts (MoE) architecture**, with a total of 80 billion (80B) parameters, but activates only 3 billion parameters for each inference, significantly reducing inference cost.\n   - Performance: Performance is comparable to the 235-billion-parameter Qwen3 flagship model, while training cost is reduced by over 90% compared to the previous dense model (Qwen3-32B).\n   - Technical Innovations: Introduces a hybrid attention mechanism and a multi-token prediction mechanism, significantly improving long-text processing efficiency and inference speed (in 32K+ context scenarios, the speed is more than 10 times that of Qwen3-32B).\n\n3. **Qwen3-Next-80B-A3B Series Models**:\n   - Developed based on the Qwen3-Next architecture and open-sourced concurrently.\n   - Features: Supports an ultra-long context of millions of tokens, suitable for complex tasks and large-scale data processing.\n\nSummary:\n- **Qwen3-Max-Preview** is an ultra-large-scale model focused on achieving a new milestone in parameter count.\n- **Qwen3-Next** and its series of models (such as Qwen3-Next-80B-A3B) achieve a better balance between performance, efficiency, and cost through architectural innovation."
      },
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null
    }
  ],
  "object": "chat.completion",
  "usage": {
    "prompt_tokens": 1789,
    "completion_tokens": 412,
    "total_tokens": 2201,
    "prompt_tokens_details": {
      "cached_tokens": 0
    }
  },
  "created": 1758011574,
  "system_fingerprint": null,
  "model": "qwen-plus",
  "id": "chatcmpl-c87a80cc-8d89-4de8-9e50-370bc45fdd51"
}

DashScope

Python

import os
import dashscope

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
response = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=[{"role": "user", "content": "What models did Qwen release in September 2025?"}],
    enable_search=True,
    search_options={
        "search_strategy": "max",  # Use the "max" strategy for more comprehensive results
        "enable_source": True
    },
    result_format="message",
)
print("="*20 + "Search results" + "="*20)
for web in response.output.search_info["search_results"]:
    print(f"[{web['index']}]: [{web['title']}]({web['url']})")
print("="*20 + "Response content" + "="*20)
print(response.output.choices[0].message.content)
Sample response
====================Search results====================
[1]: [Alibaba continuously iterates on the QWEN3 model, Hang Seng TECH Index ETF (159742) continues to rise over 1.5%, aiming for a 7-day streak](https://baijiahao.baidu.com/s?id=1843294702563736079&wfr=spider&for=pc)
[2]: [Alibaba launches next-generation model architecture; Unitree's Wang Xingxing talks regrets | Fresh Tech News](https://baijiahao.baidu.com/s?id=1843023858158066280&wfr=spider&for=pc)
[3]: [Qwen releases Qwen3-Max-Preview, with over 1 trillion parameters](https://wallstreetcn.com/articles/3755053)
[4]: [Jefferies: Alibaba-W's new Qwen model is another milestone, AI theme begins...](https://finance.sina.com.cn/stock/hkstock/hkgg/2025-09-08/doc-infpumzk6212010.shtml?cre=tianyi&mod=pchp&loc=7&r=0&rfunc=52&tj=cxvertical_pc_hp&tr=12)
[5]: [Jefferies: Alibaba-W's new Qwen model is another milestone, AI theme begins...](https://finance.sina.com.cn/stock/hkstock/hkgg/2025-09-08/doc-infpumzk6212010.shtml?cre=tianyi&mod=pchp&loc=9&r=0&rfunc=64&tj=cxvertical_pc_hp&tr=12)
[6]: [Industry Watch|Two major iterations in 85 days, why is Alibaba's large model racing against global speed?](https://baijiahao.baidu.com/s?id=1838706037923454039&wfr=spider&for=pc)
[7]: [The Complete Guide to Qwen-Image: 2025's Strongest Text-Rendering AI Image Generation Model...](https://www.cnblogs.com/sing1ee/p/19022727/2025-qwen-image)
[8]: [In-depth analysis of Alibaba's Qwen3-Next large model: 80B parameters, 3B activation, 10x cost reduction, 10x speed increase!](https://zhuanlan.zhihu.com/p/1950159852463687349)
[9]: [The "2025 Large Model Service Provider Capability Ranking" is released: Covering hundreds of model services from over 20 large model service providers](https://baijiahao.baidu.com/s?id=1843140062741335131&wfr=spider&for=pc)
[10]: [Qwen Model Release Timeline: 2023-2025](https://mylens.ai/space/zc02520s-workspace-hclkbo/qwen%E6%A8%A1%E5%9E%8B%E5%8F%91%E5%B8%83%E6%97%B6%E9%97%B4%E7%BA%BF-jenflw)
====================Response content====================
Based on public information from September 2025, the Alibaba Cloud Qwen team released the following important models:

1.  **Qwen3-Next Series Models (Released on September 12)**:
    *   On September 12, Qwen released the next-generation foundation model architecture **Qwen3-Next** and open-sourced the **Qwen3-Next-80B-A3B** series models based on this architecture.
    *   The model uses an innovative hybrid attention mechanism and a high-sparsity MoE structure. It has a total of 80 billion (80B) parameters but activates only 3 billion (3B) for each inference, significantly reducing computational costs.
    *   Its core advantage lies in a massive efficiency boost: training cost is reduced by over 90% compared to previous dense models, long-text inference throughput is increased by more than 10 times, and it supports an ultra-long context of millions of tokens.

In addition, an important update was released in early September:

*   **Qwen3-Max-Preview Model (Launched on September 5)**:
    *   This model has over 1 trillion parameters, supports a context window of up to 256K tokens, and is available for API calls on Alibaba Cloud Model Studio.

In summary, the most significant release for Qwen in September 2025 was the **revolutionary and efficient Qwen3-Next architecture and its Qwen3-Next-80B-A3B series models, launched on September 12**.

Java

import com.alibaba.dashscope.aigc.generation.Generation;
import com.alibaba.dashscope.aigc.generation.GenerationParam;
import com.alibaba.dashscope.aigc.generation.GenerationResult;
import com.alibaba.dashscope.aigc.generation.SearchOptions;
import com.alibaba.dashscope.common.Message;
import com.alibaba.dashscope.common.Role;
import java.util.Arrays;

public class Main {
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
    static {Constants.baseHttpApiUrl="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1";}
    public static void main(String[] args) {
        Generation gen = new Generation();
        Message userMsg = Message.builder()
                .role(Role.USER.getValue())
                .content("What models did Qwen release in September 2025?")
                .build();

        SearchOptions searchOptions = SearchOptions.builder()
                .searchStrategy("max") // Use the "max" strategy for more comprehensive results
                .enableSource(true)
                .build();

        GenerationParam param = GenerationParam.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                .model("qwen-plus")
                .messages(Arrays.asList(userMsg))
                .resultFormat(GenerationParam.ResultFormat.MESSAGE)
                .enableSearch(true)
                .searchOptions(searchOptions)
                .build();
        try {
            GenerationResult result = gen.call(param);
            System.out.println("=".repeat(20)+"Search results"+"=".repeat(20));
            System.out.println(result.getOutput().getSearchInfo().getSearchResults());
            System.out.println("=".repeat(20)+"Response content"+"=".repeat(20));
            System.out.println(result.getOutput().getChoices().get(0).getMessage().getContent());
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}
Sample response
====================Search results====================
[SearchInfo.SearchResult(siteName=Zhihu, icon=https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=493147230,3096476255&fm=195&app=88&f=JPEG?w=200&h=200, index=1, title=Alibaba's Qwen3-Next Technical Analysis: High-Sparsity MoE Architecture Leads New Trend in Large Models!, url=https://zhuanlan.zhihu.com/p/1950881062403184335), SearchInfo.SearchResult(siteName=Zhihu, icon=https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=493147230,3096476255&fm=195&app=88&f=JPEG?w=200&h=200, index=2, title=Qwen3-Next: Alibaba's Qwen Wields a 'Magic Wand' to Forge a New AI Cornerstone!, url=https://zhuanlan.zhihu.com/p/1949926096301696837), SearchInfo.SearchResult(siteName=Sohu.com, icon=https://b.bdstatic.com/searchbox/mappconsole/image/20190429/a68f8bb8-95b8-406a-8463-b6d029c66170.jpg, index=3, title=Alibaba Releases Qwen3-Next Series Models, Four Major Architectural Innovations Lead New AI Trend, url=https://www.sohu.com/a/934235058_121956424), SearchInfo.SearchResult(siteName=Baijiahao, icon=https://baijiahao.baidu.com/favicon.ico, index=4, title=Alibaba continuously iterates on QWEN3 model, Hang Seng TECH Index ETF (159742) continues to rise over 1.5%, aiming for a 7-day streak, url=https://baijiahao.baidu.com/s?id=1843294702563736079&wfr=spider&for=pc), SearchInfo.SearchResult(siteName=Baijiahao, icon=https://baijiahao.baidu.com/favicon.ico, index=5, title=Alibaba launches next-generation model architecture; Unitree's Wang Xingxing talks regrets | Fresh Tech News, url=https://baijiahao.baidu.com/s?id=1843023858158066280&wfr=spider&for=pc), SearchInfo.SearchResult(siteName=, icon=, index=6, title=Qwen releases Qwen3-Max-Preview, with over 1 trillion parameters, url=https://wallstreetcn.com/articles/3755053), SearchInfo.SearchResult(siteName=Sohu.com, icon=https://b.bdstatic.com/searchbox/mappconsole/image/20190429/a68f8bb8-95b8-406a-8463-b6d029c66170.jpg, index=7, title=Qwen3-Next Released! Strongly Supported by Ascend, a New Era of AI Models Begins, url=https://news.sohu.com/a/934399340_122004016), SearchInfo.SearchResult(siteName=Sina.com, icon=https://img.alicdn.com/imgextra/i2/O1CN01mvEkNg1mbgbrppM5C_!!6000000004973-55-tps-32-32.svg, index=8, title=Jefferies: Alibaba-W's new Qwen model is another milestone, AI theme begins ..., url=https://finance.sina.com.cn/stock/hkstock/hkgg/2025-09-08/doc-infpumzk6212010.shtml?cre=tianyi&mod=pchp&loc=7&r=0&rfunc=52&tj=cxvertical_pc_hp&tr=12), SearchInfo.SearchResult(siteName=Sina.com, icon=https://img.alicdn.com/imgextra/i2/O1CN01mvEkNg1mbgbrppM5C_!!6000000004973-55-tps-32-32.svg, index=9, title=Jefferies: Alibaba-W's new Qwen model is another milestone, AI theme begins ..., url=https://finance.sina.com.cn/stock/hkstock/hkgg/2025-09-08/doc-infpumzk6212010.shtml?cre=tianyi&mod=pchp&loc=9&r=0&rfunc=64&tj=cxvertical_pc_hp&tr=12), SearchInfo.SearchResult(siteName=Baijiahao, icon=https://baijiahao.baidu.com/favicon.ico, index=10, title=Jefferies: Alibaba's new Qwen model is another milestone, url=https://baijiahao.baidu.com/s?id=1842683950982961781&wfr=spider&for=pc)]
====================Response content====================
In September 2025, Alibaba released the following models:

1. **Qwen3-Max-Preview**  
   - Release Date: September 5, 2025  
   - Features: This is the first model in the Qwen series with over **1 trillion** parameters, supports a context window of up to 256K tokens, and covers over 100 languages. It has demonstrated outstanding performance on multiple mainstream authoritative benchmarks, marking a major breakthrough for Chinese AI technology in the field of ultra-large-scale models.

2. **Qwen3-Next**  
   - Release Date: September 12, 2025  
   - Features: As a next-generation foundation model architecture, Qwen3-Next uses a revolutionary **high-sparsity Mixture-of-Experts (MoE) architecture**. It has a total of 80 billion parameters but activates only 3 billion for each inference, drastically reducing computational costs. In terms of performance, it is comparable to the 235-billion-parameter Qwen3 flagship model, with training costs reduced by over 90%.

3. **Qwen3-Next-80B-A3B Series Models**  
   - Release Date: September 12, 2025  
   - Features: Built on the Qwen3-Next architecture, these models support an ultra-long context (million-token level) and boast a 10x increase in inference throughput. They use an innovative **hybrid attention mechanism** to balance speed and effectiveness in long-text processing, leading to significantly improved inference efficiency.

The release of these models signifies Qwen's technological iteration and breakthroughs in the field of large AI models, driving the development of AI applications across various domains.

curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "input":{
        "messages":[      
            {
                "role": "user",
                "content": "What models did Qwen release in September 2025?"
            }
        ]
    },
    "parameters": {
        "enable_search": true,
        "search_options": {
            "search_strategy": "max",
            "enable_source": true
        },
        "result_format": "message"
    }
}'
Sample response
{
  "output": {
    "choices": [
      {
        "message": {
          "content": "Based on the provided information, Alibaba's Qwen series released the following models in September 2025:\n\n1. **Qwen3-Next**: This is a next-generation foundation model architecture featuring a revolutionary high-sparsity Mixture-of-Experts (MoE) architecture. Qwen3-Next has a total of 80 billion parameters but activates only 3 billion for each inference, significantly reducing training costs and improving inference efficiency.\n\n2. **Qwen3-Next-80B-A3B Series Models**: This includes the Qwen3-Next-80B-A3B-Instruct and Qwen3-Next-80B-A3B-Thinking models. Both are trained based on the Qwen3-Next-80B-A3B-Base model, which has 80 billion parameters and 3 billion activated parameters.\n\n3. **Qwen3-Max-Preview**: This is a model with over 1 trillion parameters, supporting a context window of up to 256K tokens and covering over 100 languages. This model is available on the Alibaba Cloud Model Studio platform via an API, and Qwen Chat has also launched the new model for free use.\n\nThese model releases demonstrate Alibaba's continuous innovation and technological progress in the large model field, especially in achieving significant improvements in model efficiency and cost reduction.",
          "role": "assistant"
        },
        "finish_reason": "stop"
      }
    ],
    "search_info": {
      "extra_tool_info": [],
      "search_results": [
        {
          "icon": "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=493147230,3096476255&fm=195&app=88&f=JPEG?w=200&h=200",
          "site_name": "Zhihu",
          "index": 1,
          "title": "Alibaba's Qwen3-Next Technical Analysis: High-Sparsity MoE Architecture Leads New Trend in Large Models!",
          "url": "https://zhuanlan.zhihu.com/p/1950881062403184335"
        },
        {
          "icon": "https://baijiahao.baidu.com/favicon.ico",
          "site_name": "Baijiahao",
          "index": 2,
          "title": "Alibaba launches next-generation model architecture; Unitree's Wang Xingxing talks regrets | Fresh Tech News",
          "url": "https://baijiahao.baidu.com/s?id=1843023858158066280&wfr=spider&for=pc"
        },
        {
          "icon": "",
          "site_name": "",
          "index": 3,
          "title": "Qwen releases Qwen3-Max-Preview, with over 1 trillion parameters",
          "url": "https://wallstreetcn.com/articles/3755053"
        },
        {
          "icon": "https://img.alicdn.com/imgextra/i2/O1CN01mvEkNg1mbgbrppM5C_!!6000000004973-55-tps-32-32.svg",
          "site_name": "Sina.com",
          "index": 4,
          "title": "Jefferies: Alibaba-W's new Qwen model is another milestone, AI theme begins ...",
          "url": "https://finance.sina.com.cn/stock/hkstock/hkgg/2025-09-08/doc-infpumzk6212010.shtml?cre=tianyi&mod=pchp&loc=7&r=0&rfunc=52&tj=cxvertical_pc_hp&tr=12"
        },
        {
          "icon": "https://img.alicdn.com/imgextra/i2/O1CN01mvEkNg1mbgbrppM5C_!!6000000004973-55-tps-32-32.svg",
          "site_name": "Sina.com",
          "index": 5,
          "title": "Jefferies: Alibaba-W's new Qwen model is another milestone, AI theme begins ...",
          "url": "https://finance.sina.com.cn/stock/hkstock/hkgg/2025-09-08/doc-infpumzk6212010.shtml?cre=tianyi&mod=pchp&loc=9&r=0&rfunc=64&tj=cxvertical_pc_hp&tr=12"
        },
        {
          "icon": "https://baijiahao.baidu.com/favicon.ico",
          "site_name": "Baijiahao",
          "index": 6,
          "title": "Industry Watch|Two major iterations in 85 days, why is Alibaba's large model racing against global speed?",
          "url": "https://baijiahao.baidu.com/s?id=1838706037923454039&wfr=spider&for=pc"
        },
        {
          "icon": "https://img.alicdn.com/imgextra/i2/O1CN01FzHbv01o253A3z2Gd_!!6000000005166-55-tps-32-32.svg",
          "site_name": "CNBlogs",
          "index": 7,
          "title": "The Complete Guide to Qwen-Image: 2025's Strongest Text-Rendering AI Image Generation Model ...",
          "url": "https://www.cnblogs.com/sing1ee/p/19022727/2025-qwen-image"
        },
        {
          "icon": "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=493147230,3096476255&fm=195&app=88&f=JPEG?w=200&h=200",
          "site_name": "Zhihu",
          "index": 8,
          "title": "In-depth analysis of Alibaba's Qwen3-Next large model: 80B parameters, 3B activation, 10x cost reduction, 10x speed increase!",
          "url": "https://zhuanlan.zhihu.com/p/1950159852463687349"
        },
        {
          "icon": "https://developer.aliyun.com/favicon.ico",
          "site_name": "Alibaba Cloud.",
          "index": 9,
          "title": "# TTFT Performance Comparison and Underlying Principles of Qwen3-8B and Qwen3-14B",
          "url": "https://developer.aliyun.com/article/1672506"
        },
        {
          "icon": "",
          "site_name": "",
          "index": 10,
          "title": "Qwen Model Release Timeline: 2023-2025",
          "url": "https://mylens.ai/space/zc02520s-workspace-hclkbo/qwen%E6%A8%A1%E5%9E%8B%E5%8F%91%E5%B8%83%E6%97%B6%E9%97%B4%E7%BA%BF-jenflw"
        }
      ]
    }
  },
  "usage": {
    "total_tokens": 2614,
    "output_tokens": 280,
    "input_tokens": 2334,
    "plugins": {
      "search": {
        "count": 1
      }
    },
    "prompt_tokens_details": {
      "cached_tokens": 0
    }
  },
  "request_id": "9fe63fe8-d274-4e6b-9249-5783449dc27a"
}

Forced web search

By default, the model decides whether to perform a web search. For use cases that rely on real-time information, you can set the forced_search parameter to true to force a web search.

Valid values for forced_search:

  • true: Forces a web search.

  • false (default): The model decides whether to perform a web search.

OpenAI compatible

Python

Note

For the Python SDK, pass enable_search in extra_body. For the Node.js SDK, pass it as a top-level parameter.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Configuration varies by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
    model="qwen-plus",
    messages=[
        {"role": "user", "content": "What's the weather in Hangzhou tomorrow?"},
    ],
    extra_body={
        "enable_search": True,
        "search_options": {
            "forced_search": True  # Force web search
        }
    }
)
print(completion.choices[0].message.content)
Sample response
According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:

- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.
- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.
- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.
- **Humidity**: Relative humidity of about 77%.
- **Air quality**: Good, with an air quality index of about 34 to 38.
- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.

In addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.

Please pay attention to the weather changes and adjust your travel and clothing plans accordingly.

Node.js

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: process.env.DASHSCOPE_API_KEY,
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Configuration varies by region.
    baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
});

async function main() {
    const completion = await openai.chat.completions.create({
        model: "qwen-plus",
        messages: [
            { role: "user", content: "What's the weather in Hangzhou tomorrow?" }
        ],
        enable_search: true,
        search_options: {
            forced_search: true // Force web search
        }
    });
    console.log(completion.choices[0].message.content);
}

main();
Sample response
According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:

- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.
- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.
- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.
- **Humidity**: Relative humidity of about 77%.
- **Air quality**: Good, with an air quality index of about 34 to 38.
- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.

In addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.

Please pay attention to the weather changes and adjust your travel and clothing plans accordingly.

Curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Configuration varies by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "messages": [
        {
            "role": "user", 
            "content": "What's the weather in Hangzhou tomorrow?"
        }
    ],
    "enable_search": true,
    "search_options": {
        "forced_search": true
    }
}'
Sample response
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:\n\n- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.\n- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.\n- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.\n- **Humidity**: Relative humidity of about 77%.\n- **Air quality**: Good, with an air quality index of about 34 to 38.\n- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.\n\nIn addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.\n\nPlease pay attention to the weather changes and adjust your travel and clothing plans accordingly."
      },
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null
    }
  ],
  "object": "chat.completion",
  "usage": {
    "prompt_tokens": 3175,
    "completion_tokens": 188,
    "total_tokens": 3363,
    "prompt_tokens_details": {
      "cached_tokens": 0
    }
  },
  "created": 1758007390,
  "system_fingerprint": null,
  "model": "qwen-plus",
  "id": "chatcmpl-b709e5ff-ba5d-4afe-a93d-33b6962e232a"
}

DashScope

Python

import os
import dashscope

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Configuration varies by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
response = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=[{"role": "user", "content": "What's the weather in Hangzhou tomorrow?"}],
    enable_search=True,
    search_options={
        "forced_search": True  # Force web search
    },
    result_format="message"
)
print(response["output"]["choices"][0]["message"]["content"])
Sample response
According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:

- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.
- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.
- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.
- **Humidity**: Relative humidity of about 77%.
- **Air quality**: Good, with an air quality index of about 34 to 38.
- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.

In addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.

Please pay attention to the weather changes and adjust your travel and clothing plans accordingly.

Java

// Use DashScope SDK version 2.19.4 or later.
import com.alibaba.dashscope.aigc.generation.Generation;
import com.alibaba.dashscope.aigc.generation.GenerationParam;
import com.alibaba.dashscope.aigc.generation.GenerationResult;
import com.alibaba.dashscope.aigc.generation.SearchOptions;
import com.alibaba.dashscope.common.Message;
import com.alibaba.dashscope.common.Role;
import java.util.Arrays;

public class Main {
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Configuration varies by region.
    static {Constants.baseHttpApiUrl="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1";}
    public static void main(String[] args) {
        Generation gen = new Generation();
        Message userMsg = Message.builder()
                .role(Role.USER.getValue())
                .content("What's the weather in Hangzhou tomorrow?")
                .build();
        
        SearchOptions searchOptions = SearchOptions.builder()
                .forcedSearch(true) // Force web search
                .build();
                
        GenerationParam param = GenerationParam.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                .model("qwen-plus")
                .messages(Arrays.asList(userMsg))
                .resultFormat(GenerationParam.ResultFormat.MESSAGE)
                .enableSearch(true)
                .searchOptions(searchOptions)
                .build();
        try {
            GenerationResult result = gen.call(param);
            System.out.println(result.getOutput().getChoices().get(0).getMessage().getContent());
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}
Sample response
According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:

- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.
- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.
- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.
- **Humidity**: Relative humidity of about 77%.
- **Air quality**: Good, with an air quality index of about 34 to 38.
- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.

In addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.

Please pay attention to the weather changes and adjust your travel and clothing plans accordingly.

Curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Configuration varies by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "input":{
        "messages":[      
            {
                "role": "user",
                "content": "What's the weather in Hangzhou tomorrow?"
            }
        ]
    },
    "parameters": {
        "enable_search": true,
        "search_options": {
            "forced_search": true
        },
        "result_format": "message"
    }
}'
Sample response
{
  "output": {
    "choices": [
      {
        "message": {
          "content": "According to the available data, the weather forecast for Hangzhou on September 17, 2025 (tomorrow) is as follows:\n\n- **Weather conditions**: Partly cloudy to clear, with a chance of light rain in some areas.\n- **Temperature**: Daytime high of about 30°C to 34°C, nighttime low of about 24°C to 26°C.\n- **Wind**: Light winds, generally from the east, southeast, or west, with speeds less than level 3.\n- **Humidity**: Relative humidity of about 77%.\n- **Air quality**: Good, with an air quality index of about 34 to 38.\n- **Clothing suggestion**: We recommend wearing cool and breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts.\n\nIn addition, a cold front will arrive in Zhejiang tomorrow afternoon and evening, gradually bringing cooler temperatures, but the high temperatures will persist until the afternoon. Starting from the 18th, the high temperatures across the province will completely subside.\n\nPlease pay attention to the weather changes and adjust your travel and clothing plans accordingly.",
          "role": "assistant"
        },
        "finish_reason": "stop"
      }
    ]
  },
  "usage": {
    "total_tokens": 4051,
    "output_tokens": 197,
    "input_tokens": 3854,
    "plugins": {
      "search": {
        "count": 1
      }
    },
    "prompt_tokens_details": {
      "cached_tokens": 0
    }
  },
  "request_id": "1b328f53-21d1-4b64-a543-201d367617b4"
}

Source citations

You can configure web search to include source links and citation markers in responses to make information easier to trace.

  1. Return sources: Set enable_source: true. The search_info field in the response will then contain a list of search results.

  2. Enable citation markers: When enable_source is set to true, set enable_citation: true to include citation markers, such as [1], in the response.

  3. Set the citation style: Use the citation_format parameter. Available options include:

    • "[<number>]" (default): The style is [1].

    • "[ref_<number>]": The style is [ref_1].

This feature is available for DashScope API calls only.

To get and cite sources with models such as qwen3.7-plus and qwen3.7-max, use the web search feature of the Responses API.

Python

import os
import dashscope

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configurations vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
response = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY", "YOUR_API_KEY"),
    model="qwen-plus",
    messages=[{"role": "user", "content": "What is the weather in Hangzhou tomorrow?"}],
    enable_search=True,
    search_options={
        "enable_source": True,       # Required to use citation markers.
        "enable_citation": True,     # Enables citation markers.
        "citation_format": "[ref_<number>]", # Sets the citation style.
    },
    result_format="message"
)

print("="*20 + "Search Results" + "="*20)
for web in response.output.search_info["search_results"]:
    print(f"[{web['index']}]: [{web['title']}]({web['url']})")
print("="*20 + "Response Content" + "="*20)
print(response.output.choices[0].message.content)
Sample response
====================Search Results====================
[1]: [Dropping nearly 10°C! Confirmed: cold air is about to arrive, and it's strong](https://cj.sina.com.cn/articles/view/1665450974/6344c3de01901avjw)
[2]: [Dropping nearly 10°C! Confirmed: cold air is about to arrive, and it's strong](https://hznews.hangzhou.com.cn/chengshi/content/2025-09/15/content_9083259.htm)
[3]: [Hangzhou Weather Query for September 2025](https://www.ip.cn/tianqi/zhejiang/hangzhou/202509.html)
[4]: [40-Day Weather Forecast](http://uc.src.weather.com.cn/mweather40d/index.shtml?10121010103A)
[5]: [Hangzhou Weather Forecast for September 18, 2025](https://tianqi.eastday.com/tianqi/hangzhou/20250918.html)
[6]: [Hangzhou Weather Query for September 2024](https://www.ip.cn/tianqi/zhejiang/hangzhou/202409.html)
[7]: [The scent of autumn is in the air; the long-awaited first fragrance of osmanthus has finally arrived in Hangzhou](https://baijiahao.baidu.com/s?id=1843471369098538519&wfr=spider&for=pc)
[8]: [Yuhang District Historical Weather Records for September 2024](https://www.ip.cn/tianqi/zhejiang/hangzhou/yuhang/202409.html)
====================Response Content====================
According to the latest weather information, the weather in Hangzhou tomorrow (September 18, 2025) is expected to be overcast to partly cloudy, with a high of 28°C and a low of 24°C. The wind will be light, coming from the northeast at about level 2. Additionally, air humidity will be relatively moderate, UV intensity will be low, and the air quality will be good, making it suitable for outdoor activities. However, it is advisable to check the latest weather forecast for the most accurate information[ref_5].

Java

import com.alibaba.dashscope.aigc.generation.*;
import com.alibaba.dashscope.common.Message;
import com.alibaba.dashscope.common.Role;
import java.util.Arrays;

public class Main {
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configurations vary by region.
    static {Constants.baseHttpApiUrl="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1";}
    public static void main(String[] args) {
        Generation gen = new Generation();
        Message userMsg = Message.builder()
                .role(Role.USER.getValue())
                .content("What is the weather in Hangzhou tomorrow?")
                .build();

        SearchOptions searchOptions = SearchOptions.builder()
                .enableSource(true)       // Required to use citation markers.
                .enableCitation(true)     // Enables citation markers.
                .citationFormat("[ref_<number>]") // Sets the citation style.
                .build();

        GenerationParam param = GenerationParam.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                .model("qwen-plus")
                .messages(Arrays.asList(userMsg))
                .resultFormat(GenerationParam.ResultFormat.MESSAGE)
                .enableSearch(true)
                .searchOptions(searchOptions)
                .build();
        try {
            GenerationResult result = gen.call(param);
            System.out.println("=".repeat(20)+"Search Results"+"=".repeat(20));
            System.out.println(result.getOutput().getSearchInfo().getSearchResults());
            System.out.println("=".repeat(20)+"Response Content"+"=".repeat(20));
            System.out.println(result.getOutput().getChoices().get(0).getMessage().getContent());
        } catch (Exception e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}
Sample response
====================Search Results====================
[SearchInfo.SearchResult(siteName=Sina.com, icon=https://mbs1.bdstatic.com/searchbox/mappconsole/image/20220307/88eb511c-5c51-448a-a9b5-df6b24cda8c7.png, index=1, title=Dropping nearly 10°C! Confirmed: cold air is about to arrive, and it's strong, url=https://cj.sina.com.cn/articles/view/1665450974/6344c3de01901avjw), SearchInfo.SearchResult(siteName=Hangzhou.com.cn, icon=https://img.alicdn.com/imgextra/i1/O1CN01FcFnjf25PIbhq2c3q_!!6000000007518-73-tps-16-16.ico, index=2, title=Dropping nearly 10°C! Confirmed: cold air is about to arrive, and it's strong, url=https://hznews.hangzhou.com.cn/chengshi/content/2025-09/15/content_9083259.htm), SearchInfo.SearchResult(siteName=Xiamen Shikong Technology Co., Ltd., icon=http://www.ip.cn/favicon.ico, index=3, title=Hangzhou Weather Query for September 2025, url=https://www.ip.cn/tianqi/zhejiang/hangzhou/202509.html), SearchInfo.SearchResult(siteName=eastday, icon=https://img.alicdn.com/imgextra/i3/O1CN01kr9teP1wlRD8OH6TO_!!6000000006348-73-tps-16-16.ico, index=4, title=Hangzhou Weather Forecast for September 18, 2025, url=https://tianqi.eastday.com/tianqi/hangzhou/20250918.html), SearchInfo.SearchResult(siteName=None, icon=https://img.alicdn.com/imgextra/i2/O1CN01MJh8gM28s6MYPHsm6_!!6000000007987-2-tps-32-32.png, index=5, title=40-Day Weather Forecast, url=http://uc.src.weather.com.cn/mweather40d/index.shtml?10121010103A), SearchInfo.SearchResult(siteName=Xiamen Shikong Technology Co., Ltd., icon=http://www.ip.cn/favicon.ico, index=6, title=Hangzhou Weather Query for September 2024, url=https://www.ip.cn/tianqi/zhejiang/hangzhou/202409.html), SearchInfo.SearchResult(siteName=Baijiahao, icon=https://baijiahao.baidu.com/favicon.ico, index=7, title=The scent of autumn is in the air; the long-awaited first fragrance of osmanthus has finally arrived in Hangzhou, url=https://baijiahao.baidu.com/s?id=1843471369098538519&wfr=spider&for=pc), SearchInfo.SearchResult(siteName=Xiamen Shikong Technology Co., Ltd., icon=http://www.ip.cn/favicon.ico, index=8, title=Yuhang District Historical Weather Records for September 2024, url=https://www.ip.cn/tianqi/zhejiang/hangzhou/yuhang/202409.html)]
====================Response Content====================
According to the latest weather forecast, there will be a significant change in Hangzhou's weather tomorrow (September 18, 2025).

Due to the influence of cold air, the temperature in Hangzhou will drop sharply. The expected high is only around 28°C, a decrease of nearly 10°C from the recent high of 36°C[ref_1][ref_5]. A significant shower or thunderstorm is expected, followed by light rain and overcast skies[ref_3]. The air quality is rated as excellent to good, with ozone (O3) as the primary pollutant[ref_None]. Weather conditions are average, so caution is advised when driving, and it is not ideal for car washing[ref_None]. Additionally, while UV intensity is weak, applying sunscreen before going out is still recommended[ref_None].

curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "input":{
        "messages":[
            {
                "role": "user",
                "content": "What is the weather in Hangzhou tomorrow?"
            }
        ]
    },
    "parameters": {
        "enable_search": true,
        "search_options": {
            "enable_source": true,
            "enable_citation": true,
            "citation_format": "[ref_<number>]"
        },
        "result_format": "message"
    }
}'
Sample response
{
  "output": {
    "choices": [
      {
        "message": {
          "content": "According to available information, the weather in Hangzhou tomorrow (September 18, 2025) is expected to see a significant cooldown. The high temperature will drop by nearly 10°C to an expected high of only 28°C, or possibly even lower. However, another source indicates the temperature range for the day could be between 24°C and 34°C with overcast to partly cloudy conditions. It is recommended to wear cool, breathable clothing, such as cotton or linen shirts, light long skirts, or thin T-shirts[ref_1][ref_5]. Note that although the temperature will drop, the humidity will be high, which may make it feel quite muggy. After several days of high temperatures, this will be a relatively cooler day.",
          "role": "assistant"
        },
        "finish_reason": "stop"
      }
    ],
    "search_info": {
      "extra_tool_info": [],
      "search_results": [
        {
          "icon": "https://mbs1.bdstatic.com/searchbox/mappconsole/image/20220307/88eb511c-5c51-448a-a9b5-df6b24cda8c7.png",
          "site_name": "Sina.com",
          "index": 1,
          "title": "Dropping nearly 10°C! Confirmed: cold air is about to arrive, and it's strong",
          "url": "https://cj.sina.com.cn/articles/view/1665450974/6344c3de01901avjw"
        },
        {
          "icon": "https://img.alicdn.com/imgextra/i1/O1CN01FcFnjf25PIbhq2c3q_!!6000000007518-73-tps-16-16.ico",
          "site_name": "Hangzhou.com.cn",
          "index": 2,
          "title": "Dropping nearly 10°C! Confirmed: cold air is about to arrive, and it's strong",
          "url": "https://hznews.hangzhou.com.cn/chengshi/content/2025-09/15/content_9083259.htm"
        },
        {
          "icon": "http://www.ip.cn/favicon.ico",
          "site_name": "Xiamen Shikong Technology Co., Ltd.",
          "index": 3,
          "title": "Hangzhou Weather Query for September 2025",
          "url": "https://www.ip.cn/tianqi/zhejiang/hangzhou/202509.html"
        },
        {
          "icon": "https://img.alicdn.com/imgextra/i2/O1CN01MJh8gM28s6MYPHsm6_!!6000000007987-2-tps-32-32.png",
          "site_name": "None",
          "index": 4,
          "title": "40-Day Weather Forecast",
          "url": "http://uc.src.weather.com.cn/mweather40d/index.shtml?10121010103A"
        },
        {
          "icon": "https://img.alicdn.com/imgextra/i3/O1CN01kr9teP1wlRD8OH6TO_!!6000000006348-73-tps-16-16.ico",
          "site_name": "eastday",
          "index": 5,
          "title": "Hangzhou Weather Forecast for September 18, 2025",
          "url": "https://tianqi.eastday.com/tianqi/hangzhou/20250918.html"
        },
        {
          "icon": "http://www.ip.cn/favicon.ico",
          "site_name": "Xiamen Shikong Technology Co., Ltd.",
          "index": 6,
          "title": "Hangzhou Weather Query for September 2024",
          "url": "https://www.ip.cn/tianqi/zhejiang/hangzhou/202409.html"
        },
        {
          "icon": "https://baijiahao.baidu.com/favicon.ico",
          "site_name": "Baijiahao",
          "index": 7,
          "title": "The scent of autumn is in the air; the long-awaited first fragrance of osmanthus has finally arrived in Hangzhou",
          "url": "https://baijiahao.baidu.com/s?id=1843471369098538519&wfr=spider&for=pc"
        },
        {
          "icon": "http://www.ip.cn/favicon.ico",
          "site_name": "Xiamen Shikong Technology Co., Ltd.",
          "index": 8,
          "title": "Yuhang District Historical Weather Records for September 2024",
          "url": "https://www.ip.cn/tianqi/zhejiang/hangzhou/yuhang/202409.html"
        }
      ]
    }
  },
  "usage": {
    "total_tokens": 3907,
    "output_tokens": 144,
    "input_tokens": 3763,
    "plugins": {
      "search": {
        "count": 1
      }
    },
    "prompt_tokens_details": {
      "cached_tokens": 0
    }
  },
  "request_id": "ae118381-a74b-4bda-8ef9-c451b5240e82"
}

Domain-specific search

Queries in vertical domains such as weather and stocks require high data accuracy, and general web search results may not be precise enough.

When domain-specific search is enabled, the model prioritizes vertical data sources to return more accurate results.

Set enable_search_extension to true to enable this feature.

Valid values:

  • true: Enable.

  • false (default): Disable.

Supported domains:

Domain

Description

Sample query

Exchange rate

Provides the latest exchange rates between multiple currencies and supports standard currency codes.

What is the exchange rate between CNY and USD?

Weather

Provides real-time, future, and historical weather data.

Hangzhou weather

Stocks

Supports A-shares, Hong Kong stocks, and US stocks. You can retrieve real-time stock prices, previous trading day closing prices, historical trends, 30-day closing prices, and prices for stock tickers or indices.

What was the closing price of the Shanghai Composite Index yesterday?

Gas price

Provides daily updates on gasoline and diesel prices in various regions.

What is the gas price in Hangzhou?

Perpetual calendar

For a specified date, provides information including the lunar calendar, solar terms, holidays, and traditional almanac guidance on auspicious and inauspicious activities.

What is today's lunar date?

Gold price

Provides real-time quotes, including the latest price, opening price, high, and low.

What is the price of gold now?

Silver price

Provides real-time quotes, including the latest price, opening price, high, and low.

What is the price of silver now?

Lottery

Supports mainstream lottery types such as Double Color Ball, Super Lotto, Permutation 3, Permutation 5, 7-Star Lottery, Happy 8, and 3D.

What are the latest Double Color Ball results?

TV series

Provides information on TV series from mainstream platforms.

What TV series are trending?

Movies

Provides the latest information from mainstream movie platforms.

What movies have been released recently?

License plate restrictions

Checks the driving restrictions for the current day based on a license plate number.

ZheAxxxxxx, are there driving restrictions in Hangzhou today?

Soccer matches

Provides schedules and standings for leagues such as the Premier League, La Liga, Bundesliga, Serie A, Ligue 1, Chinese Super League, and Scottish Premiership.

Which team is currently ranked first in the Premier League?

OpenAI

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
    model="qwen-plus",
    messages=[
        {"role": "user", "content": "What is the stock price of Alibaba?"},
    ],
    extra_body={
        "enable_search": True,
        "search_options": {"enable_search_extension": True},
    }
)
print(completion.choices[0].message.content)
Sample response
As of September 15, 2025, the closing price of Alibaba's US stock was 155.060 USD. According to real-time information on September 16, the price was 158.040 USD, an increase of about 1.92% from the previous day. The stock price has risen by 17.07% compared to last month.

We recommend checking professional stock market platforms or financial websites for more specific real-time stock price information.

Node.js

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: process.env.DASHSCOPE_API_KEY,
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
    baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
});

async function main() {
    const completion = await openai.chat.completions.create({
        model: "qwen-plus",
        messages: [
            { role: "user", content: "What is the stock price of Alibaba?" }
        ],
        enable_search: true,
        search_options: {
            enable_search_extension: true
        }
    });
    console.log(completion.choices[0].message.content);
}

main();
Sample response
As of September 15, 2025, the closing price of Alibaba's US stock was 155.060 USD. According to real-time information on September 16, the price was 158.040 USD, an increase of about 1.92% from the previous day. The stock price has risen by 17.07% compared to last month.

We recommend checking professional stock market platforms or financial websites for more specific real-time stock price information.

curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "messages": [
        {
            "role": "user", 
            "content": "What is the stock price of Alibaba?"
        }
    ],
    "enable_search": true,
    "search_options": {
        "enable_search_extension": true
    }
}'
Sample response
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "As of September 16, 2025, Alibaba's stock has shown strong performance, continuously setting new highs for the period. This indicates high market confidence in its future development.\n\n**US Stock:**\n*   **Real-time price**: According to the latest data, the real-time price of Alibaba's US stock (BABA) is **158.040 USD**.\n*   **Recent performance**: The closing price on the previous trading day (September 15) was 155.060 USD, with a daily increase of about 1.92%. Since September 10, the stock price has shown an accelerating upward trend, rising from about 143.93 USD.\n*   **Long-term gain**: Year-to-date, Alibaba's US stock has gained over 90%, demonstrating a much stronger performance than the broader market.\n\n**Hong Kong Stock:**\n*   **New stock price high**: On September 15, 2025, Alibaba's Hong Kong stock (09988.HK) once soared to **156.8 HKD**, a new high since November 2021, with an intraday gain of over 2%.\n*   **Market-driving effect**: The strong performance of Alibaba's stock has effectively driven up the entire Hong Kong tech sector, and related ETF funds have also been popular among investors.\n\n**Key factors driving the stock price increase include:**\n\n1.  **\"AMAP Street Exploration List\" ignites the market**: On September 10, 2025, AMAP launched the \"AMAP Street Exploration List\" based on real travel data. The number of users exceeded 40 million on its first day. It is seen as a new way to activate offline businesses such as catering, which has greatly boosted market expectations for Alibaba's local life services business.\n2.  **Leading position in the AI field**: According to a report by Sullivan, the call volume of the Qwen LLM in enterprise applications ranks first in the Chinese market, accounting for 17.7%. This highlights its strong capabilities and commercialization potential in the field of artificial intelligence.\n3.  **Continuous inflow of southbound funds**: Investors from the Chinese mainland have made large net purchases of Alibaba through the Hong Kong Stock Connect. In the period from September 1 to 8 alone, the net purchase amount was nearly 18.7 billion HKD, ranking first among all Hong Kong stock targets and showing strong capital support.\n4.  **Favorable macroeconomic environment**: Expectations of a Fed rate cut are rising, and global funds are flowing back into emerging markets. This provides a favorable external environment for Chinese concept stocks represented by Alibaba.\n\nIn summary, Alibaba's stock price is in a strong upward channel, driven by multiple factors such as product innovation, technological leadership, investor favor, and macroeconomic benefits. It is widely regarded as the current \"leader\" of the Hong Kong tech sector."
      },
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null
    }
  ],
  "object": "chat.completion",
  "usage": {
    "prompt_tokens": 3500,
    "completion_tokens": 539,
    "total_tokens": 4039
  },
  "created": 1758018466,
  "system_fingerprint": null,
  "model": "qwen-plus",
  "id": "chatcmpl-d33caa81-34d8-472d-a201-9320124759d3"
}

DashScope

The DashScope Java SDK does not support domain-specific search.

Python

import os
import dashscope

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
response = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=[{"role": "user", "content": "What is the stock price of Alibaba?"}],
    enable_search=True,
    search_options={
        "enable_search_extension": True,  # Enable domain-specific search
        "enable_source": True,
    },
    result_format="message"
)
# Enhanced information is returned in the extra_tool_info field of search_info
print("="*20 + "Domain-specific search results" + "="*20)
for info in response.output.search_info["extra_tool_info"]:
    print(info["result"])
print("="*20 + "General search results" + "="*20)
for web in response.output.search_info["search_results"]:
    print(f"[{web['index']}]: [{web['title']}]({web['url']})")
print("="*20 + "Response content" + "="*20)
print(response.output.choices[0].message.content)
Sample response
According to the latest real-time data, as of September 16, 2025:

* The real-time price of Alibaba's US stock (BABA) is 158.040 USD.
* The closing price on the previous trading day (September 15) was 155.060 USD.

The stock has shown strong performance recently, with a monthly gain of approximately 17.07%.

curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "input":{
        "messages":[      
            {
                "role": "user",
                "content": "Alibaba's stock price"
            }
        ]
    },
    "parameters": {
        "enable_search": true,
        "search_options": {
            "enable_search_extension": true,
            "enable_source": true
        },
        "result_format": "message"
    }
}'
Sample response
{
  "output": {
    "choices": [
      {
        "message": {
          "content": "As of September 16, 2025, Alibaba's stock performance has remained strong, with stock prices in major markets hitting new highs in recent years.\n\n**US Stock:**\n*   **Real-time price**: 158.040 USD\n*   **Previous trading day's (September 15) closing price**: 155.060 USD\n*   **Intraday gain**: +1.92%\n*   **Cumulative gain this month**: Approximately 17.07%\n*   **Year-to-date gain**: As high as 93.68%\n\nRecently, Alibaba's US stock price has been on an upward trend. In early trading on September 15, the stock price once touched 158.47 USD, setting a new high for the period since 2022.\n\n**Hong Kong Stock (Alibaba-W, 09988):**\n*   According to the latest data (September 15), Alibaba's Hong Kong stock price reached a high of 156.8 HKD, setting a new high in nearly four years.\n*   It closed at 156.2 HKD on the day, a single-day increase of 3.38%.\n*   In September alone, the stock price has accumulated a gain of nearly 35%.\n\n**Drivers of stock price increase:**\n1.  **Strong financial report performance**: The company's financial report for the second quarter of 2025 (ending June 30) showed a 2% year-on-year increase in revenue and a 76% year-on-year increase in net profit, reaching 42.382 billion CNY, exceeding market expectations.\n2.  **Widespread institutional optimism**: Several international investment banks, including JPMorgan Chase and Citigroup, have collectively raised their target prices for Alibaba, with the highest target price seen at 198 USD, indicating an optimistic outlook for the future.\n3.  **Continuous capital inflow**: Southbound funds (investors from the Chinese mainland via Hong Kong Stock Connect) made large net purchases of Alibaba for several consecutive trading days in early September. The net purchase amount reached 18.693 billion HKD in six trading days, ranking first among all targets and providing strong support for the stock price.\n4.  **Market sentiment recovery**: The strong rebound in Alibaba's stock price has also driven the activity of the entire \"Alibaba concept stock\" sector and led the overall strength of the Hong Kong tech sector.\n\nIn summary, Alibaba's stock price has experienced a significant valuation recovery and strong rise in the second half of 2025. From the perspectives of fundamentals, institutional views, and capital flows, it shows a positive trend.",
          "role": "assistant"
        },
        "finish_reason": "stop"
      }
    ],
    "search_info": {
      "extra_tool_info": [
        {
          "result": "Alibaba US Stock:\nReal-time price 158.040 USD\nPrevious trading day's closing price 155.060 USD\nDay-over-day change 1.92%\nMonth-over-month change 17.07%\nDaily YoY %93.68\nMonthly YoY %51.79\nHistorical price list[{\"date\":\"2025-09-15\",\"endPri\":\"158.470\"},{\"date\":\"2025-09-12\",\"endPri\":\"155.060\"},{\"date\":\"2025-09-11\",\"endPri\":\"155.440\"},{\"date\":\"2025-09-10\",\"endPri\":\"143.930\"},{\"date\":\"2025-09-09\",\"endPri\":\"147.100\"},{\"date\":\"2025-09-08\",\"endPri\":\"141.200\"},{\"date\":\"2025-09-05\",\"endPri\":\"135.580\"},{\"date\":\"2025-09-04\",\"endPri\":\"130.920\"},{\"date\":\"2025-09-03\",\"endPri\":\"136.450\"},{\"date\":\"2025-09-02\",\"endPri\":\"138.550\"},{\"date\":\"2025-08-29\",\"endPri\":\"135.000\"},{\"date\":\"2025-08-28\",\"endPri\":\"119.570\"},{\"date\":\"2025-08-27\",\"endPri\":\"122.230\"},{\"date\":\"2025-08-26\",\"endPri\":\"124.190\"},{\"date\":\"2025-08-25\",\"endPri\":\"124.350\"},{\"date\":\"2025-08-22\",\"endPri\":\"122.940\"},{\"date\":\"2025-08-21\",\"endPri\":\"118.090\"},{\"date\":\"2025-08-20\",\"endPri\":\"119.490\"},{\"date\":\"2025-08-19\",\"endPri\":\"119.990\"},{\"date\":\"2025-08-18\",\"endPri\":\"121.400\"},{\"date\":\"2025-08-15\",\"endPri\":\"121.260\"},{\"date\":\"2025-08-14\",\"endPri\":\"122.280\"},{\"date\":\"2025-08-13\",\"endPri\":\"126.860\"},{\"date\":\"2025-08-12\",\"endPri\":\"122.420\"},{\"date\":\"2025-08-11\",\"endPri\":\"118.640\"},{\"date\":\"2025-08-08\",\"endPri\":\"120.360\"},{\"date\":\"2025-08-07\",\"endPri\":\"120.960\"},{\"date\":\"2025-08-06\",\"endPri\":\"120.860\"},{\"date\":\"2025-08-05\",\"endPri\":\"117.040\"},{\"date\":\"2025-08-04\",\"endPri\":\"117.500\"}]\n\n",
          "tool": "stock"
        }
      ],
      "search_results": [
        {
          "site_name": "None",
          "icon": "https://b.bdstatic.com/searchbox/mappconsole/image/20190805/1239163c-77cc-449e-b91f-9bb1d27e43a7.png",
          "index": 1,
          "title": "-September 10, 2025, US stocks closed on Tuesday, the company rose 4.18% to close at 147.10 USD. Recently,",
          "url": "https://xueqiu.com/9745910102/351820091"
        },
        {
          "site_name": "Baijiahao",
          "icon": "https://baijiahao.baidu.com/favicon.ico",
          "index": 2,
          "title": "Alibaba soars over 7%! Hong Kong Tech 50 ETF (159750) opens higher by over 2%",
          "url": "https://baijiahao.baidu.com/s?id=1843045561840113640&wfr=spider&for=pc"
        },
        {
          "site_name": "Baijiahao",
          "icon": "https://baijiahao.baidu.com/favicon.ico",
          "index": 3,
          "title": "Alibaba's US stock rises 8%, industry insiders believe there is still room for growth",
          "url": "https://baijiahao.baidu.com/s?id=1843028040477540041&wfr=spider&for=pc"
        },
        {
          "site_name": "Baijiahao",
          "icon": "https://baijiahao.baidu.com/favicon.ico",
          "index": 4,
          "title": "A-shares fluctuate and adjust, trading volume shrinks by 300 billion, Hang Seng Index breaks 26,000 points intraday, billions of southbound funds pour into Alibaba",
          "url": "https://baijiahao.baidu.com/s?id=1842797735656596493&wfr=spider&for=pc"
        },
        {
          "site_name": "Baidu",
          "icon": "https://mbs1.bdstatic.com/searchbox/mappconsole/image/20220222/0e49bbbc-0ab7-475f-ad6b-cab96f47cf42.png",
          "index": 5,
          "title": "Analysis of the reasons for Alibaba's stock price soaring nearly 90% in 2025",
          "url": "http://mbd.baidu.com/newspage/data/dtlandingsuper?nid=dt_4372375544123651227"
        },
        {
          "site_name": "Baijiahao",
          "icon": "https://baijiahao.baidu.com/favicon.ico",
          "index": 6,
          "title": "Alibaba's stock price continues to hit new highs, cherish the right-side time of Hong Kong tech stocks",
          "url": "https://baijiahao.baidu.com/s?id=1843297157083806691&wfr=spider&for=pc"
        },
        {
          "site_name": "Sina.com",
          "icon": "https://mbs1.bdstatic.com/searchbox/mappconsole/image/20220307/88eb511c-5c51-448a-a9b5-df6b24cda8c7.png",
          "index": 7,
          "title": "September 10, 2025 [Alibaba Concept] Limit-up Pyramid",
          "url": "https://cj.sina.com.cn/articles/view/3240851740/c12b791c00101h5xk"
        },
        {
          "site_name": "Sina.com",
          "icon": "https://mbs1.bdstatic.com/searchbox/mappconsole/image/20220307/88eb511c-5c51-448a-a9b5-df6b24cda8c7.png",
          "index": 8,
          "title": "September 10, 2025 Alibaba concept stock limit-up summary",
          "url": "https://cj.sina.com.cn/articles/view/3240851740/c12b791c00101h5z8"
        },
        {
          "site_name": "Sina.com",
          "icon": "https://mbs1.bdstatic.com/searchbox/mappconsole/image/20230828/6ad81bbb-a34d-468e-9756-bcf9c370a8a4.png",
          "index": 9,
          "title": "Alibaba-W hits 158.3 HKD intraday, a nearly 4-year high! Why are institutions collectively bullish?",
          "url": "http://finance.sina.com.cn/tech/roll/2025-09-12/doc-infqfnmi7601457.shtml"
        },
        {
          "site_name": "Baijiahao",
          "icon": "https://baijiahao.baidu.com/favicon.ico",
          "index": 10,
          "title": "Hong Kong stock market changes | Alibaba-W (09988) rises over 3%, continuing to set a nearly four-year high, with stock price up nearly 35% this month",
          "url": "https://baijiahao.baidu.com/s?id=1843300524259847917&wfr=spider&for=pc"
        }
      ]
    }
  },
  "usage": {
    "total_tokens": 2664,
    "output_tokens": 486,
    "input_tokens": 2178,
    "plugins": {
      "search": {
        "count": 1
      }
    }
  },
  "request_id": "f52d05cc-36a6-45c2-adfe-dfcb9b7fea56"
}

Search freshness

For time-sensitive queries, such as recent news or updates, use the freshness parameter to restrict the search time range and filter out outdated results.

Valid values:

  • 7: Retrieves content from the last 7 days.

  • 30: Retrieves content from the last 30 days.

  • 180: Retrieves content from the last 180 days.

  • 365: Retrieves content from the last 365 days.

  • Not set (default): The search is not restricted by time.

Requirements:

  • Effective only for search_strategy: turbo.

  • Supported models: qwen3-max, qwen3-max-preview, qwen3-max-2025-09-23, qwen-plus, qwen-flash, qwen-plus-character, qwen-flash-character, qwen-flash-character-2026-02-26

OpenAI compatible

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
    model="qwen-plus",
    messages=[
        {"role": "user", "content": "What is the major news in the AI field recently?"},
    ],
    extra_body={
        "enable_search": True,
        "search_options": {
            "search_strategy": "turbo",
            "freshness": 7  # Search within the last 7 days.
        }
    }
)
print(completion.choices[0].message.content)

Node.js

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: process.env.DASHSCOPE_API_KEY,
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
    baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
});

async function main() {
    const completion = await openai.chat.completions.create({
        model: "qwen-plus",
        messages: [
            { role: "user", content: "What is the major news in the AI field recently?" }
        ],
        enable_search: true,
        search_options: {
            search_strategy: "turbo",
            freshness: 7  // Search within the last 7 days.
        }
    });
    console.log(completion.choices[0].message.content);
}

main();

Curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen-plus",
  "messages": [
    {
      "role": "user",
      "content": "What is the major news in the AI field recently?"
    }
  ],
  "enable_search": true,
  "search_options": {
    "search_strategy": "turbo",
    "freshness": 7
  }
}'

DashScope

The DashScope Java SDK does not support setting search freshness.

Python

import os
import dashscope

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
response = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=[{"role": "user", "content": "What is the major news in the AI field recently?"}],
    enable_search=True,
    search_options={
        "search_strategy": "turbo",
        "enable_source": True,
        "freshness": 7  # Search within the last 7 days.
    },
    result_format="message"
)
print("="*20 + "Search results" + "="*20)
for web in response.output.search_info["search_results"]:
    print(f"[{web['index']}]: [{web['title']}]({web['url']})")
print("="*20 + "Response content" + "="*20)
print(response.output.choices[0].message.content)

Curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen-plus",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": "What is the major news in the AI field recently?"
      }
    ]
  },
  "parameters": {
    "enable_search": true,
    "search_options": {
      "search_strategy": "turbo",
      "enable_source": true,
      "freshness": 7
    },
    "result_format": "message"
  }
}'

Restrict search sites

To restrict a search to specific websites, such as official sites or trusted media sources, use the assigned_site_list parameter. When enabled, the search is limited to the sites you specify.

Limitations:

  • This setting applies only when search_strategy is set to turbo.

  • Supported models:

    • Qwen Max Series: qwen3-max, qwen3-max-preview, qwen3-max-2025-09-23, and later snapshot versions

    • Qwen Plus Series: qwen-plus

    • Qwen Flash Series: qwen-flash

    • Character model: qwen-plus-character, qwen-flash-character, qwen-flash-character-2026-02-26

  • You can specify up to 25 sites.

The assigned_site_list parameter defaults to [], which means the search is unrestricted.

If no relevant content is found on the specified sites, the search may return empty results. In this case, the model will answer using its own knowledge.

OpenAI compatible

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # This example is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configurations vary by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
    model="qwen-plus",
    messages=[
        {"role": "user", "content": "What is the trending news in Beijing?"},
    ],
    extra_body={
        "enable_search": True,
        "search_options": {
            "search_strategy": "turbo",
            "assigned_site_list": ["baidu.com", "sina.cn"]  # Search only the specified sites
        }
    }
)
print(completion.choices[0].message.content)

Node.js

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: process.env.DASHSCOPE_API_KEY,
    # This example is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configurations vary by region.
    baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
});

async function main() {
    const completion = await openai.chat.completions.create({
        model: "qwen-plus",
        messages: [
            { role: "user", content: "What is the trending news in Beijing?" }
        ],
        enable_search: true,
        search_options: {
            search_strategy: "turbo",
            assigned_site_list: ["baidu.com", "sina.cn"]  // Search only the specified sites
        }
    });
    console.log(completion.choices[0].message.content);
}

main();

Curl

# This example is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen-plus",
  "messages": [
    {
      "role": "user",
      "content": "What is the trending news in Beijing?"
    }
  ],
  "enable_search": true,
  "search_options": {
    "search_strategy": "turbo",
    "assigned_site_list": ["baidu.com", "sina.cn"]
  }
}'

DashScope

The DashScope Java SDK does not support restricting search to specific sites.

Python

import os
import dashscope

# This example is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configurations vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
response = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=[{"role": "user", "content": "What is the trending news in Beijing?"}],
    enable_search=True,
    search_options={
        "search_strategy": "turbo",
        "enable_source": True,
        "assigned_site_list": ["baidu.com", "sina.cn"]  # Search only the specified sites
    },
    result_format="message"
)
print("="*20 + "Search results" + "="*20)
for web in response.output.search_info["search_results"]:
    print(f"[{web['index']}]: [{web['title']}]({web['url']})")
print("="*20 + "Response content" + "="*20)
print(response.output.choices[0].message.content)

Curl

# This example is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen-plus",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": "What is the trending news in Beijing?"
      }
    ]
  },
  "parameters": {
    "enable_search": true,
    "search_options": {
      "search_strategy": "turbo",
      "enable_source": true,
      "assigned_site_list": ["baidu.com", "sina.cn"]
    },
    "result_format": "message"
  }
}'

Control search scope with natural language

Use the prompt_intervene parameter to define the search scope with natural language. This lets you target content about a specific topic or from a particular region.

Supported models: qwen3-max, qwen3-max-preview, qwen3-max-2025-09-23, qwen-plus, qwen-flash, qwen-plus-character, qwen-flash-character, qwen-flash-character-2026-02-26

OpenAI compatible

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # This configuration is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configuration is region-specific.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
    model="qwen-plus",
    messages=[
        {"role": "user", "content": "Current state of intelligent technology development"},
    ],
    extra_body={
        "enable_search": True,
        "search_options": {
            "search_strategy": "turbo",
            "intention_options": {
                "prompt_intervene": "Retrieve only AI technology-related content"
            }
        }
    }
)
print(completion.choices[0].message.content)

Node.js

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: process.env.DASHSCOPE_API_KEY,
    # This configuration is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configuration is region-specific.
    baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
});

async function main() {
    const completion = await openai.chat.completions.create({
        model: "qwen-plus",
        messages: [
            { role: "user", content: "Current state of intelligent technology development" }
        ],
        enable_search: true,
        search_options: {
            search_strategy: "turbo",
            intention_options: {
                prompt_intervene: "Retrieve only AI technology-related content"
            }
        }
    });
    console.log(completion.choices[0].message.content);
}

main();

curl

# This configuration is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configuration is region-specific.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen-plus",
  "messages": [
    {
      "role": "user",
      "content": "Current state of intelligent technology development"
    }
  ],
  "enable_search": true,
  "search_options": {
    "search_strategy": "turbo",
    "intention_options": {
      "prompt_intervene": "Retrieve only AI technology-related content"
    }
  }
}'

DashScope

This feature is not supported by the DashScope Java SDK.

Python

import os
import dashscope

# This configuration is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configuration is region-specific.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
response = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=[{"role": "user", "content": "Current state of intelligent technology development"}],
    enable_search=True,
    search_options={
        "search_strategy": "turbo",
        "enable_source": True,
        "intention_options": {
            "prompt_intervene": "Retrieve only AI technology-related content"
        }
    },
    result_format="message"
)
print("="*20 + "Search results" + "="*20)
for web in response.output.search_info["search_results"]:
    print(f"[{web['index']}]: [{web['title']}]({web['url']})")
print("="*20 + "Response content" + "="*20)
print(response.output.choices[0].message.content)

curl

# This configuration is for the China (Beijing) region. Replace {WorkspaceId} with your Workspace ID. Configuration is region-specific.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen-plus",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": "Current state of intelligent technology development"
      }
    ]
  },
  "parameters": {
    "enable_search": true,
    "search_options": {
      "search_strategy": "turbo",
      "enable_source": true,
      "intention_options": {
        "prompt_intervene": "Retrieve only AI technology-related content"
      }
    },
    "result_format": "message"
  }
}'

Early return of search sources

In streaming mode, a delay of 0.5 seconds or more can occur between when search results are ready and when the first data packet is sent. You can reduce the time to first token (TTFT) by returning search sources immediately after the search completes. To enable this feature, set prepend_search_result to true.

Valid values:

  • true: The first data packet contains only the search sources. Subsequent data packets contain the model response.

  • false (default): The first data packet contains both the search sources and the initial part of the model response.

This feature is not supported for OpenAI compatibility or the DashScope Java SDK.

Python

import os
import dashscope

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
responses = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus",
    messages=[{"role": "user", "content": "What is the weather in Hangzhou tomorrow?"}],
    enable_search=True,
    search_options={
        "enable_source": True,
        "prepend_search_result": True,  # The first packet returns only search sources
    },
    result_format="message",
    stream=True,
    incremental_output=True
)

first_chunk = True
for resp in responses:
    if first_chunk:
        search_info = resp.output.get("search_info", {})
        if search_info:
            print("=" * 20 + f"Found {len(search_info['search_results'])} pages" + "=" * 20)
            for web in search_info["search_results"]:
                print(f"[{web['index']}]: [{web['title']}]({web['url']})")
            first_chunk = False
            print("=" * 20 + "Response content" + "=" * 20)
    
    content = resp.output.choices[0].message.content
    print(content, end='')
Sample response
====================Found 8 pages====================
[1]: [Dropping nearly 10℃! Just confirmed: cold air is about to arrive, and it's strong](https://cj.sina.com.cn/articles/view/1665450974/6344c3de01901avjw)
[2]: [Dropping nearly 10℃! Just confirmed: cold air is about to arrive, and it's strong](https://hznews.hangzhou.com.cn/chengshi/content/2025-09/15/content_9083259.htm)
[3]: [Hangzhou Weather Query for September 2025](https://www.ip.cn/tianqi/zhejiang/hangzhou/202509.html)
[4]: [40-Day Weather Forecast](http://uc.src.weather.com.cn/mweather40d/index.shtml?10121010103A)
[5]: [Hangzhou Weather Forecast for September 18, 2025](https://tianqi.eastday.com/tianqi/hangzhou/20250918.html)
[6]: [Hangzhou Weather Query for September 2024](https://www.ip.cn/tianqi/zhejiang/hangzhou/202409.html)
[7]: [The scent of autumn is in the air, the long-awaited first fragrance of osmanthus has finally arrived in Hangzhou](https://baijiahao.baidu.com/s?id=1843471369098538519&wfr=spider&for=pc)
[8]: [Yuhang District Historical Weather Records for September 2024](https://www.ip.cn/tianqi/zhejiang/hangzhou/yuhang/202409.html)
====================Response content====================
According to the weather information for September 17, 2025, the weather in Hangzhou tomorrow (September 18) is as follows:

Light rain turning to overcast, with lower temperatures.
*   Weather conditions: Light rain during the day, then turning overcast.
*   Temperature: High of about 26°C, low of about 22°C.
*   Wind: Northeast wind during the day.

Weather characteristics:
Affected by cold air, Hangzhou will experience a significant cooling period. Compared to the recent high temperatures of over 35°C, the high temperature tomorrow will drop by nearly 10°C, feeling much cooler. After this temperature drop, high temperatures are not expected to return until the 25th.

curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual Workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-DashScope-SSE: enable" \
-d '{
    "model": "qwen-plus",
    "input":{
        "messages":[      
            {
                "role": "user",
                "content": "What is the weather in Hangzhou tomorrow?"
            }
        ]
    },
    "parameters": {
        "enable_search": true,
        "incremental_output": true,
        "result_format": "message",
        "search_options": {
            "enable_source": true,
            "prepend_search_result": true
        }
    }
}'
Sample response
id:1
event:result
:HTTP_STATUS/200
data:{"output":{"choices":[{"message":{"content":"","role":"assistant"},"finish_reason":"null"}],"search_info":{"search_results":[{"site_name":"Baijiahao","icon":"https://baijiahao.baidu.com/favicon.ico","index":1,"title":"The number of high-temperature days for the year may set a new record. When will Hangzhou 'cool down'?","url":"https://baijiahao.baidu.com/s?id=1843390963791748953&wfr=spider&for=pc"},{"site_name":"eastday","icon":"https://img.alicdn.com/imgextra/i3/O1CN01kr9teP1wlRD8OH6TO_!!6000000006348-73-tps-16-16.ico","index":2,"title":"Hangzhou Weather Forecast for September 17, 2025","url":"https://tianqi.eastday.com/tianqi/hangzhou/20250917.html"},{"site_name":"Baijiahao","icon":"https://baijiahao.baidu.com/favicon.ico","index":3,"title":"On this day, cold air brings cooling, and the high temperatures will finally end","url":"https://baijiahao.baidu.com/s?id=1843310716677051952&wfr=spider&for=pc"},{"site_name":"eastday","icon":"https://img.alicdn.com/imgextra/i3/O1CN01kr9teP1wlRD8OH6TO_!!6000000006348-73-tps-16-16.ico","index":4,"title":"Xiacheng Weather Forecast, Hangzhou Xiacheng, September 17, 2025","url":"https://tianqi.eastday.com/tianqi/xiachengqu/20250917.html"},{"site_name":"eastday","icon":"https://img.alicdn.com/imgextra/i3/O1CN01kr9teP1wlRD8OH6TO_!!6000000006348-73-tps-16-16.ico","index":5,"title":"Jianggan Weather Forecast, Hangzhou Jianggan, September 17, 2025","url":"https://tianqi.eastday.com/tianqi/jiangganqu/20250917.html"},{"site_name":"None","icon":"","index":6,"title":"Hangzhou Today's Weather: Light Rain to Clear, September 17, 2025 Hangzhou Weather Forecast","url":"http://m.tqw5.com/shenghuo_8076477/"},{"site_name":"eastday","icon":"https://img.alicdn.com/imgextra/i3/O1CN01kr9teP1wlRD8OH6TO_!!6000000006348-73-tps-16-16.ico","index":7,"title":"Gongshu Weather Forecast, Hangzhou Gongshu, September 17, 2025","url":"https://tianqi.eastday.com/tianqi/gongshuqu/20250917.html"},{"site_name":"eastday","icon":"https://img.alicdn.com/imgextra/i3/O1CN01kr9teP1wlRD8OH6TO_!!6000000006348-73-tps-16-16.ico","index":8,"title":"Xihu Weather Forecast, Hangzhou Xihu, September 17, 2025","url":"https://tianqi.eastday.com/tianqi/xihu/20250917.html"},{"site_name":"NetEase","icon":"https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1534926245,1016405979&fm=195&app=88&f=JPEG?w=200&h=200","index":9,"title":"Hangzhou three-day tour guide | Song Dynasty charm, tea fragrance, and lake and mountain secrets","url":"https://www.163.com/dy/article/K9GSR7HE0556F537.html"},{"site_name":"Baijiahao","icon":"https://baijiahao.baidu.com/favicon.ico","index":10,"title":"Confirmed! Cold air is coming, Xiaoshan is finally cooling down!","url":"http://baijiahao.baidu.com/s?id=1843333073020602778&wfr=spider&for=pc"}]}},"usage":{},"request_id":"785ed962-fa29-4c7e-bed2-7fe0fdbfdc6c"}

id:2
event:result
:HTTP_STATUS/200
data:{"output":{"choices":[{"message":{"content":"According to","role":"assistant"},"finish_reason":"null"}],"search_info":{"extra_tool_info":[],"search_results":[]}},"usage":{"total_tokens":2941,"output_tokens":1,"input_tokens":2940,"plugins":{"search":{"count":1}},"prompt_tokens_details":{"cached_tokens":0}},"request_id":"785ed962-fa29-4c7e-bed2-7fe0fdbfdc6c"}

id:3
event:result
:HTTP_STATUS/200
data:{"output":{"choices":[{"message":{"content":" available","role":"assistant"},"finish_reason":"null"}],"search_info":{"extra_tool_info":[],"search_results":[]}},"usage":{"total_tokens":2942,"output_tokens":2,"input_tokens":2940,"plugins":{"search":{"count":1}},"prompt_tokens_details":{"cached_tokens":0}},"request_id":"785ed962-fa29-4c7e-bed2-7fe0fdbfdc6c"}

...

id:64
event:result
:HTTP_STATUS/200
data:{"output":{"choices":[{"message":{"content":" adjust your travel plans based on the weather changes","role":"assistant"},"finish_reason":"null"}],"search_info":{"extra_tool_info":[],"search_results":[]}},"usage":{"total_tokens":3221,"output_tokens":281,"input_tokens":2940,"plugins":{"search":{"count":1}},"prompt_tokens_details":{"cached_tokens":0}},"request_id":"785ed962-fa29-4c7e-bed2-7fe0fdbfdc6c"}

id:65
event:result
:HTTP_STATUS/200
data:{"output":{"choices":[{"message":{"content":"."},"finish_reason":"null"}],"search_info":{"extra_tool_info":[],"search_results":[]}},"usage":{"total_tokens":3224,"output_tokens":284,"input_tokens":2940,"plugins":{"search":{"count":1}},"prompt_tokens_details":{"cached_tokens":0}},"request_id":"785ed962-fa29-4c7e-bed2-7fe0fdbfdc6c"}

id:66
event:result
:HTTP_STATUS/200
data:{"output":{"choices":[{"message":{"content":"","role":"assistant"},"finish_reason":"stop"}],"search_info":{"extra_tool_info":[],"search_results":[]}},"usage":{"total_tokens":3224,"output_tokens":284,"input_tokens":2940,"plugins":{"search":{"count":1}},"prompt_tokens_details":{"cached_tokens":0}},"request_id":"785ed962-fa29-4c7e-bed2-7fe0fdbfdc6c"}

Mixed text and image output

Set enable_text_image_mixed: true to enable mixed text and image output. With this feature enabled, the model embeds relevant images in its responses.

Example:

image.png

Supported models: qwen-max, qwen-plus-latest, qwen-flash

This parameter is independent of enable_search and does not need to be enabled with it.

Image format: The model returns images embedded in the response as HTML <img> tags. To display them on the front end, you can render the HTML directly or convert it to Markdown.

<!-- Example of the image format returned by the model -->
<p align="center">
<img src="https://example.com/image.jpg" alt="Image description" width="400" height="auto">
</p>

The following examples show how to enable mixed text and image output.

OpenAI compatible

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # Configuration for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Endpoints vary by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
    model="qwen-plus-latest",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Tell me about West Lake in Hangzhou"},
    ],
    # Enable mixed text and image output
    extra_body={"enable_text_image_mixed": True}
)
print(completion.choices[0].message.content)

Node.js

import OpenAI from "openai";

const openai = new OpenAI({
    apiKey: process.env.DASHSCOPE_API_KEY,
    // Configuration for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Endpoints vary by region.
    baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
});

async function main() {
    const completion = await openai.chat.completions.create({
        model: "qwen-plus-latest",
        messages: [
            { role: "system", content: "You are a helpful assistant." },
            { role: "user", content: "Tell me about West Lake in Hangzhou" }
        ],
        // Enable mixed text and image output
        enable_text_image_mixed: true
    });
    console.log(completion.choices[0].message.content);
}

main();

curl

# Configuration for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Endpoints vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus-latest",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Tell me about West Lake in Hangzhou"
        }
    ],
    "enable_text_image_mixed": true
}'

DashScope

This feature is not supported by the DashScope Java SDK.

Python

import os
import dashscope

# Configuration for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Endpoints vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
response = dashscope.Generation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-plus-latest",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Tell me about West Lake in Hangzhou"},
    ],
    # Enable mixed text and image output
    enable_text_image_mixed=True,
    result_format="message"
)
print(response["output"]["choices"][0]["message"]["content"])

curl

# Configuration for the China (Beijing) region. Replace {WorkspaceId} with your workspace ID. Endpoints vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus-latest",
    "input": {
        "messages": [
            {
                "role": "system",
                "content": "You are a helpful assistant."
            },
            {
                "role": "user",
                "content": "Tell me about West Lake in Hangzhou"
            }
        ]
    },
    "parameters": {
        "enable_text_image_mixed": true,
        "result_format": "message"
    }
}'

Web search with thinking models

In the previous examples, the model provides a direct response after retrieving search results. This approach is suitable for simple, time-sensitive, and fact-based queries, such as "What is the weather in Hangzhou tomorrow?". However, for complex tasks like industry trend analysis, multi-source information synthesis, or report generation, this approach often falls short. For these scenarios, you can use a thinking model. After retrieving content, a thinking model first reasons over the information before generating a response, significantly improving the answer quality for complex tasks.

The thinking process is visible, so you can understand how the response is derived from the retrieved information.

The following models support both web search and deep thinking capabilities:

  • Qwen

    • Qwen-Max: qwen3-max, qwen3-max-2026-01-23, qwen3-max-preview

    • Qwen-Plus: qwen-plus, qwen-plus-latest, and snapshot versions from qwen-plus-2025-07-14 or later

    • Qwen-Flash: qwen-flash, and snapshot versions from qwen-flash-2025-07-28 or later

    • Qwen-Turbo: qwen-turbo

    • QwQ: qwq-plus

  • DeepSeek: deepseek-v4-pro, deepseek-v4-flash, deepseek-v3.2, deepseek-v3.2-exp, deepseek-v3.1, deepseek-r1-0528, deepseek-r1

For more details on thinking models, see Deep Thinking.

OpenAI compatible

Python

Sample code

from openai import OpenAI
import os

# Initialize the OpenAI client
client = OpenAI(
    # Reads the API key from the DASHSCOPE_API_KEY environment variable. Alternatively, you can set it directly: api_key="sk-xxx"
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
)

reasoning_content = ""  # Stores the complete thinking process
answer_content = ""  # Stores the complete response
is_answering = False  # Flag to check if the thinking process has ended and the response has begun

# Create a chat completion request
completion = client.chat.completions.create(
    # This example uses qwen-plus. You can replace it with any other supported thinking model.
    model="qwen-plus",
    messages=[{"role": "user", "content": "Based on recent AI news, predict the development trends of AI."}],
    extra_body={
        "enable_thinking": True,
        "enable_search": True,  # Parameter to enable web search
        "search_options": {
            "forced_search": True,  # Parameter to force web search
            "search_strategy": "max"
        },
    },
    stream=True,
    stream_options={"include_usage": True}
)

print("\n" + "=" * 20 + "Thinking Process" + "=" * 20 + "\n")

for chunk in completion:
    # If chunk.choices is empty, print the usage
    if not chunk.choices:
        print("\n" + "=" * 20 + "Usage" + "=" * 20)
        print(chunk.usage)
    else:
        delta = chunk.choices[0].delta
        # Print the thinking process
        if hasattr(delta, "reasoning_content") and delta.reasoning_content is not None:
            print(delta.reasoning_content, end="", flush=True)
            reasoning_content += delta.reasoning_content
        else:
            # Start printing the response
            if delta.content != "" and not is_answering:
                print("\n" + "=" * 20 + "Complete Response" + "=" * 20 + "\n")
                is_answering = True
            # Print the response stream
            if delta.content:
                print(delta.content, end="", flush=True)
                answer_content += delta.content

# To print the complete thinking process and response, uncomment the following lines
# print("=" * 20 + "Complete Thinking Process" + "=" * 20 + "\n")
# print(reasoning_content)
# print("=" * 20 + "Complete Response" + "=" * 20 + "\n")
# print(answer_content)

Response

====================Thinking Process====================

To predict AI development trends, I need to analyze recent AI news from the knowledge base. First, I will identify key news items and related trends.

From the knowledge base, I can see several news items related to AI:
...
Based on this information, I will provide a predictive answer about AI development trends.
====================Complete Response====================

# AI Development Trend Prediction: A Look at the Future from Recent News
Based on an analysis of recent AI news, I believe AI development will show the following important trends:
...
AI development is shifting from being "technology-driven" to "demand-driven," with a greater focus on solving practical problems and improving user experience. As technology matures and application scenarios expand, AI will become more deeply integrated into daily life. However, humanized and emotional design will become a key differentiating factor. As emphasized in the "Silver Hair + AI" report, technology will ultimately serve people, not replace the emotional connections between them.
The core of future AI development will be to maintain and enhance the emotional bonds between people while improving efficiency, achieving a harmonious coexistence of technology and humanity.
====================Usage====================
CompletionUsage(completion_tokens=1683, prompt_tokens=2688, total_tokens=4371, completion_tokens_details=CompletionTokensDetails(accepted_prediction_tokens=None, audio_tokens=None, reasoning_tokens=1022, rejected_prediction_tokens=None), prompt_tokens_details=PromptTokensDetails(audio_tokens=None, cached_tokens=0))

Node.js

Sample code

import OpenAI from "openai";
import process from 'process';

// Initialize the OpenAI client
const openai = new OpenAI({
    apiKey: process.env.DASHSCOPE_API_KEY, // Reads your API key from the DASHSCOPE_API_KEY environment variable.
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
    baseURL: 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1'
});

let reasoningContent = '';
let answerContent = '';
let isAnswering = false;

async function main() {
    try {
        const stream = await openai.chat.completions.create({
            model: 'qwen-plus',
            messages: [{ role: 'user', content: 'Based on recent AI news, predict the development trends of AI.' }],
            enable_thinking: true,
            enable_search: true, // Parameter to enable web search
            search_options: {
                forced_search: true // Parameter to force web search
            },
            stream: true,
            stream_options: {
                include_usage: true
            }
        });
        console.log('\n' + '='.repeat(20) + 'Thinking Process' + '='.repeat(20) + '\n');
        for await (const chunk of stream) {
            if (!chunk.choices?.length) {
                console.log('\n' + '='.repeat(20) + 'Usage' + '='.repeat(20) + '\n');                
                console.log(chunk.usage);
                continue;
            }
            const delta = chunk.choices[0].delta;
            // Handle the thinking process
            if (delta.reasoning_content) {
                process.stdout.write(delta.reasoning_content);
                reasoningContent += delta.reasoning_content;
            } 
            // Handle the final response
            else if (delta.content) {
                if (!isAnswering) {
                    console.log('\n' + '='.repeat(20) + 'Complete Response' + '='.repeat(20) + '\n');
                    isAnswering = true;
                }
                process.stdout.write(delta.content);
                answerContent += delta.content;
            }
        }
    } catch (error) {
        console.error('Error:', error);
    }
}
main();

Response

====================Thinking Process====================

To predict AI development trends, I need to analyze recent AI news from the knowledge base. First, I will identify key news items and related trends.

From the knowledge base, I can see several news items related to AI:
...
Based on this information, I will provide a predictive answer about AI development trends.
====================Complete Response====================

# AI Development Trend Prediction: A Look at the Future from Recent News
Based on an analysis of recent AI news, I believe AI development will show the following important trends:
...
AI development is shifting from being "technology-driven" to "demand-driven," with a greater focus on solving practical problems and improving user experience. As technology matures and application scenarios expand, AI will become more deeply integrated into daily life. However, humanized and emotional design will become a key differentiating factor. As emphasized in the "Silver Hair + AI" report, technology will ultimately serve people, not replace the emotional connections between them.
The core of future AI development will be to maintain and enhance the emotional bonds between people while improving efficiency, achieving a harmonious coexistence of technology and humanity.
====================Usage====================
{
  prompt_tokens: 4268,
  completion_tokens: 2446,
  total_tokens: 6714,
  completion_tokens_details: { reasoning_tokens: 1164 },
  prompt_tokens_details: { cached_tokens: 0 }
}

HTTP

Sample code

Curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen-plus",
    "messages": [
        {
            "role": "user", 
            "content": "Based on recent AI news, predict the development trends of AI."
        }
    ],
    "enable_thinking": true,
    "enable_search": true,
    "search_options": {
        "forced_search": true
    },
    "stream": true,
    "stream_options": {
        "include_usage": true
    }
}'

DashScope

Python

Sample code

import os
import dashscope

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
dashscope.base_http_api_url = "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1"
messages = [
    {'role': 'user', 'content': 'Based on recent AI news, predict the development trends of AI.'}
]

response = dashscope.Generation.call(
    # Reads the API key from the DASHSCOPE_API_KEY environment variable. Alternatively, you can set it directly: api_key="sk-xxx"
    api_key=os.getenv('DASHSCOPE_API_KEY'),
    model="qwen-plus",  
    messages=messages,
    enable_thinking = True,
    enable_search = True, # Parameter to enable web search
    search_options = {
        "forced_search": True, # Parameter to force web search
        "enable_source": True, # Include search source information in the response. This is not supported in OpenAI-compatible mode.
        "enable_citation": True, # Enable the citation feature
        "citation_format": "[ref_<number>]", # Sets the citation format to [ref_<number>]
        "search_strategy": "max"
    },
    stream=True,
    incremental_output=True,
    result_format="message",
)

# Stores the complete thinking process
reasoning_content = ""
# Stores the complete response
answer_content = ""
# Flag to track when the response starts
is_answering = False
# Flag to handle the first chunk, which contains search information.
is_first_chunk = True

print("=" * 20 + "Search Information" + "=" * 20)

for chunk in response:
    if is_first_chunk:
        search_results = chunk.output.search_info["search_results"]
        for web in search_results:
            print(f"[{web['index']}]: [{web['title']}]({web['url']})")
        print("=" * 20 + "Thinking Process" + "=" * 20)
        reasoning_content += chunk.output.choices[0].message.reasoning_content
        print(chunk.output.choices[0].message.reasoning_content,end="",flush=True)
        is_first_chunk = False
    else:
        # Skip chunks that don't contain reasoning or response content.
        if (chunk.output.choices[0].message.content == "" and 
            chunk.output.choices[0].message.reasoning_content == ""):
            pass
        else:
            # Handle chunks containing the thinking process.
            if (chunk.output.choices[0].message.reasoning_content != "" and 
                chunk.output.choices[0].message.content == ""):
                print(chunk.output.choices[0].message.reasoning_content, end="",flush=True)
                reasoning_content += chunk.output.choices[0].message.reasoning_content
            # Handle chunks containing the final response.
            elif chunk.output.choices[0].message.content != "":
                if not is_answering:
                    print("\n" + "=" * 20 + "Complete Response" + "=" * 20)
                    is_answering = True
                print(chunk.output.choices[0].message.content, end="",flush=True)
                answer_content += chunk.output.choices[0].message.content

# To print the complete thinking process and response, uncomment the following lines
# print("=" * 20 + "Complete Thinking Process" + "=" * 20 + "\n")
# print(f"{reasoning_content}")
# print("=" * 20 + "Complete Response" + "=" * 20 + "\n")
# print(f"{answer_content}")
# To print the token usage for this request, uncomment the following line
# print("\n"+"="*20+"Token Usage"+"="*20)
# print(chunk.usage)

Response

====================Search Information====================
[1]: [PE/VC Insights: Riding the AI Wave Through Cycles, Part 1: Global AI Industry and Investment Trends](https://baijiahao.baidu.com/s?id=1847324495675907878&wfr=spider&for=pc)
[2]: [October 2025 AI Technology Frontier Overview: From General Intelligence to Embodied Intelligence](https://baijiahao.baidu.com/s?id=1845923714145562035&wfr=spider&for=pc)
[3]: [Top 10 Trends of Artificial Intelligence (AI) in China for 2025](https://mp.weixin.qq.com/s?__biz=MzI1MjQ2OTQ3Ng==&mid=2247658552&idx=2&sn=e49389c0058c72c571e69dbf0d485126&chksm=e89d380f116acb0baf44ce03181bd2d7175ef8c471b7f67135a7d01c5d3578a77280cbd6445e&scene=27)
[4]: [In 2026, AI Advances into the Physical World](https://www.bjcc.gov.cn/article/600574950.html)
[5]: [What are the Future Development Trends of AI Large Models? Three Main Lines Reshape the Industrial Landscape, and On-Device Intelligence Ushers in the Era of AI for All!](https://baijiahao.baidu.com/s?id=1845107629819035324&wfr=spider&for=pc)
[6]: [Top 10 AI trends for 2025! A Futurist's Prediction→](https://baijiahao.baidu.com/s?id=1813333845939915170&wfr=spider&for=pc)
[7]: [Artificial Intelligence and Machine Learning: A New Blue Ocean of Careers in the Technological Revolution](https://baijiahao.baidu.com/s?id=1845336356822347354&wfr=spider&for=pc)
[8]: [2025, Where is AI Headed? How Do We Embrace Change?](http://dsj.guizhou.gov.cn/xwzx/gnyw/202501/t20250114_86624239.html)
[9]: [Large-Scale Adoption of AI Tools in 2025, with 266 Million More Users in China in Six Months](https://baijiahao.baidu.com/s?id=1847270652122448223&wfr=spider&for=pc)
[10]: [Let AI Renew, Not 'Replace' People. How will AI develop in 2025?](https://jswx.gov.cn/chuanbo/wangluo/202501/t20250115_3554633.shtml)
====================Thinking Process====================
To predict AI development trends based on the information in the knowledge base, I first need to consolidate the latest information on these trends, then analyze and summarize it to provide a well-founded prediction.

Let me outline the key information from the knowledge base:

1. Market Size and Growth:
- [ref_1] mentions that the global AI market is projected to be nearly $400 billion in 2025 and is expected to exceed $1.8 trillion by 2030, with a compound annual growth rate (CAGR) of up to 37.3%.
- [ref_1] The global artificial intelligence market reached $196.6 billion in 2023 and is expected to grow to $1.81 trillion by 2030, about 9 times its size in 2023.

....

4. User Adoption: AI tools will become more widespread, and the user base will become more diverse.
5. Regulation and Ethics: AI legislation and regulation will be improved, with a focus on "responsible" and "sustainable" AI.
6. Industry Impact: Creating new jobs and changing work methods, but also presenting employment challenges.

Now, I will compose a comprehensive answer based on this information, referencing the relevant content from the knowledge base.
====================Complete Response====================
# AI Development Trend Prediction: From Technological Breakthroughs to Social Transformation

According to recent AI news and industry analysis, the AI field is undergoing a profound transformation from technological breakthroughs to social applications. Here are key development trend predictions based on the latest data:

## 1. Explosive Growth in Market Size

...

## 7. Industrial Transformation and Job Reshaping

AI is reshaping the job market, creating new professions while changing traditional work methods. By 2026, the long-term impact of AI and automation on work will become evident: a new class of professions will rise rapidly, while some traditional roles will inevitably decline or even disappear[ref_4]. New positions like prompt engineers, AI integration specialists, and ethics and governance experts are bringing unprecedented value to businesses.

Salaries in the AI and machine learning fields continue to lead the tech industry. In 2025, the average monthly salary for algorithm engineers reached 21,000 CNY, with senior experts earning over one million CNY annually. Salary increases for specialized roles like NLP engineers and computer vision engineers reached 25%-30%[ref_7]. However, behind the high salaries, companies have more "hardcore" requirements for talent, demanding both deep technical expertise and industry insight.

## Conclusion

AI is no longer just a "tech hotspot" but a convergence point for policy support, capital investment, and industrial upgrading[ref_1]. From single-turn queries to multi-turn conversations and from "machine learning" to "machine intelligence," AI is profoundly changing how we live and work[ref_8]. The key to navigating this transformation is to "let AI renew, not replace, people," leveraging the efficiency gains from AI while preserving human creativity and judgment[ref_10]. In the future, AI will be more than just a tool; it will be an intelligent collaborator in human work and life, jointly promoting social progress.

Java

Sample code

// DashScope SDK version >= 2.19.4
import java.util.Arrays;
import com.alibaba.dashscope.aigc.generation.SearchInfo;
import com.alibaba.dashscope.aigc.generation.SearchOptions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.dashscope.aigc.generation.Generation;
import com.alibaba.dashscope.aigc.generation.GenerationParam;
import com.alibaba.dashscope.aigc.generation.GenerationResult;
import com.alibaba.dashscope.common.Message;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import io.reactivex.Flowable;

public class Main {
    // The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
    static {Constants.baseHttpApiUrl="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1";}
    private static final Logger logger = LoggerFactory.getLogger(Main.class);
    private static StringBuilder reasoningContent = new StringBuilder();
    private static StringBuilder finalContent = new StringBuilder();
    private static boolean isFirstChunk = true;

    private static void handleGenerationResult(GenerationResult message) {
        String reasoning = message.getOutput().getChoices().get(0).getMessage().getReasoningContent();
        String content = message.getOutput().getChoices().get(0).getMessage().getContent();
        
        if (isFirstChunk && message.getOutput().getSearchInfo() != null) {
            System.out.println("====================Search Information====================");
            System.out.print(message.getOutput().getSearchInfo().getSearchResults());
            System.out.println("\n====================Thinking Process====================");
            isFirstChunk = false;
        }

        if (reasoning != null && !reasoning.isEmpty()) {
            reasoningContent.append(reasoning);
            System.out.print(reasoning);
        }

        if (content != null && !content.isEmpty()) {
            if (reasoningContent.length() > 0 && finalContent.length() == 0) {
                 System.out.println("\n====================Complete Response====================");
            }
            finalContent.append(content);
            System.out.print(content);
        }
        if (message.getOutput().getChoices().get(0).getFinishReason() != null && 
            !message.getOutput().getChoices().get(0).getFinishReason().isEmpty()) {
            System.out.println("\n====================Token Usage====================");
            System.out.println(message.getUsage());
        }
    }
    private static GenerationParam buildGenerationParam(Message userMsg) {
        // Define search options
        SearchOptions searchOptions = SearchOptions.builder()
                // Include search source information in the response
                .enableSource(true)
                // Parameter to force web search
                .forcedSearch(true)
                // Enable citation
                .enableCitation(true)
                // Sets the citation format to [ref_<number>]
                .citationFormat("[ref_<number>]")
                .searchStrategy("max")
                .build();

        return GenerationParam.builder()
                // Reads the API key from the DASHSCOPE_API_KEY environment variable. Alternatively, you can set it directly: .apiKey("sk-xxx")
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                .model("qwen-plus")
                .enableThinking(true)
                .messages(Arrays.asList(userMsg))
                // Parameter to enable web search
                .enableSearch(true)
                .searchOptions(searchOptions)
                .resultFormat("message")
                .incrementalOutput(true)
                .build();
    }
    public static void streamCallWithMessage(Generation gen, Message userMsg)
            throws NoApiKeyException, ApiException, InputRequiredException {
        GenerationParam param = buildGenerationParam(userMsg);
        Flowable<GenerationResult> result = gen.streamCall(param);
        result.blockingForEach(message -> handleGenerationResult(message));
    }

    public static void main(String[] args) {
        try {
            Generation gen = new Generation();
            Message userMsg = Message.builder().role(Role.USER.getValue()).content("Based on recent AI news, predict the development trends of AI.").build();
            streamCallWithMessage(gen, userMsg);
//             Print the final result
//            if (reasoningContent.length() > 0) {
//                System.out.println("\n====================Complete Response====================");
//                System.out.println(finalContent.toString());
//            }
        } catch (ApiException | NoApiKeyException | InputRequiredException e) {
            logger.error("An exception occurred: {}", e.getMessage());
        }
        System.exit(0);
    }
}

Response

====================Search Information====================
[SearchInfo.SearchResult(siteName=CSDN, icon=..., index=1, title=2025 AI Trend Outlook: The Coming Intelligent Revolution, url=...), SearchInfo.SearchResult(siteName=Tencent, icon=..., index=2, title=Top 10 Trends of Artificial Intelligence (AI) in China for 2025, url=...), SearchInfo.SearchResult(siteName=Baijiahao, icon=..., index=3, title=Top 10 AI Trends for 2025: This Time, AI Is Really Getting Moving!, url=...), SearchInfo.SearchResult(siteName=Baijiahao, icon=..., index=4, title=What are the future development trends of AI large models? Three main lines reshape the industrial landscape, and on-device intelligence ushers in the era of AI for all!, url=...), SearchInfo.SearchResult(siteName=CSDN, icon=..., index=5, title=Top 10 AI Development Predictions for 2025: Multimodal Fusion and Edge AI Proliferation to Become Core Growth Drivers, url=...), SearchInfo.SearchResult(siteName=CSDN, icon=..., index=6, title=2025 Artificial Intelligence Development Outlook: Unveiling 7 Major Trends Leading Future Technology!, url=...), SearchInfo.SearchResult(siteName=Tencent, icon=..., index=7, title=6 Major Artificial Intelligence Trends for 2025, url=...), SearchInfo.SearchResult(siteName=Baijiahao, icon=..., index=8, title=Large-scale adoption of AI tools in 2025, with 266 million more users in China in six months, url=...), SearchInfo.SearchResult(siteName=Baijiahao, icon=..., index=9, title=Large-scale adoption of AI tools in 2025, with 266 million more users in China in six months, url=...), SearchInfo.SearchResult(siteName=Baijiahao, icon=..., index=10, title=Artificial Intelligence Explores Deep Waters—An Interview with Zhang Junping, Director of the Popularization Working Committee of the Chinese Association of Automation, url=...)]
====================Thinking Process====================
To analyze AI development trends based on the content in the knowledge base, I need to integrate information from multiple articles predicting 2025 trends. These articles were published at various times throughout 2025, from July to October. My task is to synthesize this information and extract the primary development trends.

Let me outline the main AI development trends mentioned in the knowledge base:

...

8. **Security and Ethical Concerns**:
   - [ref_6] mentions "safe and unbiased artificial intelligence."
   - [ref_10] discusses challenges such as "data privacy, algorithmic fairness, and technical ethics."

Now, I will prepare a structured response focusing on the main AI development trends for 2025, citing the relevant content from the knowledge base.
====================Complete Response====================
# 2025 AI Development Trend Prediction: From Tool to Partner in the Intelligent Revolution

Artificial intelligence is currently advancing at an unprecedented rate. According to the latest industry reports and expert analyses, the AI sector is poised for several key breakthroughs in 2025. Based on recent news, I have compiled the following AI development trends for you:

## 1. The Rise of Autonomous AI Agents: From Tools to Intelligent Partners

In 2025, AI Agents are evolving from simple tools into intelligent partners capable of autonomously planning, decision-making, and executing tasks, heralding a new era of "Service as Software."[ref_1] These AI Agents exhibit greater autonomy, understand complex user intents, complete tasks proactively with minimal human intervention, and can handle multiple tasks concurrently while collaborating across different systems.[ref_1]

...

## Challenges and Outlook

Despite its rapid advancement, AI still faces challenges related to data privacy, algorithmic fairness, and technical ethics.[ref_10] As Professor Zhang Junping of Fudan University stated, "The boundary of artificial intelligence is never a destination defined by technology, but the starting point for human exploration and creation."[ref_10]

The development of AI in 2025 has moved beyond conceptual hype into a golden age of large-scale practical application. The global market is growing at an average annual rate of nearly 29%, with a total valuation of $185 billion.[ref_8] As the technology continues to mature and application scenarios multiply, AI will continue to reshape our work and lifestyles, sparking a true intelligent revolution.
====================Token Usage====================
GenerationUsage(inputTokens=5615, outputTokens=2135, totalTokens=7750, outputTokensDetails=GenerationOutputTokenDetails(reasoningTokens=761), promptTokensDetails=GenerationUsage.PromptTokensDetails(cacheType=null, cachedTokens=0, cacheCreationInputTokens=null, cacheCreation=null))

HTTP

Sample code

Curl

# The following configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
curl -X POST "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text-generation/generation" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-DashScope-SSE: enable" \
-d '{
    "model": "qwen-plus",
    "input":{
        "messages":[      
            {
                "role": "user",
                "content": "Based on recent AI news, predict the development trends of AI."
            }
        ]
    },
    "parameters":{
        "enable_thinking": true,
        "incremental_output": true,
        "result_format": "message",
        "enable_search": true,
        "search_options": {
            "forced_search": true,
            "enable_source": true,
            "enable_citation": true,
            "citation_format": "[ref_<number>]",
            "search_strategy": "max"
        }
    }
}'

Web search with Responses API

You can enable web search by adding the web_search tool to the tools array of the tools parameter.

This feature is supported only for qwen3.7-plus, qwen3.7-plus-2026-05-26, qwen3.6-plus, qwen3.6-plus-2026-04-02, qwen3.5-plus, qwen3.5-plus-2026-02-15, qwen3.6-flash, qwen3.6-flash-2026-04-16, qwen3.5-flash, qwen3.5-flash-2026-02-23; and for qwen3-max and qwen3-max-2026-01-23 in thinking mode.
For best results, we recommend enabling the web_search, web_extractor, and code_interpreter tools together.
For usage instructions, code examples, and migration guides for the Responses API, see OpenAI-compatible - Responses.
from openai import OpenAI
import os

client = OpenAI(
    # If you have not configured an environment variable, replace the following line with your Model Studio API key: api_key="sk-xxx",
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    # This configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
    base_url="https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
)

response = client.responses.create(
    model="qwen3.7-max",
    input="Hangzhou weather",
    tools=[
        {"type": "web_search"},
        {"type": "web_extractor"},
        {"type": "code_interpreter"}
    ],
    extra_body={"enable_thinking": True}
)

print("="*20 + "Response content" + "="*20)
print(response.output_text)

print("="*20 + "Tool call count" + "="*20)
usage = response.usage
if hasattr(usage, 'x_tools') and usage.x_tools:
    print(f"Web search count: {usage.x_tools.get('web_search', {}).get('count', 0)}")
# Uncomment the following lines to view the intermediate output
# for r in response.output:
#     print(r.model_dump_json())
import OpenAI from "openai";

const openai = new OpenAI({
    // If you have not configured an environment variable, replace the following line with your Model Studio API key: apiKey: "sk-xxx",
    apiKey: process.env.DASHSCOPE_API_KEY,
    // This configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
    baseURL: "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
});

async function main() {
    const response = await openai.responses.create({
        model: "qwen3.7-max",
        input: "Hangzhou weather",
        tools: [
            { type: "web_search" },
            { type: "web_extractor" },
            { type: "code_interpreter" }
        ],
        enable_thinking: true
    });

    console.log("====================Response content====================");
    console.log(response.output_text);

    console.log("====================Tool call count====================");
    console.log(`Web search count: ${response.usage?.x_tools?.web_search?.count || 0}`);

    // console.log(JSON.stringify(response.output[0], null, 2));
}

main();
# This configuration is for the China (Beijing) region. Replace {WorkspaceId} with your actual workspace ID. Configurations vary by region.
curl -X POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/responses \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "model": "qwen3.7-max",
    "input": "Hangzhou weather",
    "tools": [
        {"type": "web_search"},
        {"type": "web_extractor"},
        {"type": "code_interpreter"}
    ],
    "enable_thinking": true
}'

Billing

Charges for web search consist of two components:

  • model call fees: The web search feature appends retrieved web content to the prompt, increasing the number of input tokens. These tokens are billed at the model's standard rate. For pricing details, see the Model Studio console. When you use the Responses API, the web search tool is billed at the same rate as the agent policy.

  • search policy fees:

    • turbo and max policies: Standard billing applies starting from 00:00 on February 27, 2026. The fee is CNY 3 per 1,000 calls for the turbo policy and CNY 4 per 1,000 calls for the max policy. This pricing applies only to the Chinese mainland region.

    • agent policy:

      • The fee per 1,000 calls is as follows:

        • For the Chinese mainland and global deployment scopes: CNY 4.

        • For the international deployment scope: CNY 73.392381.

    • agent_max policy (Limited-time offer):

      This policy covers both the web search and the web extractor tool.

      • Fee per 1,000 calls for the web search tool:

        • For the Chinese mainland deployment scope: CNY 4.

        • For the international deployment scope: CNY 73.392381.

      • The web extractor tool is free for a limited time.

Rate limit

The rate limit for web search is 15 requests per second (RPS) per Alibaba Cloud account. This limit applies to the total requests from all API keys under the account, regardless of the model. If the limit is exceeded, the API call will not trigger the search step and will not return an error.

FAQ

Q: Why doesn't the model perform a web search after I enable it?

A: This can happen for the following reasons:

  • The model determines a search is unnecessary: The model may decide that the query can be answered using its internal knowledge and does not require real-time information. To force a web search, set forced_search: true in the search_options parameter.

  • The rate limit is exceeded: Your account's request frequency has surpassed 15 RPS. The API does not return an error but silently skips the web search step. To resolve this, reduce your request frequency.

  • Unsupported model: The model you are using does not support web search. See Supported models.

Q: How can I determine if a search was performed?

A: The method depends on the API you are using:

  • DashScope

    • If a search was performed, the response includes a search_info field, and the usage object contains a plugins field.

    • If a search is not performed, the response does not contain the search_info field, and the usage object does not contain the plugins field.

  • OpenAI-compatible

    The response provides no explicit indicator. You can infer that a search occurred by comparing the input token count in the usage object. A count significantly higher than your original prompt's token count suggests a web search was performed.

    For example, a query like "What's the weather in Hangzhou?" might use 10 input tokens without a search, but 1,953 input tokens with a search.

Q: Why does web search fail for English queries?

A: We are continuously optimizing the search-triggering logic for English queries. For now, we recommend either asking questions in Chinese or forcing a web search when using English input.

Q: Is my original prompt sent to external search engines?

A: No. Your original prompt is not sent directly to a search engine. Instead, the system analyzes your query's intent, applies multiple layers of data masking, and extracts only key, non-sensitive information fragments for retrieval. The system rewrites the query multiple times before sending it to the search engine to ensure no sensitive data is exposed in plaintext. Alibaba Cloud uses data encryption and privacy protection measures to ensure security. For details, see the Service Agreement.

Q: Can my original text be reconstructed from the search vectors?

A: No. A vector is a high-dimensional mathematical representation of data and is not human-readable. It is computationally infeasible for an external system to reverse-engineer the original text from its vector. Furthermore, the vector matching process occurs within a secure, trusted environment and is never exposed to public search engines.

Q: How does the system decide whether to perform a web search?

A: The system first determines whether a search is necessary. It typically triggers a search for time-sensitive or encyclopedic queries, as these are less likely to contain confidential information. Conversely, it generally does not perform a search for queries unrelated to current events. The system rewrites the query multiple times before performing any search.

Error messages

To troubleshoot errors, see Error codes.