Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Zhihu AI Search Stream

API 文档
https://api.sandbase.ai/v1/api/zhihu/web/ai-search-stream

Returns streaming AI search results from Zhihu based on a query prompt. Supports conversational multi-turn sessions and chat modes.

价格
$0.005美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 2 个可选

Playground

输入
Search Content
Chat mode, default FAST
Session ID for multi-turn
输出示例
响应outputs · 10.3 KB · 223 行
[
  {
    "data": {
      "events": [
        {
          "data": {
            "ai_attached_info": "ogNvEhM3NjkwOTYzNDk3MzY0NTA1NzU2GJgBIhM3NjkwOTYzNDk3MzY0NDgzMDgxKhM3NjkwOTYzNDk3MzY0NDgzMDgxSgR0ZXN0oAEAsAFi4gIIQUlBbnN3ZXKCBRMzNzU1MzUzMjcwMjA0MjM0MTk1",
            "message_id": "7690963497364483081",
            "parent_message_id": "7690963497364505756",
            "session_id": "3755353270204234195"
          },
          "event": "Init",
          "system_meta": {
            "flush_time": 1790691981431,
            "flush_time_format": "22:26:21.431",
            "trace_id": "9f7d1847-a9cc-42a7-a997-c23409897627"
          }
        },
        {
          "data": [
            {
              "access_status": "ACCESSIBLE",
              "ai_attached_info": "ogNnEhM3NjkwOTYzNDk3MzY0NTA1NzU2GAciCTI2OTEwMjk2MyoTMTk5NTQ1NDk2OTA0MjczNjAzOUoEdGVzdKABALABYuICC0Nvcm5lckNhcmRzggUTMzc1NTM1MzI3MDIwNDIzNDE5NQ==",
              "attached_info": "kgIXEhMxOTk1NDU0OTY5MDQyNzM2MDM5GAc=",
              "cite_metric": [
                {
                  "data": "https://picx.zhimg.com/v2-401055fa686fcbf84732d41750739bcc_l.jpg?source=ec1c8e88",
                  "type": "avatar"
                },
                {
                  "data": "但问智能",
                  "type": "text"
                }
              ],
              "content_abstract": "[视频] 内容很长,收藏起来,未来可能用得上哦🎭 Playwright Test Agents:AI驱动的UI自动化让AI成为你的测试工程师,自动规划、生成和修复测试用例 📖 目录1. 引言:测试自动化的新纪元2. 什么是 Playwright Test Agents?3. 三大核心Agent详解4. 快速上手指南5. 实战案例:TodoMVC应用测试6. 高级应用场景7. 最佳实践与技巧🚀 引言:测试自动化的新纪元 Playwright Test Agents 将 AI Agent 技术与 Playwright 测试框架深度融合…",
              "content_type": "article",
              "content_url_token": "1995454969042736039",
              "image": "https://pica.zhimg.com/v2-573e14dd64967693a9931e9a91494b69.jpg?source=7e7ef6e2&needBackground=1",
              "images": [
                "https://pica.zhimg.com/v2-573e14dd64967693a9931e9a91494b69.jpg?source=7e7ef6e2&needBackground=1",
                "https://pica.zhimg.com/v2-4724250e9cd60bb144fd961aa6839a61.jpg?source=7e7ef6e2&needBackground=1"
              ],
              "is_out_link": true,
              "labels": [
                {
                  "data": {
                    "author_metrics": "73 关注 · 98 赞同",
                    "avatar_url": "https://picx.zhimg.com/v2-401055fa686fcbf84732d41750739bcc_l.jpg?source=ec1c8e88",
                    "badge_info": {
                      "detail_badges": [],
                      "icon": "",
                      "merged_badges": [],
                      "night_icon": "",
                      "title": ""
                    },
                    "content_count": 0,
                    "follower_count": 73,
                    "headline": "大模型落地企业应用|性能测试|测试开发|测试架构师|自动化",
                    "id": "801029f98b5689124cefebb617de5ad6",
                    "is_anonymous": false,
                    "is_followed": false,
                    "is_following": false,
                    "name": "但问智能",
                    "url": "https://www.zhihu.com/people/801029f98b5689124cefebb617de5ad6",
                    "url_token": "20-38-53-61-24",
                    "user_type": "Normal"
                  },
                  "type": "author"
                }
              ],
              "recall_content_id": "MjY5MTAyOTYzfDp8QVJUSUNMRQ==",
              "recall_source": "ARTICLE",
              "title": "Playwright Test Agents 实践(附源码)",
              "url": "https://zhuanlan.zhihu.com/p/1995454969042736039"
            },
            {
              "access_status": "ACCESSIBLE",
              "ai_attached_info": "ogNdEhM3NjkwOTYzNDk3MzY0NTA1NzU2GAciCTIyMzY0NzQzNCoJNjA5ODE5NTU3SgR0ZXN0oAEAsAFi4gILQ29ybmVyQ2FyZHOCBRMzNzU1MzUzMjcwMjA0MjM0MTk1",
              "attached_info": "kgINEgk2MDk4MTk1NTcYBw==",
              "cite_metric": [
                {
                  "data": "https://picx.zhimg.com/v2-7699cc8180d1c0f25f6a823351c80b1c_l.jpg?source=ec1c8e88",
                  "type": "avatar"
                },
                {
                  "data": "茄斯教你学渗透",
                  "type": "text"
                }
              ],
              "content_abstract": "这个站有点特殊,感觉像是刚运营不久的样子。 0X01 测试 找到了后台 [图片] 肯定是弱口令先测试的,基本上有登陆功能都这样。 [图片] 从返回包的信息就可以看出来,这里是有sql注入的,直接sqlmap梭哈,找到了一些信息,权限很低,无法做更多事情。 current-user: developer@% select @@BASEDIR: '/usr/' select USER(): '[email protected]' select DATABASE(): 'edc' select SYSTEM_USER(): '[email protected]' select @@CHARACTER_SET…",
              "content_type": "article",
              "content_url_token": "609819557",
              "image": "https://pic1.zhimg.com/v2-c2e0cf1d9f1bbde533abbafc7c89eb37.png?source=7e7ef6e2&needBackground=1",
              "images": [
                "https://pic1.zhimg.com/v2-c2e0cf1d9f1bbde533abbafc7c89eb37.png?source=7e7ef6e2&needBackground=1",
                "https://pic1.zhimg.com/v2-5f1d47f73f8ab2237b96607b52a66057.png?source=7e7ef6e2&needBackground=1",
                "https://picx.zhimg.com/v2-687724ec8d54590e8a30f5c43652ef43.png?source=7e7ef6e2&needBackground=1",
                "… 2 more items in the full response"
              ],
              "is_out_link": true,
              "labels": [
                {
                  "data": {
                    "author_metrics": "835 关注 · 990 赞同",
                    "avatar_url": "https://picx.zhimg.com/v2-7699cc8180d1c0f25f6a823351c80b1c_l.jpg?source=ec1c8e88",
                    "badge_info": {
                      "detail_badges": [],
                      "icon": "",
                      "merged_badges": [],
                      "night_icon": "",
                      "title": ""
                    },
                    "content_count": 0,
                    "follower_count": 835,
                    "headline": "vx公众号:茄斯教你学渗透 |  专业网络安全培训",
                    "id": "163980fc6aef0e85ac6e7c945663fa19",
                    "is_anonymous": false,
                    "is_followed": false,
                    "is_following": false,
                    "name": "茄斯教你学渗透",
                    "url": "https://www.zhihu.com/people/163980fc6aef0e85ac6e7c945663fa19",
                    "url_token": "tao-bu-chi-de-xin-cheng",
                    "user_type": "Normal"
                  },
                  "type": "author"
                }
              ],
              "recall_content_id": "MjIzNjQ3NDM0fDp8QVJUSUNMRQ==",
              "recall_source": "ARTICLE",
              "title": "再对某赌博网站的一个小小小小的Test",
              "url": "https://zhuanlan.zhihu.com/p/609819557"
            },
            {
              "access_status": "ACCESSIBLE",
              "ai_attached_info": "ogNdEhM3NjkwOTYzNDk3MzY0NTA1NzU2GAciCTIyMjY5MzcwNCoJNjA1NTI5MjQ1SgR0ZXN0oAEAsAFi4gILQ29ybmVyQ2FyZHOCBRMzNzU1MzUzMjcwMjA0MjM0MTk1",
              "attached_info": "kgINEgk2MDU1MjkyNDUYBw==",
              "cite_metric": [
                {
                  "data": "https://picx.zhimg.com/v2-7699cc8180d1c0f25f6a823351c80b1c_l.jpg?source=ec1c8e88",
                  "type": "avatar"
                },
                {
                  "data": "茄斯教你学渗透",
                  "type": "text"
                }
              ],
              "content_abstract": "闲来无事,渗透测试!0X01 我与网赌不共戴天今天接了一个小小项目,一个棋牌网站 [图片] 简单尝试一下,提示用户名或密码错误 [图片] 没事,这里验证码都没有的,直接弱口令爆破,可惜失败了。 [图片] 这个时候呢,只能测试登录框是否有其他的漏洞了。先加个引号试试水,报错了,有希望! [图片] 再构造一个万能密码语句,没用? [图片] 再来个空格,将语句进行隔离开,区别产生,确定存在sql漏洞了! [图片] 0X02 工具梭哈有sql漏洞,二话不说就是sqlmap一把梭! [图片] 结果显示…",
              "content_type": "article",
              "content_url_token": "605529245",
              "image": "https://picx.zhimg.com/v2-7cc355948c6bd457eaa0bf3cc861f6bf.png?source=7e7ef6e2&needBackground=1",
              "images": [
                "https://picx.zhimg.com/v2-7cc355948c6bd457eaa0bf3cc861f6bf.png?source=7e7ef6e2&needBackground=1",
                "https://picx.zhimg.com/v2-7b5fa1a3a8967fddc9effc8d730a81bf.png?source=7e7ef6e2&needBackground=1",
                "https://pic1.zhimg.com/v2-fed16fe81f0a3aa098571db7b4a33f81.png?source=7e7ef6e2&needBackground=1",
                "… 2 more items in the full response"
              ],
              "is_out_link": true,
              "labels": [
                {
                  "data": {
                    "author_metrics": "835 关注 · 990 赞同",
                    "avatar_url": "https://picx.zhimg.com/v2-7699cc8180d1c0f25f6a823351c80b1c_l.jpg?source=ec1c8e88",
                    "badge_info": {
                      "detail_badges": [],
                      "icon": "",
                      "merged_badges": [],
                      "night_icon": "",
                      "title": ""
                    },
                    "content_count": 0,
                    "follower_count": 835,
                    "headline": "vx公众号:茄斯教你学渗透 |  专业网络安全培训",
                    "id": "163980fc6aef0e85ac6e7c945663fa19",
                    "is_anonymous": false,
                    "is_followed": false,
                    "is_following": false,
                    "name": "茄斯教你学渗透",
                    "url": "https://www.zhihu.com/people/163980fc6aef0e85ac6e7c945663fa19",
                    "url_token": "tao-bu-chi-de-xin-cheng",
                    "user_type": "Normal"
                  },
                  "type": "author"
                }
              ],
              "recall_content_id": "MjIyNjkzNzA0fDp8QVJUSUNMRQ==",
              "recall_source": "ARTICLE",
              "title": "对某赌博网站的一个小小小小的Test",
              "url": "https://zhuanlan.zhihu.com/p/605529245"
            },
            "… 19 more items in the full response"
          ],
          "event": "Cards",
          "system_meta": {
            "flush_time": 1790691982474,
            "flush_time_format": "22:26:22.474",
            "trace_id": "9f7d1847-a9cc-42a7-a997-c23409897627",
            "ttft": 1073,
            "ttft_end_time": 1790691982473,
            "ttft_start_time": 1790691981400
          }
        },
        {
          "data": {
            "cite_dict": {},
            "delta": true,
            "digital_cite_dict": {},
            "status": 1,
            "summary": "“"
          },
          "event": "Answer",
          "system_meta": {
            "aisp_ttft": 2285,
            "answer_ttft": 2323,
            "flush_time": 1790691983723,
            "flush_time_format": "22:26:23.723",
            "trace_id": "9f7d1847-a9cc-42a7-a997-c23409897627"
          }
        },
        "… 35 more items in the full response"
      ]
    }
  }
]

