聚合API接口文档
  1. Anthropic原生格式
聚合API接口文档
  • 常用请求
    • 获取模型
      • 获取模型
      • 获取模型 - gemini
    • 文本嵌入
      • 文本嵌入
      • 文本嵌入 - gemini
    • 令牌余额查询
      GET
    • 基本请求
      POST
    • 流式请求
      POST
    • 连续对话
      POST
    • 识图请求 - url
      POST
    • 识图请求 - base64
      POST
    • 工具(函数)调用
      POST
    • 文档重排序
      POST
    • 流式出图/视频
      POST
    • gpt-5.1开思考显示
      POST
    • codex模型请求
      POST
    • chat兼容思考显示
      POST
    • 视频识别
      POST
    • PDF识别
      POST
    • 结构化输出
      POST
  • 图片/视频生成
    • OpenAI chat格式
      • 流式出图/视频(推荐)
      • 流式出图/视频 - 带图生成
    • Google 生图 - nano banana
      • Google Gemini生图
      • Google Gemini改图
      • Google Gemini生图 流式
    • OpenAI image格式
      • 生成图像
      • 编辑图像
    • OpenAI sora格式
      • 创建视频
      • 获取视频任务状态
      • 获取视频内容
    • Midjourney绘图
      • 任务提交
        • 文生图 - Imagine
        • 关联按钮动作 - Action
        • 图生文 - Describe
        • 图像混合 - Blend
        • 局部重绘 - Modal
      • 任务查询
        • 多任务查询 - ListByCondition
        • 单任务查询 - FetchFromTask
        • Seed查询 - ImageSeed
  • 音频转录
    • 音频转录
    • 音频翻译
    • 文本转语音
    • Gemini 生成音频(TTS)
  • 高阶用法
    • Gemini原生格式
      • 普通对话
      • 开启思考
      • 流式请求
      • 结构化输出
      • 函数调用
      • PDF识别
      • 图像识别
      • 视频识别
    • Anthropic原生格式
      • 普通对话
        POST
      • 流式请求
        POST
      • 开启思考
        POST
      • 图像识别
        POST
      • 函数调用
        POST
      • 内置联网
        POST
    • 对话完整传参示例
      • OpenAI对话格式 - chat
      • OpenAI对话格式 - responses
      • Claude对话格式 - messages
      • Gemini对话格式 - v1beta
  • 在代码工具使用
    • 在codex中使用
    • 在gemini cli中使用
    • 在claudecode中使用
  • 数据模型
    • Schemas
      • ErrorResponse
      • ModelsResponse
      • GeminiModelsResponse
      • ChatCompletionRequest
      • ChatCompletionResponse
      • CompletionRequest
      • CompletionResponse
      • ResponsesRequest
      • ResponsesResponse
      • ClaudeRequest
      • ClaudeResponse
      • EmbeddingRequest
      • EmbeddingResponse
      • ImageGenerationRequest
      • ImageResponse
      • AudioTranscriptionResponse
      • SpeechRequest
      • RerankRequest
      • RerankResponse
      • VideoRequest
      • ModerationRequest
      • VideoResponse
      • ModerationResponse
      • VideoTaskResponse
      • GeminiRequest
      • GeminiResponse
      • OpenAIVideoError
      • Model
      • Message
      • MessageContent
      • ToolCall
      • Tool
      • ResponseFormat
      • Usage
      • ClaudeMessage
      • VideoTaskMetadata
      • VideoTaskError
      • ChatCompletionStreamResponse
      • ResponsesStreamResponse
      • ImageEditRequest
      • AudioTranscriptionRequest
      • AudioTranslationRequest
      • OpenAIVideo
  1. Anthropic原生格式

内置联网

POST
{{url}}/v1/messages
最后修改时间:2025-11-29 16:01:51
仅官方api、claudecode支持,aws渠道api、逆向api暂不支持

请求参数

Header 参数

Body 参数application/json

