大模型的训练数据存在知识截止日期,无法回答实时问题。启用联网搜索后,模型可从网络获取实时数据,准确回答股票价格、天气预报、最新新闻等时效性问题。
使用方式
DashScope、Chat Completions 设置enable_search: true,通过 search_options 配置 agent 或 agent_max;Responses、Anthropic 通过 web_search 工具启用联网搜索。
支持的模型
下表按模型和协议列出联网搜索的支持情况。 Qwen 版本系列指该版本下的 Max、Plus、Flash 和开源模型。千问模型
千问模型
| 模型 | agent / agent_max | web_search (Responses) | web_search (Anthropic) |
|---|---|---|---|
| Qwen4、Qwen3.8 | 不支持 | 支持 | 支持 |
| Qwen3.7 | 支持 | 支持 | Max / Plus / Flash |
| Qwen3.8-Omni-Flash | 仅 agent | 支持 | 不支持 |
| Qwen3.5-Omni(Plus、Flash) Qwen3.8-Omni-Flash-Realtime Qwen3.5-Omni-Realtime(Plus、Flash) | 仅 agent | 不支持 | 不支持 |
第三方模型
第三方模型
| 模型 | agent / agent_max | web_search (Responses) | web_search (Anthropic) |
|---|---|---|---|
| deepseek-v4-pro、deepseek-v4-pro-0813 deepseek-v4-flash-0731、deepseek-v4.1-flash-1017 | 支持 | 支持 | 支持 |
| glm-5.2 | 不支持 | 支持 | 支持 |
| kimi-k3、kimi-k3.1-pro | 不支持 | 支持 | 支持 |
Qwen3.6 及更早版本
Qwen3.6 及更早版本
| 模型 | agent / agent_max | web_search (Responses) | web_search (Anthropic) |
|---|---|---|---|
| Qwen3.6(Plus、Flash) | 支持 | 支持 | 支持 |
| qwen3.6-35b-a3b | 支持 | 支持 | 不支持 |
| qwen3.6-27b | 支持 | 不支持 | 不支持 |
| Qwen3.5(Plus、Flash) | 支持 | 支持 | 支持 |
| qwen3.5-27b、qwen3.5-35b-a3b qwen3.5-122b-a10b、qwen3.5-397b-a17b | 支持 | 支持 | 不支持 |
agent 策略。调用示例
以下示例使用新加坡配置,查询天气及景区游览提醒。DashScope、Chat Completions 使用多模态模型qwen3.7-plus 和 agent 策略;Responses、Anthropic 使用 qwen4-max 和 web_search 工具。
其他地域的接入域名和业务空间部署范围,参见选择地域、服务部署范围和接入域名。
多模态模型使用多模态接口;DashScope 联网搜索需流式调用(stream=True),Java 使用 MultiModalConversation.streamCall。文本模型使用文本生成接口。
- DashScope
- Chat Completions
- Responses
- Anthropic
Copy
import os
import dashscope
client = dashscope.Client(
api_key=os.environ["DASHSCOPE_API_KEY"],
workspace=os.environ["DASHSCOPE_WORKSPACE"],
region="ap-southeast-1",
)
stream = client.multimodal.chat.create(
model="qwen3.7-plus",
messages=[{"role": "user", "content": [{"text": 'Search the web for current weather in Singapore and recent visitor notices for Gardens by the Bay. Give temperature, rain, a short route, clothing advice, and source URLs in at most 200 words.'}]}],
stream=True,
incremental_output=True,
max_tokens=2500,
enable_search=True,
search_options={"search_strategy": "agent", "enable_source": True},
)
usage = None
sources_printed = False
for chunk in stream:
if chunk.search_info and chunk.search_info.search_results and not sources_printed:
print(chunk.search_info.model_dump_json(indent=2))
sources_printed = True
for choice in chunk.choices:
print(choice.delta.content or "", end="", flush=True)
if chunk.usage:
usage = chunk.usage
print()
if usage:
print(usage.model_dump_json(indent=2))
output.search_info.search_results 返回搜索来源,usage.plugins.search 返回搜索计数和策略。查看响应示例
查看响应示例
以下响应省略了重复条目、内容分片和长文本。
Copy
id:1
event:result
:HTTP_STATUS/200
data: {"output":{"choices":[{"finish_reason":"null","message":{"role":"assistant","reasoning_content":"Thinking","content":[]}}],"search_info":{"search_results":[]}},"usage":{"input_tokens":370,"output_tokens":1,"total_tokens":371,"output_tokens_details":{"reasoning_tokens":1,"text_tokens":1},"prompt_tokens_details":{"cached_tokens":0},"input_tokens_details":{"text_tokens":370}},"request_id":"1e85c487-48dd-980f-853c-5bd164877bf9"}
... (repeated chunks omitted)
id:93
event:result
:HTTP_STATUS/200
data: {"output":{"choices":[{"finish_reason":"null","message":{"role":"assistant","reasoning_content":"","content":[]}}],"search_info":{"search_results":[{"title":"Singapore, Central Singapore, Singapore Weather Forecast","url":"https://www.accuweather.com/en/sg/singapore/300597/weather-forecast/300597","index":1},"... (remaining entries omitted)"]}},"usage":{"input_tokens":370,"output_tokens":357,"total_tokens":727,"output_tokens_details":{"reasoning_tokens":305,"text_tokens":357},"prompt_tokens_details":{"cached_tokens":0},"plugins":{"search":{"count":1,"strategy":"agent"}},"input_tokens_details":{"text_tokens":370}},"request_id":"1e85c487-48dd-980f-853c-5bd164877bf9"}
... (repeated chunks omitted)
id:372
event:result
:HTTP_STATUS/200
data: {"output":{"choices":[{"finish_reason":"null","message":{"role":"assistant","content":[{"text":"**"}],"reasoning_content":""}}],"search_info":{"search_results":[{"title":"Singapore, Central Singapore, Singapore Weather Forecast","url":"https://www.accuweather.com/en/sg/singapore/300597/weather-forecast/300597","index":1},"... (remaining entries omitted)"]}},"usage":{"input_tokens":2425,"output_tokens":1322,"total_tokens":3747,"output_tokens_details":{"reasoning_tokens":1266,"text_tokens":1322},"prompt_tokens_details":{"cached_tokens":0},"plugins":{"search":{"count":1,"strategy":"agent"}},"input_tokens_details":{"text_tokens":2425}},"request_id":"1e85c487-48dd-980f-853c-5bd164877bf9"}
... (repeated chunks omitted)
id:445
event:result
:HTTP_STATUS/200
data: {"output":{"choices":[{"finish_reason":"stop","message":{"role":"assistant","content":[],"reasoning_content":""}}],"search_info":{"search_results":[{"title":"Singapore, Central Singapore, Singapore Weather Forecast","url":"https://www.accuweather.com/en/sg/singapore/300597/weather-forecast/300597","index":1},"... (remaining entries omitted)"]}},"usage":{"input_tokens":2425,"output_tokens":1591,"total_tokens":4016,"output_tokens_details":{"reasoning_tokens":1266,"text_tokens":1591},"prompt_tokens_details":{"cached_tokens":0},"plugins":{"search":{"count":1,"strategy":"agent"}},"input_tokens_details":{"text_tokens":2425}},"request_id":"1e85c487-48dd-980f-853c-5bd164877bf9"}
Copy
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DASHSCOPE_API_KEY"],
base_url=f"https://{os.environ['DASHSCOPE_WORKSPACE']}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
)
stream = client.chat.completions.create(
model="qwen3.7-plus",
messages=[{"role": "user", "content": 'Search the web for current weather in Singapore and recent visitor notices for Gardens by the Bay. Give temperature, rain, a short route, clothing advice, and source URLs in at most 200 words.'}],
stream=True,
stream_options={"include_usage": True},
max_tokens=2500,
extra_body={
"enable_search": True,
"include_tool_usage": True,
"search_options": {"search_strategy": "agent"},
},
)
for chunk in stream:
for choice in chunk.choices:
print(choice.delta.content or "", end="", flush=True)
if chunk.usage:
print(chunk.usage.model_dump_json(indent=2))
choices[].delta.content 返回回答分片;开启 include_tool_usage 后,通过 usage.x_tools.search.count 查看搜索计数。查看响应示例
查看响应示例
以下响应省略了重复条目、内容分片和长文本。
Copy
data: {"model":"qwen3.7-plus","id":"chatcmpl-bd86300b-7696-9069-9c04-5352fa044898","created":1796009451,"object":"chat.completion.chunk","usage":null,"choices":[{"logprobs":null,"index":0,"delta":{"reasoning_content":"","content":"","role":"assistant"},"finish_reason":null}]}
... (repeated chunks omitted)
data: {"id":"chatcmpl-bd86300b-7696-9069-9c04-5352fa044898","object":"chat.completion.chunk","created":1796009451,"model":"qwen3.7-plus","choices":[{"index":0,"delta":{"content":"","reasoning_content":"Thinking"},"logprobs":null,"finish_reason":null}],"usage":null}
... (repeated chunks omitted)
data: {"id":"chatcmpl-bd86300b-7696-9069-9c04-5352fa044898","object":"chat.completion.chunk","created":1796009481,"model":"qwen3.7-plus","choices":[{"index":0,"delta":{"content":"**Weather","reasoning_content":""},"logprobs":null,"finish_reason":null}],"usage":null}
... (repeated chunks omitted)
data: {"id":"chatcmpl-bd86300b-7696-9069-9c04-5352fa044898","object":"chat.completion.chunk","created":1796009483,"model":"qwen3.7-plus","choices":[{"index":0,"delta":{"content":"","reasoning_content":""},"finish_reason":"stop","logprobs":null}],"usage":null}
... (repeated chunks omitted)
data: {"id":"chatcmpl-bd86300b-7696-9069-9c04-5352fa044898","object":"chat.completion.chunk","created":1796009483,"model":"qwen3.7-plus","choices":[],"usage":{"prompt_tokens":2835,"total_tokens":4694,"completion_tokens":1859,"prompt_tokens_details":{"cached_tokens":0,"text_tokens":2835},"completion_tokens_details":{"reasoning_tokens":1605,"text_tokens":1859},"x_tools":{"search":{"count":1,"strategy":"agent"}}}}
data: [DONE]
Responses 不使用
search_strategy。qwen3.8-omni-flash 的内置工具仅支持 web_search。搜索来源通过 web_search_call.action.sources 返回;Responses 不使用 enable_source、enable_citation、citation_format。Copy
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DASHSCOPE_API_KEY"],
base_url=f"https://{os.environ['DASHSCOPE_WORKSPACE']}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
)
response = client.responses.create(
model="qwen4-max",
input='Search the web for current weather in Singapore and recent visitor notices for Gardens by the Bay. Give temperature, rain, a short route, clothing advice, and source URLs in at most 200 words.',
tools=[
{"type": "web_search"},
],
max_output_tokens=2500,
)
print(response.output_text)
for item in response.output:
if item.type != "message":
print(item.model_dump_json(indent=2))
print(response.model_dump_json(indent=2))
web_search_call.action.sources 返回来源 URL,message 返回回答;Qwen4 通过 tool_usage.web_search.num_requests 返回工具调用次数。查看响应示例
查看响应示例
以下响应省略了重复条目、内容分片和长文本。
Copy
{
"background": false,
"completed_at": 1796008024,
"created_at": 1796007945,
"frequency_penalty": 0.0,
"id": "resp_1c1963a2-7fca-938d-8609-7db63b053615",
"max_output_tokens": 2500,
"metadata": {},
"model": "qwen4-max",
"object": "response",
"output": [
{
"content": [
{
"text": "The user wants to know Singapore's current weather and recent visitor notices for Gardens by the Bay. Let me search.",
"type": "reasoning_text"
}
],
"id": "rs_0eeda71c-0c2d-4377-999a-a382576dba52",
"status": "completed",
"summary": [],
"type": "reasoning"
},
{
"action": {
"queries": [
"Singapore current weather temperature rain November 30 2026",
"... (remaining entries omitted)"
],
"query": "Singapore current weather temperature rain November 30 2026",
"sources": [
{
"type": "url",
"url": "https://www.accuweather.com/en/sg/singapore/300597/november-weather/300597"
},
"... (remaining entries omitted)"
],
"type": "search"
},
"id": "ws_fa48f5f4-349c-4ac0-96a8-80b8d2cd3a82",
"status": "completed",
"type": "web_search_call"
},
{
"content": [
{
"annotations": [],
"logprobs": [],
"text": "**Weather now (Mon 30 Nov):** ~26–28°C across stations at ~11am; today 23–32°C, humidity 65–95%. Light–moderate rain cleared this morning, cloudy after; heavy rain hit West Coast (... (remaining text omitted)",
"type": "output_text"
}
],
"id": "msg_be94e81c-87cc-4fc0-af41-61a83d81fe4a",
"role": "assistant",
"status": "completed",
"type": "message"
}
],
"parallel_tool_calls": true,
"presence_penalty": 0.0,
"service_tier": "default",
"status": "completed",
"store": true,
"temperature": 1.0,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tool_usage": {
"web_search": {
"num_requests": 1
}
},
"tools": [
{
"type": "web_search"
}
],
"top_logprobs": 0,
"top_p": 1.0,
"usage": {
"input_tokens": 20063,
"input_tokens_details": {
"cache_write_tokens": 0,
"cached_tokens": 13312
},
"output_tokens": 1135,
"output_tokens_details": {
"reasoning_tokens": 317
},
"total_tokens": 21198
}
}
直接通过 Anthropic SDK 或 HTTP 调用时,需在
system 中传入 x-anthropic-billing-header: cc_entrypoint=cli; 才能启用搜索。Claude Code 等官方客户端会提供客户端标识。Copy
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ["DASHSCOPE_API_KEY"],
base_url=f"https://{os.environ['DASHSCOPE_WORKSPACE']}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic",
)
response = client.messages.create(
model="qwen4-max",
max_tokens=2500,
system=[{"type": "text", "text": "x-anthropic-billing-header: cc_entrypoint=cli;"}],
messages=[{"role": "user", "content": 'Search the web for current weather in Singapore and recent visitor notices for Gardens by the Bay. Give temperature, rain, a short route, clothing advice, and source URLs in at most 200 words.'}],
tools=[{"type": "web_search_20250305", "name": "web_search", "max_uses": 3}],
)
for block in response.content:
if block.type == "text":
print(block.text)
elif block.type in ("server_tool_use", "web_search_tool_result"):
print(block.model_dump_json(indent=2))
print(response.usage.model_dump_json(indent=2))
server_tool_use、web_search_tool_result 返回工具调用和搜索来源,text 返回回答;usage.server_tool_use.web_search_requests 返回搜索次数。查看响应示例
查看响应示例
以下响应省略了重复条目、内容分片和长文本。
Copy
{
"content": [
{
"signature": "",
"thinking": "I need to search for Singapore's current weather and visitor notices for Gardens by the Bay. Let's run the searches in parallel.",
"type": "thinking"
},
{
"caller": {
"type": "direct"
},
"id": "srvtoolu_35a01912b4ff4228a43e2dbd",
"input": {
"queries": [
"Singapore current weather temperature rain today NEA",
"... (remaining entries omitted)"
]
},
"name": "web_search",
"type": "server_tool_use"
},
{
"caller": {
"type": "direct"
},
"content": [
{
"encrypted_content": "eyJ0aXRsZSI6ICJTaW5nYXBvcmUsIFNpbmdhcG9yZSAxMC1EYXkgV2VhdGhlciBGb3JlY2FzdCIsICJ1cmwiOiAiaHR0cHM6Ly93d3cud3VuZGVyZ3JvdW5kLmNvbS9mb3JlY2FzdC9teS9tYXNhaS9JU0lOR0EyMDEiLCAiaW5kZXgiOiAxfQ==",
"title": "Singapore, Singapore 10-Day Weather Forecast",
"type": "web_search_result",
"url": "https://www.wunderground.com/forecast/my/masai/ISINGA201"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJXZWF0aGVyIGluIFNpbmdhcG9yZSwgU2luZ2Fwb3JlIiwgInVybCI6ICJodHRwczovL3dlYXRoZXIudG9tb3Jyb3cuaW8vU0cvMDEvU2luZ2Fwb3JlLzEwNDA1Ny8iLCAiaW5kZXgiOiAyfQ==",
"title": "Weather in Singapore, Singapore",
"type": "web_search_result",
"url": "https://weather.tomorrow.io/SG/01/Singapore/104057/"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJTaW5nYXBvcmUgV2VhdGhlciAoQFNpbmdhcG9yZVNHKSAiLCAidXJsIjogImh0dHBzOi8veC5jb20vU2luZ2Fwb3JlU0ciLCAiaW5kZXgiOiAzfQ==",
"title": "Singapore Weather (@SingaporeSG)",
"type": "web_search_result",
"url": "https://x.com/SingaporeSG"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICIxMC1kYXkgd2VhdGhlciBmb3JlY2FzdCBmb3IgU2luZ2Fwb3JlICIsICJ1cmwiOiAiaHR0cHM6Ly93ZWF0aGVyLmNvbS9lbi1DQS9zZy9jaXR5L3NpbmdhcG9yZS90ZW5kYXkiLCAiaW5kZXgiOiA0fQ==",
"title": "10-day weather forecast for Singapore",
"type": "web_search_result",
"url": "https://weather.com/en-CA/sg/city/singapore/tenday"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJXZWF0aGVyIEZvcmVjYXN0IGFuZCBDb25kaXRpb25zIGZvciBTaW5nYXBvcmUsIDA0OTM5MiwgQ2VudHJhbCBTaW5nYXBvcmUgQ29tbXVuaXR5IERldmVsb3BtZW50IENvdW5jaWwsIFNpbmdhcG9yZSIsICJ1cmwiOiAi... (remaining text omitted)",
"title": "Weather Forecast and Conditions for Singapore, 049392, Central Singapore Community Development Council, Singapore",
"type": "web_search_result",
"url": "https://weather.com/sg/central-singapore-community-development-council/postcode/049392/today"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJTaW5nYXBvcmUgV2VhdGhlciBUb2RheSDigJMgSG91cmx5IEZvcmVjYXN0IHwgcWEuZnJlZW1ldGVvLmNvbSIsICJ1cmwiOiAiaHR0cHM6Ly9xYS5mcmVlbWV0ZW8uY29tL3dlYXRoZXIvc2luZ2Fwb3JlL2hvdXJseS1m... (remaining text omitted)",
"title": "Singapore Weather Today – Hourly Forecast | qa.freemeteo.com",
"type": "web_search_result",
"url": "https://qa.freemeteo.com/weather/singapore/hourly-forecast/today/?gid=1880252&language=english&country=singapore"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJTaW5nYXBvcmUgV2VhdGhlciAxNCBkYXlzIiwgInVybCI6ICJodHRwczovL3d3dy50aGV3ZWF0aGVyLmNvbS9zaW5nYXBvcmVfaW4tc2luZ2Fwb3JlLWMxMzM5My5odG0iLCAiaW5kZXgiOiA3fQ==",
"title": "Singapore Weather 14 days",
"type": "web_search_result",
"url": "https://www.theweather.com/singapore_in-singapore-c13393.htm"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICIxMC1kYXkgd2VhdGhlciBmb3JlY2FzdCBmb3IgU2luZ2Fwb3JlICIsICJ1cmwiOiAiaHR0cHM6Ly93ZWF0aGVyLmNvbS9lbi1LSS9zZy9jaXR5L3NpbmdhcG9yZS90ZW5kYXkiLCAiaW5kZXgiOiA4fQ==",
"title": "10-day weather forecast for Singapore",
"type": "web_search_result",
"url": "https://weather.com/en-KI/sg/city/singapore/tenday"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJIb3VybHkgV2VhdGhlciBGb3JlY2FzdCAtIFNpbmdhcG9yZSAiLCAidXJsIjogImh0dHBzOi8vY2xpbWVyYWRhci5jb20vaG91cmx5LXdlYXRoZXIvc2ctNTM2NzgwIiwgImluZGV4IjogOX0=",
"title": "Hourly Weather Forecast - Singapore",
"type": "web_search_result",
"url": "https://climeradar.com/hourly-weather/sg-536780"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJTaW5nYXBvcmUsIFNpbmdhcG9yZSBIb3VybHkgV2VhdGhlciBGb3JlY2FzdCIsICJ1cmwiOiAiaHR0cHM6Ly93d3cud3VuZGVyZ3JvdW5kLmNvbS9ob3VybHkvbXkvc2VtZW55aWgvSVNJTkdBMTQzIiwgImluZGV4IjogMTB9",
"title": "Singapore, Singapore Hourly Weather Forecast",
"type": "web_search_result",
"url": "https://www.wunderground.com/hourly/my/semenyih/ISINGA143"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJPcGVuaW5nIEhvdXJzICYgQ2xvc3VyZXMiLCAidXJsIjogImh0dHBzOi8vd3d3LmdhcmRlbnNieXRoZWJheS5jb20uc2cvZW4vcGxhbi15b3VyLXZpc2l0L29wZW5pbmctaG91cnMuaHRtbCIsICJpbmRleCI6IDExfQ==",
"title": "Opening Hours & Closures",
"type": "web_search_result",
"url": "https://www.gardensbythebay.com.sg/en/plan-your-visit/opening-hours.html"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkiLCAidXJsIjogImh0dHBzOi8vd3d3LmdhcmRlbnNieXRoZWJheS5jb20uc2cvIiwgImluZGV4IjogMTJ9",
"title": "Gardens by the Bay",
"type": "web_search_result",
"url": "https://www.gardensbythebay.com.sg/"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJGbG93ZXIgRG9tZSAtIENsb3VkIEZvcmVzdDogMjggSnVseSAyMDI2IOKAoiBGbG9yYWwgRmFudGFzeSIsICJ1cmwiOiAiaHR0cHM6Ly93d3cuZmFjZWJvb2suY29tL1NlYVdoZWVsVHJhdmVsL3Bvc3RzL3RoZS1tb250... (remaining text omitted)",
"title": "Flower Dome - Cloud Forest: 28 July 2026 • Floral Fantasy",
"type": "web_search_result",
"url": "https://www.facebook.com/SeaWheelTravel/posts/the-month-of-july-2026-closure-dates-for-the-following-attractions-may-affect-yo/1037617078598663/"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkiLCAidXJsIjogImh0dHBzOi8vdGhpbmdzdG9kb2xpc3RzLmNvbS9wcm9kdWN0cy82MTciLCAiaW5kZXgiOiAxNH0=",
"title": "Gardens by the Bay",
"type": "web_search_result",
"url": "https://thingstodolists.com/products/617"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJOb3RpY2VzIHwgU2luZ2Fwb3JlIEJvdGFuaWMgR2FyZGVucyIsICJ1cmwiOiAiaHR0cHM6Ly9zYmcubnBhcmtzLmdvdi5zZy92aXNpdC9ub3RpY2VzLyIsICJpbmRleCI6IDE1fQ==",
"title": "Notices | Singapore Botanic Gardens",
"type": "web_search_result",
"url": "https://sbg.nparks.gov.sg/visit/notices/"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkgY2xvc3VyZXMgZm9yIFNpbmdhcG9yZSBHYXJkZW4gRmVzdGl2YWwgMjAyNiIsICJ1cmwiOiAiaHR0cHM6Ly9saXR0bGViaWdyZWRkb3QuY29tL2dhcmRlbnMtYnktdGhlLWJheS1tZWFk... (remaining text omitted)",
"title": "Gardens by the Bay closures for Singapore Garden Festival 2026",
"type": "web_search_result",
"url": "https://littlebigreddot.com/gardens-by-the-bay-meadow-supertree-grove-closures-singapore-garden-festival-2026/"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkgKEBnYXJkZW5zYnl0aGViYXkpIiwgInVybCI6ICJodHRwczovL3d3dy5pbnN0YWdyYW0uY29tL2dhcmRlbnNieXRoZWJheS8/aGw9ZW4iLCAiaW5kZXgiOiAxN30=",
"title": "Gardens by the Bay (@gardensbythebay)",
"type": "web_search_result",
"url": "https://www.instagram.com/gardensbythebay/?hl=en"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkgU2luZ2Fwb3JlIFRpY2tldHMsIHRpbWluZ3MsIG9mZmVycyBOb3YgMjAyNiIsICJ1cmwiOiAiaHR0cHM6Ly93d3cuZXhwbG9yZWJlZXMuY29tL1NpbmdhcG9yZS9hdHRyYWN0aW9uL0dh... (remaining text omitted)",
"title": "Gardens by the Bay Singapore Tickets, timings, offers Nov 2026",
"type": "web_search_result",
"url": "https://www.explorebees.com/Singapore/attraction/Gardens-by-the-Bay/3683"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJGbG93ZXIgRG9tZSAtIFNpbmdhcG9yZSIsICJ1cmwiOiAiaHR0cHM6Ly93d3cuZ2FyZGVuc2J5dGhlYmF5LmNvbS5zZy9lbi90aGluZ3MtdG8tZG8vYXR0cmFjdGlvbnMvZmxvd2VyLWRvbWUuaHRtbCIsICJpbmRleCI6IDE5fQ==",
"title": "Flower Dome - Singapore",
"type": "web_search_result",
"url": "https://www.gardensbythebay.com.sg/en/things-to-do/attractions/flower-dome.html"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJPcGVuaW5nIEhvdXJzICYgQ2xvc3VyZXMiLCAidXJsIjogImh0dHBzOi8vd3d3LmdhcmRlbnNieXRoZWJheS5jb20uc2cvZW4vcGxhbi15b3VyLXZpc2l0L29wZW5pbmctaG91cnMuaHRtbCIsICJpbmRleCI6IDIwfQ==",
"title": "Opening Hours & Closures",
"type": "web_search_result",
"url": "https://www.gardensbythebay.com.sg/en/plan-your-visit/opening-hours.html"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkgVGlja2V0cyBpbiBTaW5nYXBvcmUgfCBQZWxhZ28iLCAidXJsIjogImh0dHBzOi8vd3d3LnBlbGFnby5jb20vZW4tVVMvYWN0aXZpdHkvcDB6bmktZ2FyZGVucy1ieS10aGUtYmF5LXNpbmdhcG9yZS8iLCAiaW5kZXgiOiAyMX0=",
"title": "Gardens by the Bay Tickets in Singapore | Pelago",
"type": "web_search_result",
"url": "https://www.pelago.com/en-US/activity/p0zni-gardens-by-the-bay-singapore/"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJDbG91ZCBGb3Jlc3QiLCAidXJsIjogImh0dHBzOi8vd3d3LmdhcmRlbnNieXRoZWJheS5jb20uc2cvZW4vdGhpbmdzLXRvLWRvL2F0dHJhY3Rpb25zL2Nsb3VkLWZvcmVzdC5odG1sIiwgImluZGV4IjogMjJ9",
"title": "Cloud Forest",
"type": "web_search_result",
"url": "https://www.gardensbythebay.com.sg/en/things-to-do/attractions/cloud-forest.html"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJEaXNjb3VudGVkIEdhcmRlbnMgYnkgdGhlIEJheSBUaWNrZXRzICYgR3VpZGUiLCAidXJsIjogImh0dHBzOi8vdXMudHJpcC5jb20vZ3VpZGUvYXR0cmFjdGlvbi9nYXJkZW5zLWJ5LXRoZS1iYXktdGlja2V0cy5odG1sIiwgImluZGV4IjogMjN9",
"title": "Discounted Gardens by the Bay Tickets & Guide",
"type": "web_search_result",
"url": "https://us.trip.com/guide/attraction/gardens-by-the-bay-tickets.html"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkgfCBTaW5nYXBvcmUgU2luZ2Fwb3JlIiwgInVybCI6ICJodHRwczovL3d3dy5mYWNlYm9vay5jb20vZ2FyZGVuc2J5dGhlYmF5LyIsICJpbmRleCI6IDI0fQ==",
"title": "Gardens by the Bay | Singapore Singapore",
"type": "web_search_result",
"url": "https://www.facebook.com/gardensbythebay/"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXk6IEZsb3dlciBEb21lICYgQ2xvdWQgRm9yZXN0IGZlYXR1cmluZyBKdXJhc3NpYyBXb3JsZDogVGhlIEV4cGVyaWVuY2UiLCAidXJsIjogImh0dHBzOi8vZ29jaXR5LmNvbS9lbi9zaW5n... (remaining text omitted)",
"title": "Gardens by the Bay: Flower Dome & Cloud Forest featuring Jurassic World: The Experience",
"type": "web_search_result",
"url": "https://gocity.com/en/singapore/attractions/Gardens-by-the-bay-flower-dome-cloud-forest"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkgKEBnYXJkZW5zYnl0aGViYXkpIiwgInVybCI6ICJodHRwczovL3d3dy5pbnN0YWdyYW0uY29tL2dhcmRlbnNieXRoZWJheS8/aGw9ZW4iLCAiaW5kZXgiOiAyNn0=",
"title": "Gardens by the Bay (@gardensbythebay)",
"type": "web_search_result",
"url": "https://www.instagram.com/gardensbythebay/?hl=en"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJGbG93ZXIgRG9tZSAtIFNpbmdhcG9yZSIsICJ1cmwiOiAiaHR0cHM6Ly93d3cuZ2FyZGVuc2J5dGhlYmF5LmNvbS5zZy9lbi90aGluZ3MtdG8tZG8vYXR0cmFjdGlvbnMvZmxvd2VyLWRvbWUuaHRtbCIsICJpbmRleCI6IDI3fQ==",
"title": "Flower Dome - Singapore",
"type": "web_search_result",
"url": "https://www.gardensbythebay.com.sg/en/things-to-do/attractions/flower-dome.html"
},
{
"encrypted_content": "eyJ0aXRsZSI6ICJHYXJkZW5zIGJ5IHRoZSBCYXkgVGlja2V0czogRG9tZXMgJiBTa3lsaW5lIFZpZXdzIiwgInVybCI6ICJodHRwczovL3d3dy5ra2RheS5jb20vZW4tdXMvcHJvZHVjdC8zMTU4LWdhcmRlbnMtYnktdGhlLWJheS1zaW5n... (remaining text omitted)",
"title": "Gardens by the Bay Tickets: Domes & Skyline Views",
"type": "web_search_result",
"url": "https://www.kkday.com/en-us/product/3158-gardens-by-the-bay-singapore-ticket?srsltid=AY6E9604hdxCMlKbH6ssh-NL7Tk8ICDf0va9QLExIlAV1wm1v5pBvSdu"
}
],
"tool_use_id": "srvtoolu_35a01912b4ff4228a43e2dbd",
"type": "web_search_tool_result"
},
{
"signature": "",
"thinking": "The weather search results are inconsistent, and some appear to be cached. Main relevant data: currently around 28–31°C, with thunderstorms/light rain showers, feels-like temperatu... (remaining text omitted)",
"type": "thinking"
},
{
"text": "**Weather (as of ~12:49pm SGT):** ~28°C (83°F), feels like ~31°C, light rain showers with thunderstorms likely through ~6pm; humidity high (~80–97%). Expect on-and-off showers all ... (remaining text omitted)",
"type": "text"
}
],
"id": "msg_5ae98a6b-5ff5-9fd7-8144-db39e489a719",
"model": "qwen4-max",
"role": "assistant",
"stop_reason": "end_turn",
"type": "message",
"usage": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"input_tokens": 3143,
"output_tokens": 672,
"prompt_tokens_details": {
"cached_tokens": 512
},
"server_tool_use": {
"web_search_requests": 1
},
"x_tools": {
"web_search": {
"count": 1
}
}
}
}
计费说明
联网搜索费用由模型调用费用和搜索工具费用组成。- 模型调用费用:检索到的网页内容增加输入 Token,按所用模型的标准价格计费,价格请查看百炼控制台。
- 搜索工具费用:按下表计费,Responses 和 Anthropic 的
web_search与agent策略价格相同。
| 搜索策略或工具 | 地域 | 每 1000 次调用价格 |
|---|---|---|
| agent、agent_max、web_search | 华北2(北京)、美国(弗吉尼亚)、中国香港、日本(东京)、德国(法兰克福) | $0.573411 |
| agent、agent_max、web_search | 新加坡 | $10.00 |
agent_max 当前为限时优惠价格,包含联网搜索与网页抓取费用,其中网页抓取工具限时免费。
常见问题
Q:联网搜索后模型返回“无法回答”或无响应?
A:联网搜索结果可能包含管控信息,触发内容安全规则,导致模型返回DataInspectionFailed 错误 (HTTP 400),响应内容为“抱歉,我无法回答这个问题”。排查方法:关闭联网搜索后重新发送相同查询,若模型正常回复,则确认是搜索返回的内容触发了拦截。内容安全拦截为非确定性行为,取决于搜索返回的具体内容,并非所有敏感话题查询都会触发。
Q:账单的联网搜索次数与 API 返回的搜索次数不一致,如何对账?
A:不同协议和模型返回的搜索计次字段不同:- DashScope:
usage.plugins.search.count. - Chat Completions:
usage.x_tools.search.count. - Responses:
usage.x_tools.web_search.count/tool_usage.web_search.num_requests. - Anthropic:
usage.server_tool_use.web_search_requests.
count 的字段表示本轮对话经意图判定需要联网搜索,不代表检索已实际完成。即使触发限流或检索未返回结果,仍可能返回计数;num_requests 和 web_search_requests 表示 API 返回的搜索请求次数。
账单以搜索服务实际完成检索并正常返回结果为计费依据。API 返回的计次字段用于观察调用情况,对账请以账单出账数据为准。