示例

选择一个示例,将其输入和结果加载到 playground 中。

API README

Zhihu AI Search Stream API

Returns the AI answer to a query from Zhihu AI search as a list of stream events. Each event carries a small piece of the answer text. The only required input is message_content, the question or prompt to search.

Use cases

  • Collect a full AI-written answer to a question by joining the summary pieces from all Answer events.
  • Continue a conversation by sending the session_id from a first call with a follow-up message_content.
  • Measure how fast the answer starts using the ttft timing values in system_meta.
  • Log the trace_id of each call to match a response to a specific search.

Request

curl -X POST "https://api.sandbase.ai/v1/api/zhihu/web/ai-search-stream" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message_content": "<message_content>"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
message_contentstringYesSearch Content
chat_modestringNoChat mode, default FAST
session_idstringNoSession ID for multi-turn

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "events": [
    {
      "data": {
        "ai_attached_info": "ogN8EhM3NzAzODQ5MDI0OTU1MDMyODE3GJgBIhM3NzAzODQ5MDI0OTU1MDE3MDg2KhM3NzAzODQ5MDI0…",
        "message_id": "7703849024955017086",
        "parent_message_id": "7703849024955032817",
        "session_id": "37616450…"
      },
      "event": "Init",
      "system_meta": {
        "flush_time": 1793692127112,
        "flush_time_format": "15:48:47.112",
        "trace_id": "4361b701-b2b3-4560-95b0-4fb71bf30c68"
      }
    }
  ]
}