示例
{
    "model": "claude-sonnet-4-5-20250929",
    "messages": [
        {
            "role": "user",
            "content": "查阅今天关于中国的新闻"
        }
    ],
    "tools": [
        {
            "type": "web_search_20250305",
            "name": "web_search",
            "max_uses": 5
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'http://api.example.com/v1/messages' \
--header 'x-api-key: sk-xxx' \
--header 'anthropic-version: 2023-06-01' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-sonnet-4-5-20250929",
    "messages": [
        {
            "role": "user",
            "content": "查阅今天关于中国的新闻"
        }
    ],
    "tools": [
        {
            "type": "web_search_20250305",
            "name": "web_search",
            "max_uses": 5
        }
    ]
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "model": "claude-sonnet-4-5-20250929",
    "id": "msg_01NtdMVGQcmeMS69EVXaUyft",
    "type": "message",
    "role": "assistant",
    "content": [
        {
            "type": "server_tool_use",
            "id": "srvtoolu_014KSi8aXnp1a71PcvvviKLR",
            "name": "web_search",
            "input": {
                "query": "中国新闻 today"
            }
        },
        {
            "type": "web_search_tool_result",
            "tool_use_id": "srvtoolu_014KSi8aXnp1a71PcvvviKLR",
            "content": [
                {
                    "type": "web_search_result",
                    "title": "中国新闻网",
                    "url": "https://m.chinanews.com/",
                    "encrypted_content": "EocCCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDOBhopzKkP9UnEwGjhoMHIjKWEPOn3F8I4fnIjDGeHUMMHwrOade0Xat/uB+MqD4lcM8vo2Y7ePMPeJZjTM8n7RqKqnN4qlsXF+qW3MqigEegfX8bPQu4rG/d22aDniFwyjKR2BAKayvKY3T/u8wMXAx2xCB4bvwIwzlb/LMYGtq3R53MkqM/pt4bCc++Af+r04HosLVI0x4duM55m61/G3Bt8pcxk7W50g+oEwmcAaZlRUaTN1C6G1Omx/xQPpEgj6czwe6L4egT9BPxOmXT0FzUgVxnxv4VgAYAw==",
                    "page_age": null
                },
                {
                    "type": "web_search_result",
                    "title": "中国新闻_央视网(cctv.com)",
                    "url": "https://news.cctv.com/china/",
                    "encrypted_content": "EswGCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDIxy5sDOxEX4yTMDPRoM1Z9XlGOYfRR2HttVIjBQFW7g15HSbq9nJVil5uUN4VsXaupF3Ds8F13vxa1wxyeRE8aSShhV203tdhpfj/4qzwUmk7uyY/ql9vihPIGxqBVabx4+g/9sw0yBM6qA+BiIUqNvlly/q2fSFufm9cAmdhdtE42xZv0u4Usdidw5fbzJ/V2NT64cochYLJIW0PadbcOSDkYcRHesOFEeGsbYhXlV+k4k4430QJVGWFpxEVi1Epc/faEh57kEA+x4QrKjtyedUgsqMs//5WQQiuYqcFHedX2GX6fCH2xEOLv6L9qUztVRUqNp2+bAKNPTYdG0ry40s3Ry6fWB342UhtqiWIchnHanrDWJPmqWl5wS7iZ/LIcuNDD+dAW+jH0czLp0rGkiGqqpxv6I5f6VKgo5hJR0FaQbjXVgPTuxTD0qB+7b7oWRhZfuqTY+5hynmdguB2HolrlW6jY5wPS68tBRJ4UuZdHipcetfsj+FHI0aRBA+vqXChibhDAYzj2u9gWNFh089wOK/sZ3fRtpMHo3L1Ps8WiduCIjohaJh7cut5scLbHTOkuiKA6EdrAoD65JQAPitZ5ymJWJFpbrzBi2dBKdGTkEskeYgSPzsnG5g7YkHDF+CSy6BxXaEVIlH7EMbLat0zj9jCfrbffoXl3zFGmktSySojHAQONwCTfJ04BLCnGiIn7oiYn9QM2BR5N6hxRW/grphWdtiKhQnr253Lnp1B+cXUw4s47FmItqebp8DCRKqIJdKOwkvgUHRJALx8CxYkEzzdzXVhj/kEGvJMqgGTM12wbu/julWc65d2yzSnnkCyM3GJmjyTI/CScm61WJddjcl+FMQngG++UwoMsCyqMULBuPLxOv+VIcOHRjvK5dIb56BX8GPShEZ+x/8jSvO340uRtE8YdisJWnN4xmIxTqcPYrF4GMP9aILFe8K3cc+27Cf8W/CWAOio7vLRieoCTp9C5Z3ZxBgMHnBP55T/dBDQrJIAXM5lbshTgYDAI9WuQU0/INC4CRVmRFBd9xfdoLtoJrelhGpwhY0RgD",
                    "page_age": null
                }
            ]
        },
        {
            "type": "text",
            "text": "根据搜索结果,我为您整理了2025年11月29日关于中国的主要新闻:\n\n## 经济与商业\n\n### 股市动态\n"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "Mainland indices edged up, Hong Kong dipped: On Friday, the Shanghai Composite Index rose about 0.34% to around 3,888, while the CSI 300 large‑cap ben...",
                    "url": "https://ts2.tech/en/china-stock-market-news-nov-28-29-2025-ai-rally-vanke-shock-and-jpmorgans-bullish-call/",
                    "title": "China Stock Market News (Nov 28–29, 2025): AI Rally, Vanke Shock and JPMorgan’s Bullish Call",
                    "encrypted_index": "EpABCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDCmE4QKUT1jVqPeWgBoMBy0InIP1YEI0Y7vZIjCxpBjzWYZFp4FyeRULZ1/xnU12Qa4lS7WPCfN5qH6KmNtVVZFu8+zFgKjDOmaL0f0qFD51lt3j8k9D9x2sC3GJ2vHlTJ9RGAQ="
                }
            ],
            "type": "text",
            "text": "11月28日,上证综合指数上涨约0.34%至3888点左右,而沪深300大盘基准指数上涨约0.3%"
        },
        {
            "type": "text",
            "text": "。"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "Between 28 and 29 November 2025, the China stock market has offered a textbook snapshot of its current reality: Indices are grinding higher, helped by...",
                    "url": "https://ts2.tech/en/china-stock-market-news-nov-28-29-2025-ai-rally-vanke-shock-and-jpmorgans-bullish-call/",
                    "title": "China Stock Market News (Nov 28–29, 2025): AI Rally, Vanke Shock and JPMorgan’s Bullish Call",
                    "encrypted_index": "EpABCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDFSOPI3aEn9QYixEshoMJ4EpWPjoUV1iZd80IjAbi+YZ8RDIxSJSTY3SR86D/i09pxabf/+2CMvR4pivNeTglQll62NLI6Q3YrRSYHcqFItq8GheuFve4v3U9Hk0a0j3VYg0GAQ="
                }
            ],
            "type": "text",
            "text": "在11月28日至29日期间,中国股市受到人工智能、机器人和其他战略部门的推动而走高"
        },
        {
            "type": "text",
            "text": "。\n\n### 汽车行业\n"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "Up to five Chinese carmakers are likely to be among the world's top 10 vehicle companies by 2030, the South China Morning Post reported, citing a...",
                    "url": "https://www.citynewsservice.cn/articles/china-biz-buzz/daily-buzz/weekend-buzz-29-30-november-2025-4kbbbwqk",
                    "title": "Weekend Buzz: 29-30 November 2025 - City News Service",
                    "encrypted_index": "EpABCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDFaZCa6zbu8d0fJNmRoM6llNolqgv6aZl7LFIjB8/l0TI0jG6VgNxVjobRwvvjQ/Pmf9ZIUnFKeJFDEvkXtixjT/NLlb+R76cQhSN4QqFFIi9d5w6sVR8K9fPzDGWCdFnnrQGAQ="
                }
            ],
            "type": "text",
            "text": "据麦肯锡咨询公司预测,到2030年,可能有多达5家中国汽车制造商跻身全球前10大汽车公司"
        },
        {
            "type": "text",
            "text": "。"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "BYD, China's largest electric vehicle maker, and Geely Holding, which owns Volvo Cars, are already in the top 10 based on 2024 sales. ",
                    "url": "https://www.citynewsservice.cn/articles/china-biz-buzz/daily-buzz/weekend-buzz-29-30-november-2025-4kbbbwqk",
                    "title": "Weekend Buzz: 29-30 November 2025 - City News Service",
                    "encrypted_index": "EpABCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDOvBdyQr+FVNIUZ+HhoM5UQNKlgB3SD5L2ZhIjDlY/cYm1YStKx1agEsQ3f/YgqpcIdRE8gnz6qDRoK95/MtoIOSR6TVVkSpVikZ52wqFO/jdwJHBZmCM3U/lrXUeyugij2VGAQ="
                }
            ],
            "type": "text",
            "text": "比亚迪(中国最大的电动汽车制造商)和吉利控股(拥有沃尔沃汽车)已经基于2024年的销售额进入了前10名"
        },
        {
            "type": "text",
            "text": "。\n\n### 航空业投资\n"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "COMAC Shanghai-based Commercial Aircraft Corporation of China received additional investment of 44 billion yuan (US$6.2 billion) from eight state-owne...",
                    "url": "https://www.citynewsservice.cn/articles/china-biz-buzz/daily-buzz/weekend-buzz-29-30-november-2025-4kbbbwqk",
                    "title": "Weekend Buzz: 29-30 November 2025 - City News Service",
                    "encrypted_index": "EpEBCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDC8+Hc4bzn4KhqUYJRoMIchanUZka64uOVBXIjCUgWr3wvfbSoSgOWy7HOtnHF7TBtLOaWwXZJlOt9yEs1cUa+/ryLhjStgE07NxqKsqFWI3o9Ctwx6dcsDjCc/TbjTcT/1A4RgE"
                }
            ],
            "type": "text",
            "text": "上海的中国商飞公司从8家国有股东处获得440亿元人民币(62亿美元)的额外投资,以支持国产C919客机的量产"
        },
        {
            "type": "text",
            "text": "。\n\n## 交通运输数据\n\n"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "[Photo/Xinhua] China reported 56.88 billion cross-regional passenger trips in the first 10 months of 2025, up 3.6% year on year, the Ministry of Trans...",
                    "url": "http://www.china.org.cn/2025-11/29/content_118201813.shtml",
                    "title": "China sees 56.88B passenger trips in January-October - China.org.cn",
                    "encrypted_index": "EpABCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDNOU14gshABU98vgHxoMYH46fDbT6kyFR0iDIjD4o1fQGVgXByl8Oq1xeK9/20DjHWZ+IQ53A5m91LVxQwRu12xIbBvNY/LhyVEZa8oqFGydZfasYidOyH7KCu1yD4aGzK2AGAQ="
                },
                {
                    "type": "web_search_result_location",
                    "cited_text": "[Photo/Xinhua] China reported 56.88 billion cross-regional passenger trips in the first 10 months of 2025, up 3.6% year on year, the Ministry of Trans...",
                    "url": "http://www.china.org.cn/2025-11/29/content_118201813.shtml",
                    "title": "China sees 56.88B passenger trips in January-October - China.org.cn",
                    "encrypted_index": "EpABCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDL41B6bn8nAafngSzhoMB96r3JxsBLWHMWEWIjDMddpPMlMOMp7Rc5wSV818n6GohUeEMX5liG5u/RrO3d/INIH3e5xPWOxbRDLkHA0qFHPCl3gsZkFrPd5A2SzFAxIYaFb/GAQ="
                }
            ],
            "type": "text",
            "text": "中国交通运输部周五表示,2025年前10个月中国跨区域客运量达568.8亿人次,同比增长3.6%"
        },
        {
            "type": "text",
            "text": "。\n\n"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "From January to October, the country's operational freight volume reached 48.29 billion tonnes, an increase of 3.5% from a year earlier. ",
                    "url": "http://www.china.org.cn/2025-11/29/content_118201813.shtml",
                    "title": "China sees 56.88B passenger trips in January-October - China.org.cn",
                    "encrypted_index": "EpABCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDM22he+4urZ8DVFRiRoMMEWY0hMa2I+87MwXIjDwra9FLOZCUPWHyQdK2Vnao1oAUJOkh3izoBZd7360PdOUujAC7D7eIp4aJx1gLcgqFBMn9L3jLvKKXdZJSQsNmrb7PbkUGAQ="
                }
            ],
            "type": "text",
            "text": "1月至10月,全国运营货运量达482.9亿吨,同比增长3.5%"
        },
        {
            "type": "text",
            "text": "。"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "Fixed-asset investment in the transport sector totaled 2.95 trillion yuan (about $417 billion) in the first 10 months of 2025. ",
                    "url": "http://www.china.org.cn/2025-11/29/content_118201813.shtml",
                    "title": "China sees 56.88B passenger trips in January-October - China.org.cn",
                    "encrypted_index": "EpEBCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDP7+upDs2Aj+DDo4ExoMl1Fkdbb3uGPfhVIlIjAbSjkYWgQuYKz+XRNXGYTc0aOPMzhknW3ln8B386fzuFIXd5dOTGoPvdN2I4RWGyQqFSzxiiIDRN2c/7O5rD/MukhKclh5chgE"
                }
            ],
            "type": "text",
            "text": "2025年前10个月,交通运输部门固定资产投资总额达2.95万亿元人民币(约4170亿美元)"
        },
        {
            "type": "text",
            "text": "。\n\n## 政治动态\n\n"
        },
        {
            "citations": [
                {
                    "type": "web_search_result_location",
                    "cited_text": "热点|国内|社会|国际|军事|文娱|体育|财经|港澳台侨|微视界| 洋腔队|Z世代|澜湄印象|中国风|中国新视野 ... 中共中央政治局11月28日召开会议,审议《关于二十届中央巡视省(自治区、直辖市)情况的综合报告》 ...",
                    "url": "https://www.chinanews.com.cn/",
                    "title": "中国新闻网_梳理天下新闻",
                    "encrypted_index": "Eo8BCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDPiOJ2SnLzmXzVCtUxoM15iNEp1REn39BGhMIjDjTLD0UZq26FyGH9GHPdZJ7t8H+o1IQgIS/bhkQMVzt+K7a5pDeNHOtdls1mvbAEQqE6NCnidUWHGKQyBMZJktctjHhu8YBA=="
                },
                {
                    "type": "web_search_result_location",
                    "cited_text": "热点|国内|社会|国际|军事|文娱|体育|财经|港澳台侨|微视界| 洋腔队|Z世代|澜湄印象|中国风|中国新视野 ... 中共中央政治局11月28日召开会议,审议《关于二十届中央巡视省(自治区、直辖市)情况的综合报告》 ...",
                    "url": "https://www.chinanews.com.cn/",
                    "title": "中国新闻网_梳理天下新闻",
                    "encrypted_index": "Eo8BCioIChgCIiQ4YTNhZDJmYi05MDVlLTQzMTQtYWNlNy1lODQ3NjNiM2QwZDUSDJ5xiIer0bPYIHz3oRoM/rEJQ+UW79PkLKISIjDeeDCyYrv6O/7Z8jx23JTAvWqblKGX4yCdYe0fwmIMXRVYT04LrdrqxM5zQfY30LMqE9q9RusZBO9lhGAfyJcNqHRlRsgYBA=="
                }
            ],
            "type": "text",
            "text": "中共中央政治局11月28日召开会议,审议《关于二十届中央巡视省(自治区、直辖市)情况的综合报告》"
        },
        {
            "type": "text",
            "text": "。\n\n这些是今天关于中国的主要新闻动态,涵盖了经济、交通、政治等多个领域。"
        }
    ],
    "stop_reason": "end_turn",
    "stop_sequence": null,
    "usage": {
        "input_tokens": 26513,
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "cache_creation": {
            "ephemeral_5m_input_tokens": 0,
            "ephemeral_1h_input_tokens": 0
        },
        "output_tokens": 839,
        "service_tier": "standard",
        "server_tool_use": {
            "web_search_requests": 2
        }
    }
}
修改于 2025-11-29 16:01:51
上一页
函数调用
下一页
OpenAI对话格式 - chat
Built with