Response fields

FieldMeaning
events[]List of stream events in the order they were sent. Each item has an event name, a data object and a system_meta object.
events[].eventType of the event. The sample shows Init first, followed by Answer events.
events[].data.session_idID of the chat session, sent in the Init event. Pass it as session_id in a later call for a multi-turn chat.
events[].data.message_id / events[].data.parent_message_idID of the new message and the ID of the message before it in the session.
events[].data.summaryA piece of answer text in an Answer event. Join the pieces in order to get the full answer.
events[].data.deltaSet to true when summary holds only the new text for this event, not the whole answer so far.
events[].data.cite_dict / events[].data.digital_cite_dictCitation maps for the answer text. Both are empty in the sample events.
events[].system_meta.ttft / events[].system_meta.answer_ttft / events[].system_meta.aisp_ttftTime to first token values, present on the first Answer event. The response does not state their unit.
events[].system_meta.flush_time / events[].system_meta.flush_time_formatTime the event was sent, as a number and as a HH:MM:SS.mmm string.
events[].system_meta.trace_idTrace ID shared by all events in the same response.

Notes

  • Concatenate events[].data.summary from the Answer events in order to build the full answer text, since each event has delta set to true.
  • To keep a conversation going, read events[].data.session_id from the Init event and send it as session_id in the next call.
  • chat_mode is optional and defaults to FAST.
  • To read the full content behind a topic, use Zhihu Article Search to find articles and answers on the same query.

Pricing

$0.005 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

探索更多

相关 APIs

全部 APIs
API价格响应
Zhihu$0.005 每次调用JSON
Zhihu$0.001 每次调用JSON
Zhihu$0.001 每次调用JSON
Zhihu$0.001 每次调用JSON
Zhihu$0.001 每次调用JSON
Zhihu$0.001 每次调用JSON

指南:Best Zhihu API in 2026: Pricing Compared

问题

常见问题

如何使用 Zhihu AI Search Stream API?

向 https://api.sandbase.ai/v1/api/zhihu/web/ai-search-stream 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Zhihu AI Search Stream API 的价格是多少?

每次调用 $0.005,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Zhihu AI Search Stream API 接受哪些参数?

必填:message_content (string)。 可选:chat_mode (string) 和 session_id (string)。 Parameters 表和本页的 Playground 列出了每个字段。

Zhihu AI Search Stream API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Zhihu 开发者账户或 API key 吗?

不需要。Zhihu AI Search Stream 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Zhihu API 访问权限。