<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>TalkingData文档中心</title>
    <link>http://doc.talkingdata.com</link>
    <description></description>
    <language>zh-CN</language>
    <pubdate>Mon, 29 Jun 2026 18:44:34 +0800</pubdate>
    <image>
      <link>http://doc.talkingdata.com</link>
      <url>http://doc.talkingdata.com/resource/img/logo.png</url>
      <title>TalkingData文档中心</title>
    </image>
    <item>
      <title>TD云灵19</title>
      <link>http://doc.talkingdata.com/posts/1248</link>
      <category>多模态生成API</category>
      <author>liuxinmei</author>
      <description>云灵19 接口说明文档 TD模型编号：T0210003 模型能力简介 云灵19 用于多模态大模型对话，同步返回对话结果。 鉴权说明  本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
 多模态大模型对话接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v2/chat/completions 请求头（Request Headers）： 头部字段 值 是否必需 说明 Authorization Bearer &lt;your_api_key&gt; 是 API 鉴权凭证，请替换为有效的 API Key X-Timestamp 1700000000 是 Unix 时间戳格式 Con</description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%81%B519%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%81%B519%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云灵19 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0210003</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云灵19</strong><ul>
<li>用于多模态大模型对话，同步返回对话结果。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">多模态大模型对话接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v2/chat/completions</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必需</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必需</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相 关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">多模态大模型对话请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">多模态大模型对话请求体（requestBody）</h3>
<hr>
<h4 id="%E6%A0%B8%E5%BF%83%E5%8F%82%E6%95%B0" name="%E6%A0%B8%E5%BF%83%E5%8F%82%E6%95%B0">核心参数</h4>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必需</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用模型的 Model ID 为 T0210003</td>
</tr>
<tr>
<td style="text-align:left"><code>messages</code></td>
<td style="text-align:left">Array<Object></td>
<td style="text-align:left">是</td>
<td style="text-align:left">对话消息列表，至少包含一条用户消息</td>
</tr>
<tr>
<td style="text-align:left"><code>stream</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否流式返回。<strong>当前仅支持 <code>false</code></strong>（非流式），默认 <code>false</code></td>
</tr>
</tbody>
</table>
<h4 id="messages%20%E6%95%B0%E7%BB%84%E7%BB%93%E6%9E%84" name="messages%20%E6%95%B0%E7%BB%84%E7%BB%93%E6%9E%84">messages 数组结构</h4>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必需</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">消息角色。可选值： - <code>system</code>：系统提示词 - <code>user</code>：用户消息 - <code>assistant</code>：模型历史回复</td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">消息内容。 <strong>限制</strong>：最大输入 1,048,576 tokens，最大输出 65,536 tokens</td>
</tr>
</tbody>
</table>
<h4 id="%E9%87%87%E6%A0%B7%E8%B0%83%E6%8E%A7%E5%8F%82%E6%95%B0%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89" name="%E9%87%87%E6%A0%B7%E8%B0%83%E6%8E%A7%E5%8F%82%E6%95%B0%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89">采样调控参数（可选）</h4>
<blockquote>
<p>💡 <strong>建议</strong>：使用默认值即可获得最佳效果，无需特殊调整。</p>
</blockquote>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">取值范围</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>temperature</code></td>
<td style="text-align:left">Double</td>
<td style="text-align:left">0.0 ~ 2.0</td>
<td style="text-align:left">控制输出随机性，值越高越随机</td>
</tr>
<tr>
<td style="text-align:left"><code>top_p</code></td>
<td style="text-align:left">Double</td>
<td style="text-align:left">0.0 ~ 1.0</td>
<td style="text-align:left">核采样，累积概率阈值</td>
</tr>
<tr>
<td style="text-align:left"><code>top_k</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">1 ~ 64</td>
<td style="text-align:left">从概率最高的 k 个 token 中采样</td>
</tr>
<tr>
<td style="text-align:left"><code>max_completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">≥ 1</td>
<td style="text-align:left">限制最大输出 token 数量</td>
</tr>
<tr>
<td style="text-align:left"><code>seed</code></td>
<td style="text-align:left">Double</td>
<td style="text-align:left">-</td>
<td style="text-align:left">随机种子，相同 seed 可复现结果</td>
</tr>
<tr>
<td style="text-align:left"><code>stop</code></td>
<td style="text-align:left">Array<String></td>
<td style="text-align:left">-</td>
<td style="text-align:left">停止词列表，遇到时停止生成</td>
</tr>
<tr>
<td style="text-align:left"><code>frequency_penalty</code></td>
<td style="text-align:left">Double</td>
<td style="text-align:left">-2.0 ~ 2.0</td>
<td style="text-align:left">正值降低重复词出现概率</td>
</tr>
<tr>
<td style="text-align:left"><code>presence_penalty</code></td>
<td style="text-align:left">Double</td>
<td style="text-align:left">-2.0 ~ 2.0</td>
<td style="text-align:left">正值鼓励模型讨论新话题</td>
</tr>
</tbody>
</table>
<h4 id="%E6%89%A9%E5%B1%95%E5%8F%82%E6%95%B0%EF%BC%88%E6%80%9D%E8%80%83%E6%A8%A1%E5%BC%8F%EF%BC%89" name="%E6%89%A9%E5%B1%95%E5%8F%82%E6%95%B0%EF%BC%88%E6%80%9D%E8%80%83%E6%A8%A1%E5%BC%8F%EF%BC%89">扩展参数（思考模式）</h4>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必需</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>extra_body</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">扩展参数字段</td>
</tr>
<tr>
<td style="text-align:left">└ <code>g_model</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">模型特定配置</td>
</tr>
<tr>
<td style="text-align:left">└ <code>thinking_config</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">思考模式配置</td>
</tr>
<tr>
<td style="text-align:left">└ <code>thinking_level</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">思考深度级别。 <strong>支持</strong>：<code>LOW</code>、<code>MEDIUM</code>、<code>HIGH</code>（级别越高推理越深入）</td>
</tr>
</tbody>
</table>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E5%93%8D%E5%BA%94%E5%8F%82%E6%95%B0" name="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E5%93%8D%E5%BA%94%E5%8F%82%E6%95%B0">多模态大模型对话响应参数</h2>
<p><span id="Hrya4y9k"></span></p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必然返回</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>success</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求状态。<code>true</code> 表示成功。</td>
</tr>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">响应唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">对象类型，固定为 <code>chat.completion</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Long</td>
<td style="text-align:left">是</td>
<td style="text-align:left">响应创建时间戳（Unix 时间戳，秒）。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">模型名称。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">是</td>
<td style="text-align:left">生成的回复列表。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">是</td>
<td style="text-align:left">Token 使用统计及费用信息。</td>
</tr>
<tr>
<td style="text-align:left"><code>error</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">错误信息（仅在出错时返回）。</td>
</tr>
</tbody>
</table>
<h3 id="choices%20%E6%95%B0%E7%BB%84%E5%AD%97%E6%AE%B5" name="choices%20%E6%95%B0%E7%BB%84%E5%AD%97%E6%AE%B5">choices 数组字段</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">回复索引，从 0 开始。</td>
</tr>
<tr>
<td style="text-align:left"><code>finish_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">生成结束原因。可选值：<code>stop</code>（正常结束）、<code>length</code>（达到长度限制）、<code>content_filter</code>（内容被过滤）等。</td>
</tr>
<tr>
<td style="text-align:left"><code>message</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">回复消息内容。</td>
</tr>
<tr>
<td style="text-align:left">└ <code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">角色，固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left">└ <code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">生成的回复文本内容。</td>
</tr>
</tbody>
</table>
<h3 id="usage%20%E5%AF%B9%E8%B1%A1%E5%AD%97%E6%AE%B5" name="usage%20%E5%AF%B9%E8%B1%A1%E5%AD%97%E6%AE%B5">usage 对象字段</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>prompt_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入 token 数量。</td>
</tr>
<tr>
<td style="text-align:left"><code>completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输出 token 数量。</td>
</tr>
<tr>
<td style="text-align:left"><code>total_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">总 token 数量（输入+输出）。</td>
</tr>
<tr>
<td style="text-align:left"><code>price</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次请求费用。</td>
</tr>
<tr>
<td style="text-align:left"><code>prompt_tokens_details</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输入 token 详细统计。</td>
</tr>
<tr>
<td style="text-align:left"><code>completion_tokens_details</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输出 token 详细统计。</td>
</tr>
</tbody>
</table>
<h4 id="prompt_tokens_details%20%E5%AF%B9%E8%B1%A1%E5%AD%97%E6%AE%B5" name="prompt_tokens_details%20%E5%AF%B9%E8%B1%A1%E5%AD%97%E6%AE%B5">prompt_tokens_details 对象字段</h4>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>cached_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">缓存命中的 token 数量。</td>
</tr>
<tr>
<td style="text-align:left"><code>text_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">文本 token 数量。</td>
</tr>
<tr>
<td style="text-align:left"><code>audio_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">音频 token 数量。</td>
</tr>
<tr>
<td style="text-align:left"><code>image_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">图片 token 数量。</td>
</tr>
</tbody>
</table>
<h4 id="completion_tokens_details%20%E5%AF%B9%E8%B1%A1%E5%AD%97%E6%AE%B5" name="completion_tokens_details%20%E5%AF%B9%E8%B1%A1%E5%AD%97%E6%AE%B5">completion_tokens_details 对象字段</h4>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>text_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">文本 token 数量。</td>
</tr>
<tr>
<td style="text-align:left"><code>audio_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">音频 token 数量。</td>
</tr>
<tr>
<td style="text-align:left"><code>reasoning_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">推理 token 数量（思考模式产生）。</td>
</tr>
</tbody>
</table>
<h3 id="error%20%E5%AF%B9%E8%B1%A1%E5%AD%97%E6%AE%B5" name="error%20%E5%AF%B9%E8%B1%A1%E5%AD%97%E6%AE%B5">error 对象字段</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>message</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">错误描述信息。</td>
</tr>
<tr>
<td style="text-align:left"><code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">错误类型。</td>
</tr>
<tr>
<td style="text-align:left"><code>code</code></td>
<td style="text-align:left">String / Integer</td>
<td style="text-align:left">错误代码。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="%E5%A4%9A%E6%A8%A1%E6%80%81%E5%A4%A7%E6%A8%A1%E5%9E%8B%E5%AF%B9%E8%AF%9D%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">多模态大模型对话调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST https://modelpool-api.talkingdata.com/model/openai/api/v2/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000 \
  -H &quot;Content-Type: application/json&quot; \
  -H &quot;Authorization: Bearer $ARK_API_KEY&quot; \
  -H &quot;X-Timestamp: $TIMESTAMP&quot; \
  -d &#39;{
    &quot;model&quot;: &quot;T0210003&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;你好，请介绍一下你自己&quot;
      }
    ],
    &quot;stream&quot;: false
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code class="lang-Curl">{
    &quot;created&quot;: 1774427701,
    &quot;success&quot;: true,
    &quot;usage&quot;: {
        &quot;completion_tokens&quot;: 856,
        &quot;prompt_tokens&quot;: 6,
        &quot;completion_tokens_details&quot;: {
            &quot;audio_tokens&quot;: 0,
            &quot;text_tokens&quot;: 206,
            &quot;reasoning_tokens&quot;: 650
        },
        &quot;price&quot;: &quot;0.07404480&quot;,
        &quot;prompt_tokens_details&quot;: {
            &quot;audio_tokens&quot;: 0,
            &quot;text_tokens&quot;: 6,
            &quot;image_tokens&quot;: 0,
            &quot;cached_tokens&quot;: 0
        },
        &quot;total_tokens&quot;: 862
    },
    &quot;model&quot;: &quot;G31PP&quot;,
    &quot;id&quot;: &quot;chatcmpl-5231becd-a814-4530-b53e-2f03ab2b088a-edf67592-cbcd-4d1d-b816-57081cdf7c42&quot;,
    &quot;choices&quot;: [
        {
            &quot;finish_reason&quot;: &quot;stop&quot;,
            &quot;index&quot;: 0,
            &quot;message&quot;: {
                &quot;role&quot;: &quot;assistant&quot;,
                &quot;content&quot;: &quot;你好！我是 Gemini，是由 Google 训练的大型语言模型。\n\n我旨在成为你的得力助手，可以帮你完成许多日常或复杂的任务。以下是我的一些主要功能：\n\n1. **回答问题：** 无论是科学、历史、文化常识，还是生活中的小疑问，我都会尽力为你解答。\n2. **文字创作：** 我可以帮你撰写邮件、报告、故事、诗歌，甚至编写和调试计算机代码。\n3. **文本处理与分析：** 我可以帮你总结长篇文章的核心要点、润色你的文章，或者提取复杂信息中的关键数据。\n4. **语言翻译：** 我支持多种语言之间的互译，可以帮助你跨越语言障碍。\n5. **提供灵感：** 如果你缺乏创意，我可以陪你一起进行头脑风暴，为你的策划、活动或项目提供点子。\n\n很高兴与你交流！请问今天有什么我可以帮你的吗？&quot;
            }
        }
    ],
    &quot;object&quot;: &quot;chat.completion&quot;
}
</code></pre>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th>错误码</th>
<th>错误消息</th>
<th>HTTP状态码</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>AccessDenied</td>
<td>Access denied.</td>
<td>403 Forbidden</td>
<td>无权限访问对应的资源。</td>
</tr>
<tr>
<td>InappropriateJSON</td>
<td>The JSON you provided was well-formed and valid, but not appropriate for this operation.</td>
<td>400 Bad Request</td>
<td>请求中的JSON格式正确，但语义上不符合要求。如缺少某个必需项，或值类型不匹配等。出于兼容性考虑，对于所有无法识别的项应直接忽略，不应该返回这个错误。</td>
</tr>
<tr>
<td>InternalError</td>
<td>We encountered an internal error. Please try again.</td>
<td>500 Internal Server Error</td>
<td>所有未定义的其他错误。在有明确对应的其他类型的错误时（包括通用的和服务自定义的）不应该使用。</td>
</tr>
<tr>
<td>InvalidAccessKeyId</td>
<td>The Access Key ID you provided does not exist in our records.</td>
<td>403 Forbidden</td>
<td>Access Key ID不存在。</td>
</tr>
<tr>
<td>InvalidHTTPAuthHeader</td>
<td>The Access Key ID you provided does not exist in our records.</td>
<td>400 Bad Request</td>
<td>Authorization头域格式错误。</td>
</tr>
<tr>
<td>InvalidHTTPRequest</td>
<td>There was an error in the body of your HTTP request.</td>
<td>400 Bad Request</td>
<td>HTTP body格式错误。例如不符合指定的Encoding等。</td>
</tr>
<tr>
<td>InvalidURI</td>
<td>Could not parse the specified URI.</td>
<td>400 Bad Request</td>
<td>URI形式不正确。例如一些服务定义的关键词不匹配等。对于ID不匹配的问题，应定义更加具体的错误码，如NoSuchKey。</td>
</tr>
<tr>
<td>MalformedJSON</td>
<td>The JSON you provided was not well-formed.</td>
<td>400 Bad Request</td>
<td>JSON格式不合法。</td>
</tr>
<tr>
<td>InvalidVersion</td>
<td>The API version specified was invalid.</td>
<td>404 Not Found</td>
<td>URI的版本号不合法。</td>
</tr>
<tr>
<td>OptInRequired</td>
<td>A subscription for the service is required.</td>
<td>403 Forbidden</td>
<td>没有开通对应的服务。</td>
</tr>
<tr>
<td>PreconditionFailed</td>
<td>The specified If-Match header doesn’t match the ETag header.</td>
<td>412 Precondition Failed</td>
<td>详见Etag。</td>
</tr>
<tr>
<td>RequestExpired</td>
<td>Request has expired. Timestamp date is .</td>
<td>400 Bad Request</td>
<td>请求超时。要改成x-bce-date。若请求中只有Date，需将Date转成datetime。</td>
</tr>
<tr>
<td>IdempotentParameterMismatch</td>
<td>The request uses the same client token as a previous, but non-identical request.</td>
<td>403 Forbidden</td>
<td>clientToken对应的API参数不一样。</td>
</tr>
<tr>
<td>SignatureDoesNotMatch</td>
<td>The request signature we calculated does not match the signature you provided. Check your Secret Access Key and signing method. Consult the service documentation for details.</td>
<td>400 Bad Request</td>
<td>Authorization头域中附带的签名和服务端验证不一致。</td>
</tr>
<tr>
<td>MediaTaskNotFound</td>
<td>MediaTask xxx not found</td>
<td>404 Not Found</td>
<td>没有找到对应的任务</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Tue, 09 Jun 2026 10:09:29 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1248</guid>
      <comments>http://doc.talkingdata.com/posts/1248#comments</comments>
    </item>
    <item>
      <title>TD云灵28</title>
      <link>http://doc.talkingdata.com/posts/1247</link>
      <category>多模态生成API</category>
      <author>liuxinmei</author>
      <description>云灵28 接口说明文档 TD模型编号：T0510002 模型能力简介 云灵28 文本对话：支持多轮对话、文本生成、逻辑推理、代码生成、长文本处理等能力。 协议支持：本接口同时兼容 OpenAI Chat Completions 与 Anthropic Messages 两种主流协议，您可根据使用的SDK或工具灵活选择。 鉴权说明  本接口支持API Key鉴权，需联系TD运维同学获取长效API Key。
 OpenAI 协议对话接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions 请求头（Request Headers）： 头部字段 值 是否必填 说明 </description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%81%B528%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%81%B528%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云灵28 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0510002</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云灵28</strong><ul>
<li><strong>文本对话</strong>：支持多轮对话、文本生成、逻辑推理、代码生成、长文本处理等能力。</li>
<li><strong>协议支持</strong>：本接口同时兼容 <strong>OpenAI Chat Completions</strong> 与 <strong>Anthropic Messages</strong> 两种主流协议，您可根据使用的SDK或工具灵活选择。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">OpenAI 协议对话接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">OpenAI 协议对话接口请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>model</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0510002</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>messages</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">是</td>
<td style="text-align:left">传递给大模型的对话上下文，按对话顺序排列。</td>
</tr>
<tr>
<td style="text-align:left"><strong>max_tokens</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">最大生成 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><strong>temperature</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">采样温度，控制模型生成文本的多样性。取值范围：<code>[0, 2]</code>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>top_p</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">核采样的概率阈值，控制模型生成文本的多样性。取值范围：<code>(0, 1.0]</code>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>stream</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否以流式输出方式回复。<code>false</code>（默认）：一次性返回；<code>true</code>：边生成边输出。</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">OpenAI 协议对话接口返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次调用的唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">对象类型，固定为 <code>chat.completion</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">请求创建时的 Unix 时间戳（秒）。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次请求使用的模型。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">模型生成内容的数组。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">当前选项在数组中的索引。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>finish_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型停止生成的原因。<code>stop</code>：自然停止；<code>length</code>：达到最大Token限制。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>message</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">模型返回的消息。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">消息角色，固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型的文本回复内容。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token消耗信息。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>prompt_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输出的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>total_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">总 Token 数。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">OpenAI 协议对话接口调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="OpenAI%20-%20%E4%BA%91%E7%81%B528%20-%20%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="OpenAI%20-%20%E4%BA%91%E7%81%B528%20-%20%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">OpenAI - 云灵28 - 非流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0510002&quot;,
    &quot;messages&quot;: [
        {
            &quot;role&quot;: &quot;user&quot;,
            &quot;content&quot;: &quot;介绍下自己&quot;
        }
    ],
    &quot;stream&quot;: false
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
    &quot;id&quot;: &quot;chatcmpl-03d444c814f6424e8b9252707e73a00e&quot;,
    &quot;object&quot;: &quot;chat.completion&quot;,
    &quot;created&quot;: 1780537196,
    &quot;model&quot;: &quot;T0510002&quot;,
    &quot;choices&quot;: [
        {
            &quot;index&quot;: 0,
            &quot;message&quot;: {
                &quot;role&quot;: &quot;assistant&quot;,
                &quot;content&quot;: &quot;你好！我是 AI 助手。\n\n简单介绍一下我自己：...&quot;,
                &quot;finish_reason&quot;: &quot;stop&quot;
            }
        }
    ],
    &quot;usage&quot;: {
        &quot;prompt_tokens&quot;: 24,
        &quot;completion_tokens&quot;: 204,
        &quot;total_tokens&quot;: 228
    }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="OpenAI%20-%20%E4%BA%91%E7%81%B528%20-%20%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="OpenAI%20-%20%E4%BA%91%E7%81%B528%20-%20%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">OpenAI - 云灵28 - 流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0510002&quot;,
    &quot;messages&quot;: [
        {
            &quot;role&quot;: &quot;user&quot;,
            &quot;content&quot;: &quot;介绍下自己&quot;
        }
    ],
    &quot;stream&quot;: true
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>data: {&quot;id&quot;:&quot;chatcmpl-4677216fe29845968d23ca578a9586a3&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1780537431,&quot;model&quot;:&quot;T0510002&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;你好！我是  AI 助手。\n\n简单介绍一&quot;},&quot;finish_reason&quot;:null}]}

data: {&quot;id&quot;:&quot;chatcmpl-4677216fe29845968d23ca578a9586a3&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1780537431,&quot;model&quot;:&quot;T0510002&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:&quot;下我自己：\n\n- **身份**：一个人工智能对话助&quot;},&quot;finish_reason&quot;:null}]}

...

data: {&quot;id&quot;:&quot;chatcmpl-4677216fe29845968d23ca578a9586a3&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1780537431,&quot;model&quot;:&quot;T0510002&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;},&quot;finish_reason&quot;:&quot;stop&quot;}],&quot;usage&quot;:{&quot;prompt_tokens&quot;:24,&quot;completion_tokens&quot;:181,&quot;total_tokens&quot;:205}}

data: [DONE]
</code></pre><p><span id="7P96iLnc"></span></p>
<h2 id="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">Anthropic 协议对话接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/anthropic/api/v1/messages</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">Anthropic 协议对话接口请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>model</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0510002</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>messages</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">是</td>
<td style="text-align:left">传递给大模型的对话上下文，按对话顺序排列。</td>
</tr>
<tr>
<td style="text-align:left"><strong>max_tokens</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">是</td>
<td style="text-align:left">最大生成 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><strong>system</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">系统提示词，用于设定大模型的角色、语气、任务目标或约束条件等（顶层字段，不在 messages 中）。</td>
</tr>
<tr>
<td style="text-align:left"><strong>stream</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否以流式输出方式回复。<code>false</code>（默认）：一次性返回；<code>true</code>：边生成边输出，以 SSE 事件流形式返回。</td>
</tr>
<tr>
<td style="text-align:left"><strong>temperature</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">采样温度，控制模型生成文本的多样性。取值范围：<code>[0, 1]</code>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>tools</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具定义（函数调用）数组。</td>
</tr>
<tr>
<td style="text-align:left"><strong>thinking</strong></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">扩展思考配置。</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">Anthropic 协议对话接口返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次调用的唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">对象类型，固定为 <code>message</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">消息角色，固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次请求使用的模型。</td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">模型返回的内容数组。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">内容类型，如 <code>text</code>。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>text</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型的文本回复内容。</td>
</tr>
<tr>
<td style="text-align:left"><code>stop_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型停止生成的原因。<code>end_turn</code>：自然结束；<code>max_tokens</code>：达到最大Token限制。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token消耗信息。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>input_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>output_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输出的 Token 数。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">Anthropic 协议对话接口调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="Anthropic%20-%20%E4%BA%91%E7%81%B528%20-%20%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="Anthropic%20-%20%E4%BA%91%E7%81%B528%20-%20%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">Anthropic - 云灵28 - 非流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/anthropic/api/v1/messages?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0510002&quot;,
    &quot;messages&quot;: [
        {
            &quot;role&quot;: &quot;user&quot;,
            &quot;content&quot;: &quot;介绍下自己&quot;
        }
    ],
    &quot;max_tokens&quot;: 1024,
    &quot;stream&quot;: false
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
    &quot;id&quot;: &quot;msg_4e1395b5001f49789f958424df02cad1&quot;,
    &quot;type&quot;: &quot;message&quot;,
    &quot;role&quot;: &quot;assistant&quot;,
    &quot;model&quot;: &quot;T0510002&quot;,
    &quot;content&quot;: [
        {
            &quot;type&quot;: &quot;text&quot;,
            &quot;text&quot;: &quot;你好！我是人工智能助手。\n\n简单介绍一下我自己：...\n\n有什么我可以帮你的吗？&quot;
        }
    ],
    &quot;stop_reason&quot;: &quot;end_turn&quot;,
    &quot;usage&quot;: {
        &quot;input_tokens&quot;: 18,
        &quot;output_tokens&quot;: 383
    }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="Anthropic%20-%20%E4%BA%91%E7%81%B528%20-%20%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="Anthropic%20-%20%E4%BA%91%E7%81%B528%20-%20%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">Anthropic - 云灵28 - 流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/anthropic/api/v1/messages?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0510002&quot;,
    &quot;messages&quot;: [
        {
            &quot;role&quot;: &quot;user&quot;,
            &quot;content&quot;: &quot;介绍下自己&quot;
        }
    ],
    &quot;max_tokens&quot;: 1024,
    &quot;stream&quot;: true
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>event: message_start
data: {&quot;type&quot;:&quot;message_start&quot;,&quot;message&quot;:{&quot;id&quot;:&quot;msg_8f5c6461ece945aab40613bceeb99d9a&quot;,&quot;type&quot;:&quot;message&quot;,&quot;role&quot;:&quot;assistant&quot;,&quot;model&quot;:&quot;T0510002&quot;,&quot;content&quot;:[],&quot;stop_reason&quot;:null,&quot;usage&quot;:{&quot;input_tokens&quot;:0,&quot;output_tokens&quot;:0}}}

event: content_block_start
data: {&quot;type&quot;:&quot;content_block_start&quot;,&quot;index&quot;:0,&quot;content_block&quot;:{&quot;type&quot;:&quot;text&quot;,&quot;text&quot;:&quot;&quot;}}

event: content_block_delta
data: {&quot;type&quot;:&quot;content_block_delta&quot;,&quot;index&quot;:0,&quot;delta&quot;:{&quot;type&quot;:&quot;text_delta&quot;,&quot;text&quot;:&quot;你好&quot;}}

...

event: message_delta
data: {&quot;type&quot;:&quot;message_delta&quot;,&quot;delta&quot;:{&quot;stop_reason&quot;:&quot;end_turn&quot;,&quot;stop_sequence&quot;:null},&quot;usage&quot;:{&quot;input_tokens&quot;:18,&quot;output_tokens&quot;:318}}

event: message_stop
data: {&quot;type&quot;:&quot;message_stop&quot;}
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th style="text-align:left">错误码</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>InvalidApiKey</code></td>
<td style="text-align:left">API Key无效或未提供。</td>
</tr>
<tr>
<td style="text-align:left"><code>InvalidParameter</code></td>
<td style="text-align:left">请求参数不合法。请检查参数值是否符合文档要求。</td>
</tr>
<tr>
<td style="text-align:left"><code>InternalError</code></td>
<td style="text-align:left">服务内部错误。请稍后重试，若问题持续存在请联系技术支持。</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Mon, 08 Jun 2026 15:52:41 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1247</guid>
      <comments>http://doc.talkingdata.com/posts/1247#comments</comments>
    </item>
    <item>
      <title>TD云灵27</title>
      <link>http://doc.talkingdata.com/posts/1246</link>
      <category>多模态生成API</category>
      <author>liuxinmei</author>
      <description>云灵27 接口说明文档 TD模型编号：T0510001 模型能力简介 云灵27 文本对话：支持多轮对话、文本生成、逻辑推理、代码生成、长文本处理等能力。 协议支持：本接口同时兼容 OpenAI Chat Completions 与 Anthropic Messages 两种主流协议，您可根据使用的SDK或工具灵活选择。 鉴权说明  本接口支持API Key鉴权，需联系TD运维同学获取长效API Key。
 OpenAI 协议对话接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions 请求头（Request Headers）： 头部字段 值 是否必填 说明 </description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%81%B527%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%81%B527%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云灵27 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0510001</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云灵27</strong><ul>
<li><strong>文本对话</strong>：支持多轮对话、文本生成、逻辑推理、代码生成、长文本处理等能力。</li>
<li><strong>协议支持</strong>：本接口同时兼容 <strong>OpenAI Chat Completions</strong> 与 <strong>Anthropic Messages</strong> 两种主流协议，您可根据使用的SDK或工具灵活选择。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">OpenAI 协议对话接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">OpenAI 协议对话接口请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>model</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0510001</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>messages</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">是</td>
<td style="text-align:left">传递给大模型的对话上下文，按对话顺序排列。</td>
</tr>
<tr>
<td style="text-align:left"><strong>max_tokens</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">最大生成 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><strong>temperature</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">采样温度，控制模型生成文本的多样性。取值范围：<code>[0, 2]</code>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>top_p</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">核采样的概率阈值，控制模型生成文本的多样性。取值范围：<code>(0, 1.0]</code>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>stream</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否以流式输出方式回复。<code>false</code>（默认）：一次性返回；<code>true</code>：边生成边输出。</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">OpenAI 协议对话接口返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次调用的唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">对象类型，固定为 <code>chat.completion</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">请求创建时的 Unix 时间戳（秒）。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次请求使用的模型。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">模型生成内容的数组。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">当前选项在数组中的索引。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>finish_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型停止生成的原因。<code>stop</code>：自然停止；<code>length</code>：达到最大Token限制。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>message</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">模型返回的消息。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">消息角色，固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型的文本回复内容。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token消耗信息。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>prompt_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输出的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>total_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">总 Token 数。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="OpenAI%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">OpenAI 协议对话接口调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="OpenAI%20-%20%E4%BA%91%E7%81%B527%20-%20%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="OpenAI%20-%20%E4%BA%91%E7%81%B527%20-%20%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">OpenAI - 云灵27 - 非流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0510001&quot;,
    &quot;messages&quot;: [
        {
            &quot;role&quot;: &quot;user&quot;,
            &quot;content&quot;: &quot;介绍下自己&quot;
        }
    ],
    &quot;stream&quot;: false
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
    &quot;id&quot;: &quot;chatcmpl-03d444c814f6424e8b9252707e73a00e&quot;,
    &quot;object&quot;: &quot;chat.completion&quot;,
    &quot;created&quot;: 1780537196,
    &quot;model&quot;: &quot;T0510001&quot;,
    &quot;choices&quot;: [
        {
            &quot;index&quot;: 0,
            &quot;message&quot;: {
                &quot;role&quot;: &quot;assistant&quot;,
                &quot;content&quot;: &quot;你好！我是 AI 助手...\n\n有什么我可以帮你的吗？&quot;
            },
            &quot;finish_reason&quot;: &quot;stop&quot;
        }
    ],
    &quot;usage&quot;: {
        &quot;prompt_tokens&quot;: 24,
        &quot;completion_tokens&quot;: 204,
        &quot;total_tokens&quot;: 228
    }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="OpenAI%20-%20%E4%BA%91%E7%81%B527%20-%20%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="OpenAI%20-%20%E4%BA%91%E7%81%B527%20-%20%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">OpenAI - 云灵27 - 流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0510001&quot;,
    &quot;messages&quot;: [
        {
            &quot;role&quot;: &quot;user&quot;,
            &quot;content&quot;: &quot;介绍下自己&quot;
        }
    ],
    &quot;stream&quot;: true
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>data: {&quot;id&quot;:&quot;chatcmpl-4677216fe29845968d23ca578a9586a3&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1780537431,&quot;model&quot;:&quot;T0510001&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;你好！我是AI 助手。\n\n简单介绍一&quot;},&quot;finish_reason&quot;:null}]}

data: {&quot;id&quot;:&quot;chatcmpl-4677216fe29845968d23ca578a9586a3&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1780537431,&quot;model&quot;:&quot;T0510001&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:&quot;下我自己：\n\n- **身份**：一个人工智能对话助&quot;},&quot;finish_reason&quot;:null}]}

...

data: {&quot;id&quot;:&quot;chatcmpl-4677216fe29845968d23ca578a9586a3&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1780537431,&quot;model&quot;:&quot;T0510001&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;},&quot;finish_reason&quot;:&quot;stop&quot;}],&quot;usage&quot;:{&quot;prompt_tokens&quot;:24,&quot;completion_tokens&quot;:181,&quot;total_tokens&quot;:205}}

data: [DONE]
</code></pre><p><span id="7P96iLnc"></span></p>
<h2 id="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">Anthropic 协议对话接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/anthropic/api/v1/messages</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">Anthropic 协议对话接口请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>model</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0510001</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>messages</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">是</td>
<td style="text-align:left">传递给大模型的对话上下文，按对话顺序排列。</td>
</tr>
<tr>
<td style="text-align:left"><strong>max_tokens</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">是</td>
<td style="text-align:left">最大生成 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><strong>system</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">系统提示词，用于设定大模型的角色、语气、任务目标或约束条件等（顶层字段，不在 messages 中）。</td>
</tr>
<tr>
<td style="text-align:left"><strong>stream</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否以流式输出方式回复。<code>false</code>（默认）：一次性返回；<code>true</code>：边生成边输出，以 SSE 事件流形式返回。</td>
</tr>
<tr>
<td style="text-align:left"><strong>temperature</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">采样温度，控制模型生成文本的多样性。取值范围：<code>[0, 1]</code>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>tools</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具定义（函数调用）数组。</td>
</tr>
<tr>
<td style="text-align:left"><strong>thinking</strong></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">扩展思考配置。</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">Anthropic 协议对话接口返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次调用的唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">对象类型，固定为 <code>message</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">消息角色，固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次请求使用的模型。</td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">模型返回的内容数组。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">内容类型，如 <code>text</code>。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>text</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型的文本回复内容。</td>
</tr>
<tr>
<td style="text-align:left"><code>stop_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型停止生成的原因。<code>end_turn</code>：自然结束；<code>max_tokens</code>：达到最大Token限制。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token消耗信息。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>input_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>output_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输出的 Token 数。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="Anthropic%20%E5%8D%8F%E8%AE%AE%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">Anthropic 协议对话接口调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="Anthropic%20-%20%E4%BA%91%E7%81%B527%20-%20%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="Anthropic%20-%20%E4%BA%91%E7%81%B527%20-%20%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">Anthropic - 云灵27 - 非流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/anthropic/api/v1/messages?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0510001&quot;,
    &quot;messages&quot;: [
        {
            &quot;role&quot;: &quot;user&quot;,
            &quot;content&quot;: &quot;介绍下自己&quot;
        }
    ],
    &quot;max_tokens&quot;: 1024,
    &quot;stream&quot;: false
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
    &quot;id&quot;: &quot;msg_4e1395b5001f49789f958424df02cad1&quot;,
    &quot;type&quot;: &quot;message&quot;,
    &quot;role&quot;: &quot;assistant&quot;,
    &quot;model&quot;: &quot;T0510001&quot;,
    &quot;content&quot;: [
        {
            &quot;type&quot;: &quot;text&quot;,
            &quot;text&quot;: &quot;你好！我是人工智能助手。\n\n简单介绍一下我自己：...\n\n有什么我可以帮你的吗？&quot;
        }
    ],
    &quot;stop_reason&quot;: &quot;end_turn&quot;,
    &quot;usage&quot;: {
        &quot;input_tokens&quot;: 18,
        &quot;output_tokens&quot;: 383
    }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="Anthropic%20-%20%E4%BA%91%E7%81%B527%20-%20%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="Anthropic%20-%20%E4%BA%91%E7%81%B527%20-%20%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">Anthropic - 云灵27 - 流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/anthropic/api/v1/messages?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0510001&quot;,
    &quot;messages&quot;: [
        {
            &quot;role&quot;: &quot;user&quot;,
            &quot;content&quot;: &quot;介绍下自己&quot;
        }
    ],
    &quot;max_tokens&quot;: 1024,
    &quot;stream&quot;: true
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>event: message_start
data: {&quot;type&quot;:&quot;message_start&quot;,&quot;message&quot;:{&quot;id&quot;:&quot;msg_8f5c6461ece945aab40613bceeb99d9a&quot;,&quot;type&quot;:&quot;message&quot;,&quot;role&quot;:&quot;assistant&quot;,&quot;model&quot;:&quot;T0510001&quot;,&quot;content&quot;:[],&quot;stop_reason&quot;:null,&quot;usage&quot;:{&quot;input_tokens&quot;:0,&quot;output_tokens&quot;:0}}}

event: content_block_start
data: {&quot;type&quot;:&quot;content_block_start&quot;,&quot;index&quot;:0,&quot;content_block&quot;:{&quot;type&quot;:&quot;text&quot;,&quot;text&quot;:&quot;&quot;}}

event: content_block_delta
data: {&quot;type&quot;:&quot;content_block_delta&quot;,&quot;index&quot;:0,&quot;delta&quot;:{&quot;type&quot;:&quot;text_delta&quot;,&quot;text&quot;:&quot;你好&quot;}}

...

event: message_delta
data: {&quot;type&quot;:&quot;message_delta&quot;,&quot;delta&quot;:{&quot;stop_reason&quot;:&quot;end_turn&quot;,&quot;stop_sequence&quot;:null},&quot;usage&quot;:{&quot;input_tokens&quot;:18,&quot;output_tokens&quot;:318}}

event: message_stop
data: {&quot;type&quot;:&quot;message_stop&quot;}
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th style="text-align:left">错误码</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>InvalidApiKey</code></td>
<td style="text-align:left">API Key无效或未提供。</td>
</tr>
<tr>
<td style="text-align:left"><code>InvalidParameter</code></td>
<td style="text-align:left">请求参数不合法。请检查参数值是否符合文档要求。</td>
</tr>
<tr>
<td style="text-align:left"><code>InternalError</code></td>
<td style="text-align:left">服务内部错误。请稍后重试，若问题持续存在请联系技术支持。</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Fri, 05 Jun 2026 17:14:04 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1246</guid>
      <comments>http://doc.talkingdata.com/posts/1246#comments</comments>
    </item>
    <item>
      <title>TD云牍54/Qwen3.7-Max</title>
      <link>http://doc.talkingdata.com/posts/1245</link>
      <category>文本生成 API</category>
      <author>liuxinmei</author>
      <description>云牍54 接口说明文档 TD模型编号：T0403001 模型能力简介 云牍54 文本对话：支持多轮对话、文本生成、逻辑推理、代码生成、长文本处理等能力。 鉴权说明  本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
 对话接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions 请求头（Request Headers）： 头部字段 值 是否必填 说明 Authorization Bearer &lt;your_api_key&gt; 是 API 鉴权凭证，请替换为有效的 API Key X-Timestamp 1700000000 是 Unix</description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%89%8D54%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%89%8D54%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云牍54 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0403001</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云牍54</strong><ul>
<li><strong>文本对话</strong>：支持多轮对话、文本生成、逻辑推理、代码生成、长文本处理等能力。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="%E5%AF%B9%E8%AF%9D%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">对话接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">对话请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">对话请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>model</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0403001</code></strong></td>
</tr>
<tr>
<td style="text-align:left"><strong>messages</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">是</td>
<td style="text-align:left">传递给大模型的上下文，按对话顺序排列</td>
</tr>
</tbody>
</table>
<h3 id="messages%20%E6%95%B0%E7%BB%84%E5%85%83%E7%B4%A0%E7%B1%BB%E5%9E%8B" name="messages%20%E6%95%B0%E7%BB%84%E5%85%83%E7%B4%A0%E7%B1%BB%E5%9E%8B">messages 数组元素类型</h3>
<h4 id="1.%20System%20Message%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89" name="1.%20System%20Message%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89">1. System Message（可选）</h4>
<p>系统消息，用于设定大模型的角色、语气、任务目标或约束条件等。一般放在messages数组的第一位。</p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">固定为 <code>system</code></td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">系统指令，用于明确模型的角色、行为规范、回答风格和任务约束等</td>
</tr>
</tbody>
</table>
<h4 id="2.%20User%20Message%EF%BC%88%E5%BF%85%E9%80%89%EF%BC%89" name="2.%20User%20Message%EF%BC%88%E5%BF%85%E9%80%89%EF%BC%89">2. User Message（必选）</h4>
<p>用户消息，用于向模型传递问题、指令或上下文等。</p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">固定为 <code>user</code></td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">消息内容。</td>
</tr>
</tbody>
</table>
<h4 id="3.%20Assistant%20Message%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89" name="3.%20Assistant%20Message%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89">3. Assistant Message（可选）</h4>
<p>模型的回复，通常用于在多轮对话中作为上下文回传给模型。</p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">固定为 <code>assistant</code></td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">可选</td>
<td style="text-align:left">模型回复的文本内容。当 <code>partial</code> 为true或包含tool_calls时可为空</td>
</tr>
<tr>
<td style="text-align:left"><code>partial</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否开启前缀续写。<code>true</code>为开启，<code>false</code>为不开启，默认<code>false</code></td>
</tr>
</tbody>
</table>
<h4 id="4.%20Tool%20Message%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89" name="4.%20Tool%20Message%EF%BC%88%E5%8F%AF%E9%80%89%EF%BC%89">4. Tool Message（可选）</h4>
<p>工具的输出信息。</p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">固定为 <code>tool</code></td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">工具函数的输出内容，必须为字符串</td>
</tr>
<tr>
<td style="text-align:left"><code>tool_call_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">工具调用的唯一标识符</td>
</tr>
</tbody>
</table>
<hr>
<h3 id="%E5%85%B6%E4%BB%96%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="%E5%85%B6%E4%BB%96%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">其他请求参数</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>stream</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否以流式输出方式回复。<code>false</code>（默认）一次性返回；<code>true</code>边生成边输出。推荐设置为<code>true</code></td>
</tr>
<tr>
<td style="text-align:left"><strong>stream_options</strong></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">流式输出的配置项，仅在<code>stream:true</code>时生效</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>include_usage</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否在响应的最后一个数据块包含Token消耗信息，默认<code>false</code></td>
</tr>
<tr>
<td style="text-align:left"><strong>temperature</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">采样温度，控制模型生成文本的多样性。取值范围：<code>[0, 2)</code>。温度越高输出越多祥，越低越确定</td>
</tr>
<tr>
<td style="text-align:left"><strong>top_p</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">核采样的概率阈值，控制模型生成文本的多样性。取值范围：<code>(0, 1.0]</code></td>
</tr>
<tr>
<td style="text-align:left"><strong>top_k</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">指定生成过程中用于采样的候选Token数量。值越大输出越随机，越小越确定。设为<code>null</code>或大于100时禁用。默认值：<code>20</code></td>
</tr>
<tr>
<td style="text-align:left"><strong>repetition_penalty</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">连续序列中的重复度惩罚。提高此值可降低重复度，1.0表示不做惩罚</td>
</tr>
<tr>
<td style="text-align:left"><strong>presence_penalty</strong></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制生成文本时的内容重复度。取值范围：<code>[-2.0, 2.0]</code>。正值降低重复度，负值增加重复度。默认值：<code>1.5</code>（非思考模式）</td>
</tr>
<tr>
<td style="text-align:left"><strong>max_tokens</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left"><strong>（即将废弃）</strong> 限制模型输出（不包含思维链）的最大Token数，新接入请使用<code>max_completion_tokens</code></td>
</tr>
<tr>
<td style="text-align:left"><strong>max_completion_tokens</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">限制模型本次响应中输出（包含思维链）的最大Token数。</td>
</tr>
<tr>
<td style="text-align:left"><strong>response_format</strong></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">返回内容的格式，默认<code>{&quot;type&quot;: &quot;text&quot;}</code>。可选：<code>{&quot;type&quot;: &quot;text&quot;}</code>或<code>{&quot;type&quot;: &quot;json_object&quot;}</code>。如需JSON格式，需在提示词中明确指示</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">可选值：<code>text</code>（文字回复）、<code>json_object</code>（标准JSON字符串）</td>
</tr>
<tr>
<td style="text-align:left"><strong>enable_thinking</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否开启思考模式（思维链）。<code>true</code>开启，思考内容通过<code>reasoning_content</code>字段返回</td>
</tr>
<tr>
<td style="text-align:left"><strong>preserve_thinking</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否将对话历史中assistant消息的<code>reasoning_content</code>拼接至模型输入。默认<code>false</code></td>
</tr>
<tr>
<td style="text-align:left"><strong>thinking_budget</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">思考过程的最大Token数。</td>
</tr>
<tr>
<td style="text-align:left"><strong>seed</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">随机数种子，用于结果复现。相同输入和参数下尽可能返回相同结果。取值范围：<code>[0, 2^31-1]</code></td>
</tr>
<tr>
<td style="text-align:left"><strong>logprobs</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否返回输出Token的对数概率。思考阶段生成的内容（<code>reasoning_content</code>）不返回</td>
</tr>
<tr>
<td style="text-align:left"><strong>top_logprobs</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">返回模型最大概率的候选Token个数。取值范围：<code>[0,5]</code>，仅当<code>logprobs:true</code>时生效</td>
</tr>
<tr>
<td style="text-align:left"><strong>stop</strong></td>
<td style="text-align:left">String/Array</td>
<td style="text-align:left">否</td>
<td style="text-align:left">停止词。当模型生成文本中出现stop指定的字符串或token_id时，生成立即终止</td>
</tr>
<tr>
<td style="text-align:left"><strong>n</strong></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">生成响应的数量，取值范围1-4。增大n会增加输出Token消耗</td>
</tr>
<tr>
<td style="text-align:left"><strong>tools</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">否</td>
<td style="text-align:left">Function Calling工具数组。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">工具类型，当前仅支持<code>function</code></td>
</tr>
<tr>
<td style="text-align:left">└─ <code>function</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">是</td>
<td style="text-align:left">工具函数定义</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>name</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">工具名称，仅允许字母、数字、下划线和短划线，最长64 Token</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>description</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">工具描述信息</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>parameters</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具参数描述，需为合法JSON Schema，默认<code>{}</code></td>
</tr>
<tr>
<td style="text-align:left"><strong>tool_choice</strong></td>
<td style="text-align:left">String/Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具选择策略。可选值：<code>auto</code>（自动）、<code>none</code>（禁用）、<code>{&quot;type&quot;:&quot;function&quot;,&quot;function&quot;:{&quot;name&quot;:&quot;工具名&quot;}}</code>（强制调用）。思考模式模型不支持强制调用</td>
</tr>
<tr>
<td style="text-align:left"><strong>parallel_tool_calls</strong></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否开启并行工具调用，默认<code>false</code></td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="%E5%AF%B9%E8%AF%9D%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0%EF%BC%88%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA%EF%BC%89" name="%E5%AF%B9%E8%AF%9D%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0%EF%BC%88%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA%EF%BC%89">对话返回参数（非流式输出）</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次调用的唯一标识符</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为 <code>chat.completion</code></td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">请求创建时的Unix时间戳（秒）</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次请求使用的模型名称</td>
</tr>
<tr>
<td style="text-align:left"><code>system_fingerprint</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">模型生成内容的数组</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">当前选项在数组中的索引</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>finish_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">停止原因：<code>stop</code>（自然停止）、<code>length</code>（达到长度限制）、<code>tool_calls</code>（需调用工具）</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>logprobs</code></td>
<td style="text-align:left">Object/null</td>
<td style="text-align:left">Token概率信息，未开启时为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">│  ├─ <code>content</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">Token及其对数概率数组</td>
</tr>
<tr>
<td style="text-align:left">│  │  ├─ <code>token</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">Token文本</td>
</tr>
<tr>
<td style="text-align:left">│  │  ├─ <code>bytes</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">UTF-8原始字节列表</td>
</tr>
<tr>
<td style="text-align:left">│  │  ├─ <code>logprob</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">对数概率</td>
</tr>
<tr>
<td style="text-align:left">│  │  └─ <code>top_logprobs</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">候选Token列表</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>message</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">模型返回的消息</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为 <code>assistant</code></td>
</tr>
<tr>
<td style="text-align:left">├─ <code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型的文本回复内容</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>reasoning_content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">思维链内容（仅当开启<code>enable_thinking</code>时返回）</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>refusal</code></td>
<td style="text-align:left">String/null</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">├─ <code>audio</code></td>
<td style="text-align:left">Object/null</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">├─ <code>function_call</code></td>
<td style="text-align:left">Object/null</td>
<td style="text-align:left">已废弃，固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">└─ <code>tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">工具调用信息（若使用Function Calling）</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">工具响应唯一标识符</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为<code>function</code></td>
</tr>
<tr>
<td style="text-align:left">├─ <code>index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">工具在数组中的索引</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>function</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">工具信息</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>name</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">工具名称</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>arguments</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">入参JSON字符串</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token消耗信息</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>prompt_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入Token数</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输出Token数</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>total_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">总Token数</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>completion_tokens_details</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输出Token细粒度信息</td>
</tr>
<tr>
<td style="text-align:left">│  ├─ <code>audio_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">│  ├─ <code>reasoning_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">思维链Token数</td>
</tr>
<tr>
<td style="text-align:left">│  └─ <code>text_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输出文本Token数</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>prompt_tokens_details</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输入Token细粒度信息</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>audio_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">├─ <code>cached_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">命中缓存的Token数</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>text_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入文本Token数</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>image_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入图像Token数</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>video_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">输入视频Token数</td>
</tr>
</tbody>
</table>
<h2 id="%E6%B5%81%E5%BC%8F%E5%93%8D%E5%BA%94%E5%8F%82%E6%95%B0%EF%BC%88chunk%E5%AF%B9%E8%B1%A1%EF%BC%89" name="%E6%B5%81%E5%BC%8F%E5%93%8D%E5%BA%94%E5%8F%82%E6%95%B0%EF%BC%88chunk%E5%AF%B9%E8%B1%A1%EF%BC%89">流式响应参数（chunk对象）</h2>
<p>当 <code>stream: true</code> 时，每个chunk结构如下：</p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">调用唯一标识符，所有chunk相同</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为 <code>chat.completion.chunk</code></td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">请求创建时间戳</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型名称</td>
</tr>
<tr>
<td style="text-align:left"><code>system_fingerprint</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">生成内容数组（最后一个chunk可能为空）</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">索引</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>finish_reason</code></td>
<td style="text-align:left">String/null</td>
<td style="text-align:left">停止原因，生成中为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">├─ <code>logprobs</code></td>
<td style="text-align:left">Object/null</td>
<td style="text-align:left">概率信息</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>delta</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">增量对象</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">角色，仅第一个chunk有值</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">增量消息内容</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>reasoning_content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">增量思维链内容</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>function_call</code></td>
<td style="text-align:left">Object/null</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">├─ <code>audio</code></td>
<td style="text-align:left">Object/null</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">├─ <code>refusal</code></td>
<td style="text-align:left">Object/null</td>
<td style="text-align:left">固定为<code>null</code></td>
</tr>
<tr>
<td style="text-align:left">└─ <code>tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">增量工具调用信息</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">索引</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">唯一标识符</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>function</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">函数信息</td>
</tr>
<tr>
<td style="text-align:left">│  ├─ <code>name</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">函数名（仅第一个chunk）</td>
</tr>
<tr>
<td style="text-align:left">│  └─ <code>arguments</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">增量入参</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为<code>function</code></td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token消耗，<strong>仅在<code>include_usage:true</code>时的最后一个chunk显示</strong></td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%AF%B9%E8%AF%9D%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="%E5%AF%B9%E8%AF%9D%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">对话调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%89%8D54-%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="%E4%BA%91%E7%89%8D54-%E9%9D%9E%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">云牍54-非流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0403001&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;介绍下自己&quot;
      }
    ],
    &quot;stream&quot;: false
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
  &quot;choices&quot;: [
    {
      &quot;finish_reason&quot;: &quot;stop&quot;,
      &quot;index&quot;: 0,
      &quot;message&quot;: {
        &quot;content&quot;: &quot;你好！我是通义千问，由阿里巴巴集团通义实验室自主研发的大型语言模型。\n\n我致力于成为你高效、真诚的思考伙伴，协助你解决各种问题。我的核心能力涵盖以下几个方面：\n\n* **语言理解与创作**：能够流畅地进行多轮对话，精准理解你的意图，并支持高质量的文本创作与多语言交互。\n* **逻辑推理与科学分析**：在数学、自然科学及复杂的逻辑推理任务中，能够拆解高难度问题并提供清晰、准确的解答。\n* **代码生成与开发辅助**：支持多种编程语言，可以帮你编写、理解和调试复杂代码，甚至能直接将你的创意转化为可运行的前端页面。\n* **长文本与深度视觉分析**：能够原生处理数十万字的超长文档，快速提取和理解关键信息；同时具备深度的视觉分析能力，可以解读复杂的图表、公式和专业图示。\n* **自主规划与执行**：能够独立规划并完成需要多步协调的复杂任务，支持自主代码执行、图形用户界面理解以及跨设备操作。\n\n无论是日常答疑、专业领域分析（如法律、医疗等），还是激发创意灵感，我都随时准备为你提供帮助。请问今天有什么我可以为你效劳的吗？&quot;,
        &quot;reasoning_content&quot;: &quot;用户让我“介绍下自己”。\n我需要回答我的身份、能力、特点等。\n\n我是通义千问（Qwen），由阿里巴巴集团通义实验室自主研发的大型语言模型。\n\n核心能力包括：\n- 语言理解与表达\n- 逻辑推理与科学分析\n- 代码生成与调试\n- 长文本处理与深度视觉分析\n- 自主智能体规划与多轮对话\n- 人类对齐优化（医疗、法律等垂直领域）\n\n回答风格：\n- 真诚、礼貌、清晰、简洁\n- 使用与用户相同的语言（中文）\n- 避免提及具体的版本号\n\n起草回答：\n你好！我是通义千问，由阿里巴巴集团通义实验室自主研发的大型语言模型。\n\n我的主要目标是成为你思考的伙伴，协助你完成各种任务。我的核心能力包括：\n1. **语言理解与表达**：能够流畅地进行多轮对话，精准理解你的意图，并支持多种语言的交互。\n2. **逻辑推理与科学分析**：在数学、自然科学及复杂的逻辑推理任务中，能够拆解问题并提供准确的解答。\n3. **代码生成与开发辅助**：支持多种编程语言，可以帮你编写、理解和调试代码，甚至将创意转化为可运行的前端页面。\n4. **长文本与深度视觉分析**：能够处理数十万字的长文档，快速提取关键信息；同时具备深度的视觉分析能力，可以解读复杂的图表和科学图示。\n5. **自主规划与智能体能力**：能够独立规划并完成需要多步协调的复杂任务，支持代码执行、图形用户界面理解等操作。\n\n无论你是需要解答疑惑、创作文本、编写代码，还是进行深度的专业分析，我都很高兴能为你提供帮助。请问今天有什么我可以帮你的吗？\n\n检查是否符合要求：\n- 身份纯净：用户直接问了“介绍下自己”，所以我介绍自己是合理的。\n- 语言同步：中文。\n- 品牌一致性：自称“通义千问”，没有提版本号。\n- 定性描述：没有编造具体的百分比数据。\n\n修改完善，使语气更自然、亲和。\n\n“你好！我是通义千问，由阿里巴巴集团通义实验室自主研发的大型语言模型。\n\n我致力于成为你高效、真诚的思考伙伴。我的核心能力涵盖以下几个方面：\n- **语言与创作**：流畅进行多轮对话，支持高质量的内容创作与多语言交互。\n- **逻辑与推理**：在数学、科学及复杂逻辑推理方面表现优异，能够精准拆解和解决难题。\n- **代码与开发**：支持多阶段代码生成、理解与调试，甚至能直接将创意转化为前端页面。\n- **长文本与视觉分析**：可处理数十万字的超长文档并精准定位信息，同时具备深度视觉分析能力，能解读复杂图表与专业图示。\n- **自主规划**：能够独立规划并完成多步协调的复杂任务，支持自主代码执行与跨设备操作。\n\n无论是日常答疑、专业分析还是激发灵感，我都随时准备为你提供帮助。今天有什么我可以为你效劳的吗？”\n\n这个回答清晰、简洁、真实，符合通义千问的设定。直接输出。&quot;,
        &quot;role&quot;: &quot;assistant&quot;
      }
    }
  ],
  &quot;created&quot;: 1780481379,
  &quot;id&quot;: &quot;chatcmpl-75f5e0c8-376a-9f2f-8a4c-67d3f05eecc7&quot;,
  &quot;model&quot;: &quot;qwen3.7-max&quot;,
  &quot;object&quot;: &quot;chat.completion&quot;,
  &quot;usage&quot;: {
    &quot;completion_tokens&quot;: 923,
    &quot;completion_tokens_details&quot;: {
      &quot;reasoning_tokens&quot;: 669
    },
    &quot;prompt_tokens&quot;: 13,
    &quot;prompt_tokens_details&quot;: {
      &quot;cached_tokens&quot;: 0
    },
    &quot;total_tokens&quot;: 936
  }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%89%8D54-%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA" name="%E4%BA%91%E7%89%8D54-%E6%B5%81%E5%BC%8F%E8%BE%93%E5%87%BA">云牍54-流式输出</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0403001&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;介绍下自己&quot;
      }
    ],
    &quot;stream&quot;: true
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null,&quot;choices&quot;:[{&quot;logprobs&quot;:null,&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;role&quot;:&quot;assistant&quot;,&quot;reasoning_content&quot;:&quot;&quot;},&quot;finish_reason&quot;:null}]}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;reasoning_content&quot;:&quot;用户&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:null,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;reasoning_content&quot;:&quot;让我介绍自己。&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:null,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;reasoning_content&quot;:&quot;\n我需要以&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:null,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

...

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;为你做的吗？&quot;,&quot;reasoning_content&quot;:&quot;&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:null,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;reasoning_content&quot;:&quot;&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:&quot;stop&quot;,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:{&quot;total_tokens&quot;:1028,&quot;completion_tokens&quot;:1015,&quot;prompt_tokens&quot;:13,&quot;completion_tokens_details&quot;:{&quot;reasoning_tokens&quot;:724},&quot;prompt_tokens_details&quot;:{&quot;cached_tokens&quot;:0}}}

data: [DONE]
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th style="text-align:left">错误码</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>InvalidApiKey</code></td>
<td style="text-align:left">API Key无效或未提供。</td>
</tr>
<tr>
<td style="text-align:left"><code>InvalidParameter</code></td>
<td style="text-align:left">请求参数不合法。请检查参数值是否符合文档要求。</td>
</tr>
<tr>
<td style="text-align:left"><code>InternalError</code></td>
<td style="text-align:left">服务内部错误。请稍后重试，若问题持续存在请联系技术支持。</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Fri, 05 Jun 2026 14:52:00 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1245</guid>
      <comments>http://doc.talkingdata.com/posts/1245#comments</comments>
    </item>
    <item>
      <title>HarmonyOS 元服务</title>
      <link>http://doc.talkingdata.com/posts/1244</link>
      <category>Version 5.0.0及以上版本</category>
      <author>zhangziyu</author>
      <description>TalkingData HarmonyOS 元服务 SDK 本项目仅供鸿蒙元服务使用， 普通应用（非元服务）请使用 @talkingdata/analysis。 合规声明 在接入本 SDK 前，请确认您已阅读并同意： TalkingData SDK 合规与安全指南 TalkingData SDK 隐私政策 在用户同意《隐私政策》之前，请勿调用 TalkingDataSDK.startA()。 概述 @talkingdata/analysis-atomic 是面向鸿蒙元服务的 TalkingData 统计分析 SDK，支持页面统计、自定义事件、账户与行业事件、Deep Link 归因等能力。 元服务版特点： 不采集 OAID、ODID 位置信息、TLink 等能力：需在 SDK 中开启对应采集</description>
      <content:encoded><![CDATA[<h1 id="TalkingData%20HarmonyOS%20%E5%85%83%E6%9C%8D%E5%8A%A1%20SDK" name="TalkingData%20HarmonyOS%20%E5%85%83%E6%9C%8D%E5%8A%A1%20SDK">TalkingData HarmonyOS 元服务 SDK</h1>
<p>本项目仅供鸿蒙元服务使用， 普通应用（非元服务）请使用 <a href="https://ohpm.openharmony.cn/#/cn/detail/@talkingdata%2Fanalysis">@talkingdata/analysis</a>。</p>
<h2 id="%E5%90%88%E8%A7%84%E5%A3%B0%E6%98%8E" name="%E5%90%88%E8%A7%84%E5%A3%B0%E6%98%8E">合规声明</h2>
<p>在接入本 SDK 前，请确认您已阅读并同意：</p>
<ul>
<li><a href="https://www.talkingdata.com/safety.jsp?languagetype=zh_cn">TalkingData SDK 合规与安全指南</a></li>
<li><a href="https://www.talkingdata.com/sdkprivacy.jsp?languagetype=zh_cn">TalkingData SDK 隐私政策</a></li>
</ul>
<p>在用户同意《隐私政策》之前，<strong>请勿</strong>调用 <code>TalkingDataSDK.startA()</code>。</p>
<hr>
<h2 id="%E6%A6%82%E8%BF%B0" name="%E6%A6%82%E8%BF%B0">概述</h2>
<p><code>@talkingdata/analysis-atomic</code> 是面向鸿蒙元服务的 TalkingData 统计分析 SDK，支持页面统计、自定义事件、账户与行业事件、Deep Link 归因等能力。</p>
<p>元服务版特点：</p>
<ul>
<li>不采集 OAID、ODID</li>
<li>位置信息、TLink 等能力：需在 SDK 中开启对应采集项，且宿主已声明并授权相关权限</li>
<li>支持 Deep Link 归因</li>
<li>使用应用内匿名设备标识进行统计</li>
</ul>
<hr>
<h2 id="%E9%9B%86%E6%88%90%E5%87%86%E5%A4%87" name="%E9%9B%86%E6%88%90%E5%87%86%E5%A4%87">集成准备</h2>
<h3 id="%E8%8E%B7%E5%8F%96%20App%20ID" name="%E8%8E%B7%E5%8F%96%20App%20ID">获取 App ID</h3>
<p>App ID 是 TalkingData 平台标识一款应用的唯一 ID。请登录 <a href="https://www.talkingdata.com/">TalkingData 产品中心</a> 创建应用并获取 App ID。</p>
<p>已创建应用可在 <strong>产品中心 → 我的应用 → 应用名称</strong> 中查看 App ID。</p>
<h3 id="%E5%85%83%E6%9C%8D%E5%8A%A1%E5%B7%A5%E7%A8%8B%E9%85%8D%E7%BD%AE" name="%E5%85%83%E6%9C%8D%E5%8A%A1%E5%B7%A5%E7%A8%8B%E9%85%8D%E7%BD%AE">元服务工程配置</h3>
<p>在宿主 <code>AppScope/app.json5</code> 中声明元服务类型：</p>
<pre><code class="lang-json5">{
  &quot;app&quot;: {
    &quot;bundleName&quot;: &quot;com.example.your.atomic&quot;,
    &quot;bundleType&quot;: &quot;atomicService&quot;
  }
}
</code></pre>
<p>在 entry 模块的 <code>module.json5</code> 中建议设置免安装：</p>
<pre><code class="lang-json5">{
  &quot;module&quot;: {
    &quot;type&quot;: &quot;entry&quot;,
    &quot;installationFree&quot;: true
  }
}
</code></pre>
<hr>
<h2 id="%E5%BC%95%E5%85%A5%20SDK" name="%E5%BC%95%E5%85%A5%20SDK">引入 SDK</h2>
<h3 id="ohpm%20%E5%BC%95%E5%85%A5" name="ohpm%20%E5%BC%95%E5%85%A5">ohpm 引入</h3>
<p>在工程根目录执行：</p>
<pre><code class="lang-shell">ohpm install @talkingdata/analysis-atomic
</code></pre>
<p>同步工程后，在代码中导入：</p>
<pre><code class="lang-typescript">import TalkingDataSDK from &#39;@talkingdata/analysis-atomic&#39;;
</code></pre>
<hr>
<h2 id="%E6%9D%83%E9%99%90%E8%AF%B4%E6%98%8E" name="%E6%9D%83%E9%99%90%E8%AF%B4%E6%98%8E">权限说明</h2>
<p>请在宿主 <code>module.json5</code> 中声明所需权限。<strong>SDK 不会弹出权限申请框</strong>，需在宿主侧完成声明与授权。</p>
<table>
<thead>
<tr>
<th>权限</th>
<th>说明</th>
<th>是否必须</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ohos.permission.INTERNET</code></td>
<td>联网并上报统计数据</td>
<td><strong>是</strong></td>
</tr>
<tr>
<td><code>ohos.permission.STORE_PERSISTENT_DATA</code></td>
<td>有助于卸载重装后保持设备标识相对稳定</td>
<td>否</td>
</tr>
<tr>
<td><code>ohos.permission.READ_PASTEBOARD</code></td>
<td>读取剪贴板，用于 TLink 延迟深度链接（仅 AdTracking）；<strong>受限权限</strong>，须在 AGC 申请并在签名 Profile 的 ACL 中勾选</td>
<td>否</td>
</tr>
<tr>
<td><code>ohos.permission.APPROXIMATELY_LOCATION</code></td>
<td>采集大致位置信息（需在 SDK 中 <code>setLocationEnabled(true)</code>）</td>
<td>否</td>
</tr>
</tbody>
</table>
<p>无需声明 <code>APP_TRACKING_CONSENT</code>。</p>
<p>声明示例：</p>
<pre><code class="lang-json5">{
  &quot;module&quot;: {
    &quot;requestPermissions&quot;: [
      {
        &quot;name&quot;: &quot;ohos.permission.INTERNET&quot;,
        &quot;reason&quot;: &quot;$string:internet_reason&quot;,
        &quot;usedScene&quot;: { &quot;when&quot;: &quot;inuse&quot; }
      },
      {
        &quot;name&quot;: &quot;ohos.permission.STORE_PERSISTENT_DATA&quot;,
        &quot;reason&quot;: &quot;$string:store_persistent_data_reason&quot;,
        &quot;usedScene&quot;: { &quot;when&quot;: &quot;inuse&quot; }
      },
      {
        &quot;name&quot;: &quot;ohos.permission.READ_PASTEBOARD&quot;,
        &quot;reason&quot;: &quot;$string:read_pasteboard_reason&quot;,
        &quot;usedScene&quot;: { &quot;when&quot;: &quot;inuse&quot; }
      },
      {
        &quot;name&quot;: &quot;ohos.permission.APPROXIMATELY_LOCATION&quot;,
        &quot;reason&quot;: &quot;$string:approximately_location_reason&quot;,
        &quot;usedScene&quot;: { &quot;when&quot;: &quot;inuse&quot; }
      }
    ]
  }
}
</code></pre>
<hr>
<h2 id="AGC%20%E4%B8%8E%E7%BD%91%E7%BB%9C" name="AGC%20%E4%B8%8E%E7%BD%91%E7%BB%9C">AGC 与网络</h2>
<p>元服务访问网络需在 <strong>AGC 后台</strong>配置合法域名白名单：</p>
<ul>
<li><code>https://tdsdk.xdrig.com</code></li>
</ul>
<hr>
<h2 id="%E5%BF%AB%E9%80%9F%E6%8E%A5%E5%85%A5" name="%E5%BF%AB%E9%80%9F%E6%8E%A5%E5%85%A5">快速接入</h2>
<p>推荐调用顺序：<strong>init  → 用户同意隐私政策后 startA → 业务统计 API</strong>。</p>
<h3 id="1.%20%E5%88%9D%E5%A7%8B%E5%8C%96" name="1.%20%E5%88%9D%E5%A7%8B%E5%8C%96">1. 初始化</h3>
<p>在 UIAbility 的 <code>onCreate</code> 中调用 <code>init</code>（此阶段不上报数据）：</p>
<pre><code class="lang-typescript">import TalkingDataSDK from &#39;@talkingdata/analysis-atomic&#39;;
import { AbilityConstant, UIAbility, Want } from &#39;@kit.AbilityKit&#39;;

export default class EntryAbility extends UIAbility {
  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
    TalkingDataSDK.init(this.context, &#39;yourAppKey&#39;, &#39;yourChannelId&#39;, &#39;yourCustom&#39;);
  }
}
</code></pre>
<h3 id="2.%20%E5%90%AF%E5%8A%A8%E5%88%86%E6%9E%90" name="2.%20%E5%90%AF%E5%8A%A8%E5%88%86%E6%9E%90">2. 启动分析</h3>
<p>用户同意隐私政策后调用（例如首页 <code>onPageShow</code>）：</p>
<pre><code class="lang-typescript">TalkingDataSDK.startA();
</code></pre>
<h3 id="3.%20%E9%A1%B5%E9%9D%A2%E7%BB%9F%E8%AE%A1" name="3.%20%E9%A1%B5%E9%9D%A2%E7%BB%9F%E8%AE%A1">3. 页面统计</h3>
<pre><code class="lang-typescript">aboutToAppear(): void {
  TalkingDataSDK.pageEnter(&#39;HomePage&#39;);
}

aboutToDisappear(): void {
  TalkingDataSDK.pageLeave(&#39;HomePage&#39;);
}
</code></pre>
<hr>
<h2 id="%E9%87%87%E9%9B%86%E9%85%8D%E7%BD%AE" name="%E9%87%87%E9%9B%86%E9%85%8D%E7%BD%AE">采集配置</h2>
<p>元服务版默认<strong>不采集</strong>位置信息。若业务需要，请在 <code>startA</code> 之前开启采集开关，并在 <code>module.json5</code> 中声明、授权 <code>ohos.permission.APPROXIMATELY_LOCATION</code>： 。
其他可配置项包括AAID,屏幕分辨率，产品型号，系统版本。</p>
<pre><code class="lang-typescript">import TalkingDataSDK from &#39;@talkingdata/analysis-atomic&#39;;
import { TalkingDataSDKConfig } from &#39;@talkingdata/analysis-atomic&#39;;

const config = new TalkingDataSDKConfig();
config.setLocationEnabled(true)       // 采集位置（需在 module.json5 声明 ohos.permission.APPROXIMATELY_LOCATION）
  .setAAIDEnabled(false)               // 不采集 AAID
  .setPixelEnabled(false)              // 不采集屏幕分辨率
  .setModelEnabled(false)              // 不采集产品型号
  .setOSVersionEnabled(false);         // 不采集系统版本
TalkingDataSDK.setConfig(config);
</code></pre>
<p><code>startA()</code> 执行时，SDK 会检测位置权限是否已授予；已授予则采集最近一次位置，未授予则跳过。SDK <strong>不会主动申请</strong>位置权限。</p>
<hr>
<h2 id="%E8%AE%BE%E5%A4%87%E6%A0%87%E8%AF%86%E8%AF%B4%E6%98%8E" name="%E8%AE%BE%E5%A4%87%E6%A0%87%E8%AF%86%E8%AF%B4%E6%98%8E">设备标识说明</h2>
<ul>
<li>可通过 <code>TalkingDataSDK.getDeviceId()</code> 获取设备标识（在 <code>startA()</code> 之后调用）。</li>
<li>未声明 <code>STORE_PERSISTENT_DATA</code> 时，卸载重装后标识可能变化。</li>
<li>已声明并授权 <code>STORE_PERSISTENT_DATA</code> 时，卸载重装后标识<strong>尽量</strong>保持不变（受系统策略影响，不保证绝对不变）。</li>
</ul>
<hr>
<h2 id="%E6%8E%A8%E5%B9%BF%E5%BD%92%E5%9B%A0" name="%E6%8E%A8%E5%B9%BF%E5%BD%92%E5%9B%A0">推广归因</h2>
<h3 id="Deep%20Link" name="Deep%20Link">Deep Link</h3>
<p>通过 URI 唤起元服务时，将链接传给 SDK（在 <code>init</code> 之后调用）：</p>
<pre><code class="lang-typescript">TalkingDataSDK.onReceiveDeepLink(want.uri);
</code></pre>
<p>请在 <code>module.json5</code> 的 <code>skills</code> 中配置与业务一致的 URI Scheme / Host。</p>
<h3 id="TLink%EF%BC%88%E5%89%AA%E8%B4%B4%E6%9D%BF%E5%BB%B6%E8%BF%9F%E9%93%BE%E6%8E%A5%EF%BC%8C%E4%BB%85%20AdTracking%EF%BC%89" name="TLink%EF%BC%88%E5%89%AA%E8%B4%B4%E6%9D%BF%E5%BB%B6%E8%BF%9F%E9%93%BE%E6%8E%A5%EF%BC%8C%E4%BB%85%20AdTracking%EF%BC%89">TLink（剪贴板延迟链接，仅 AdTracking）</h3>
<p>TLink 用于读取剪贴板中以 <code>&gt;&gt;&gt;</code> 开头的推广口令并解密。<strong>元服务在宿主声明并授权 <code>ohos.permission.READ_PASTEBOARD</code> 后可正常使用</strong>；SDK 仅检测权限是否已授予，不会主动弹窗申请。</p>
<p><code>READ_PASTEBOARD</code> 为<strong>受限权限</strong>，除在 <code>module.json5</code> 中声明外，还须完成签名侧 ACL 配置，否则可能出现安装失败（如 <code>code:9568289 grant request permissions failed</code>）：</p>
<ol>
<li>登录 <a href="https://developer.huawei.com/consumer/cn/service/josp/agc/index.html">AppGallery Connect</a>，在应用下申请 <strong>读剪贴板</strong>（<code>ohos.permission.READ_PASTEBOARD</code>）使用权限。</li>
<li>在 DevEco Studio：<strong>File → Project Structure → Signing Configs</strong>，使用已关联 AGC 的 Profile；在 <strong>自动签名</strong> 或手动配置的 Profile 中，于 <strong>ACL 权限</strong>（受限权限列表）中<strong>勾选</strong> <code>ohos.permission.READ_PASTEBOARD</code>，使调试/发布包安装时系统可授予该权限。</li>
<li>重新 Sync 并打包安装后，再在宿主侧完成运行时授权（若系统要求）。</li>
</ol>
<p>建议在应用启动、且用户同意隐私政策后调用：</p>
<pre><code class="lang-typescript">const tlinkContent: string = TalkingDataSDK.getDeferredLink();
if (tlinkContent &amp;&amp; tlinkContent.length &gt; 0) {
  // 根据 tlinkContent 做页面个性化或归因
}
</code></pre>
<p>未声明、未在 ACL 中配置签名，或未授权读剪贴板权限时，接口返回空字符串。</p>
<p><strong>注意：</strong> 读剪贴板属于敏感能力，请与产品、法务确认后在《隐私政策》中告知用户，并确保业务场景合规。</p>
<hr>
<h2 id="%E7%BB%9F%E8%AE%A1%E6%8C%87%E6%A0%87%E8%AF%B4%E6%98%8E" name="%E7%BB%9F%E8%AE%A1%E6%8C%87%E6%A0%87%E8%AF%B4%E6%98%8E">统计指标说明</h2>
<p>根据各行业场景，TalkingData SDK 提供行业通用事件、行业专属事件、页面事件与自定义事件体系。</p>
<ul>
<li><strong>用户</strong>：数据系统中的「用户」指一台唯一设备。</li>
<li><strong>激活用户</strong>：下载、安装并首次启动应用成功的用户（元服务场景下为首次打开元服务）。</li>
<li><strong>行业通用事件</strong>：唤醒、注册、登录、收藏、分享、签到等。</li>
<li><strong>行业专属事件</strong>：查看商品、通关、课程学习、授信交易等。</li>
<li><strong>自定义事件</strong>：任意需跟踪的用户行为（按钮点击、步骤完成等）。</li>
</ul>
<hr>
<h2 id="API%20%E5%8F%82%E8%80%83" name="API%20%E5%8F%82%E8%80%83">API 参考</h2>
<blockquote>
<p>以下接口均通过 <code>@talkingdata/analysis-atomic</code> 导出。示例中若未写 <code>import</code>，请自行添加：</p>
<pre><code class="lang-typescript">import TalkingDataSDK from &#39;@talkingdata/analysis-atomic&#39;;
import { TalkingDataSDKConfig, TalkingDataProfile, TalkingDataProfileType,
  TalkingDataProfileGender, TalkingDataOrder, TalkingDataShoppingCart,
  TalkingDataTransaction } from &#39;@talkingdata/analysis-atomic&#39;;
</code></pre>
</blockquote>
<h3 id="SDK%20%E5%88%9D%E5%A7%8B%E5%8C%96" name="SDK%20%E5%88%9D%E5%A7%8B%E5%8C%96">SDK 初始化</h3>
<p><strong>说明</strong>：仅完成 SDK 初始化，不进行敏感信息采集与上报。</p>
<pre><code class="lang-typescript">TalkingDataSDK.init(context: Context, appKey: string, channelId: string, custom?: string);
</code></pre>
<pre><code class="lang-typescript">export default class EntryAbility extends UIAbility {
  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
    TalkingDataSDK.init(this.context, &#39;yourAppKey&#39;, &#39;yourChannelId&#39;, &#39;yourCustom&#39;);
    if (want.uri) {
      TalkingDataSDK.onReceiveDeepLink(want.uri);
    }
  }
}
</code></pre>
<h3 id="%E5%90%AF%E5%8A%A8%E5%88%86%E6%9E%90%20startA" name="%E5%90%AF%E5%8A%A8%E5%88%86%E6%9E%90%20startA">启动分析 startA</h3>
<p><strong>说明</strong>：须在 <code>init</code> 之后、且用户同意隐私政策后调用；调用后 SDK 开始合规的基础信息采集与上报，其他统计 API 方可正常使用。</p>
<pre><code class="lang-typescript">TalkingDataSDK.startA();
</code></pre>
<pre><code class="lang-typescript">onPageShow(): void {
  TalkingDataSDK.startA();
}
</code></pre>
<h3 id="%E8%8E%B7%E5%8F%96%E8%AE%BE%E5%A4%87%20ID" name="%E8%8E%B7%E5%8F%96%E8%AE%BE%E5%A4%87%20ID">获取设备 ID</h3>
<pre><code class="lang-typescript">const deviceId: string = TalkingDataSDK.getDeviceId();
</code></pre>
<hr>
<h3 id="%E9%A1%B5%E9%9D%A2%E5%88%86%E6%9E%90%20-%20%E9%A1%B5%E9%9D%A2%E8%BF%9B%E5%85%A5" name="%E9%A1%B5%E9%9D%A2%E5%88%86%E6%9E%90%20-%20%E9%A1%B5%E9%9D%A2%E8%BF%9B%E5%85%A5">页面分析 - 页面进入</h3>
<p><strong>接口说明</strong>
在进入页面时，调用此接口，用于统计页面访问事件。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">
TalkingDataSDK.pageEnter(pageName:string);
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">//在调用SDK的init和startA之后才可以调用SDK的页面事件相关方法
onPageShow(): void {
  TalkingDataSDK.pageEnter(&quot;首页&quot;)
}
</code></pre>
<h3 id="%E9%A1%B5%E9%9D%A2%E5%88%86%E6%9E%90%20-%20%E9%A1%B5%E9%9D%A2%E7%A6%BB%E5%BC%80" name="%E9%A1%B5%E9%9D%A2%E5%88%86%E6%9E%90%20-%20%E9%A1%B5%E9%9D%A2%E7%A6%BB%E5%BC%80">页面分析 - 页面离开</h3>
<p><strong>接口说明</strong>
在离开页面时，调用此接口，用于统计页面访问事件。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.pageLeave(pageName:string);
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">onPageHide(): void {
    this.log(&quot;首页退到后台&quot;);
    TalkingDataSDK.pageLeave(&quot;首页&quot;);
}
</code></pre>
<h3 id="%E8%87%AA%E5%AE%9A%E4%B9%89%E4%BA%8B%E4%BB%B6" name="%E8%87%AA%E5%AE%9A%E4%B9%89%E4%BA%8B%E4%BB%B6">自定义事件</h3>
<p><strong>接口说明</strong>
自定义事件用于追踪任何需要了解的用户行为，如：用户点击某功能按钮、填写某个输入框、触发了某个广告等。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onEvent(id: string, params?: Map&lt;string, string | number&gt;, value?: Map&lt;string, number&gt;)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">
    //仅事件id
    TalkingDataSDK.onEvent(&quot;AAAA&quot;);
    //事件id及参数
    let params:Map&lt;string,string|number&gt; = new Map();
    params.set(&quot;key1&quot;,&quot;val1&quot;);
    params.set(&quot;key2&quot;,&quot;val2&quot;);
    TalkingDataSDK.onEvent(&quot;BBBB&quot;,params);
    //事件id，参数及eventValue
    let params:Map&lt;string,string|number&gt; = new Map();
    params.set(&quot;key1&quot;,&quot;val1&quot;);
    params.set(&quot;key2&quot;,&quot;val2&quot;);
    let vmap:Map&lt;string,number&gt; = new Map();
    vmap.set(&quot;vkey1&quot;,1);
    vmap.set(&quot;vkey2&quot;,2.2);
    TalkingDataSDK.onEvent(&quot;CCCC&quot;,params,vmap);
</code></pre>
<h2 id="%E9%80%9A%E7%94%A8-%E6%B3%A8%E5%86%8C" name="%E9%80%9A%E7%94%A8-%E6%B3%A8%E5%86%8C">通用-注册</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>注册接口用于记录用户在使用应用过程中的注册行为，在注册成功时调用 TalkingDataSDK 的 <code>onRegister</code> 接口。</p>
<p>若应用具备“老用户邀请新用户注册”功能，可在此接口中传入注册邀请码 <code>invitationCode</code> ，TalkingData SDK 将基于此进行“受邀注册”的指标统计。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onRegister(profileId:string,
                            profile:TalkingDataProfile|null,
                            invitationCode:string|null,
                            eventValue:Map&lt;string,string|number&gt;|null);
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">import TalkingDataSDK from &#39;@talkingdata/analysis-atomic&#39;;
import { TalkingDataProfile,TalkingDataProfileGender,TalkingDataProfileType } from &#39;@talkingdata/analysis-atomic&#39;;
...

let profile = TalkingDataProfile.create()
              .setName(&quot;testName&quot;)
              .setType(TalkingDataProfileType.REGISTERED)
              .setGender(TalkingDataProfileGender.MALE)
              .setProperty1(&quot;propertyValue1&quot;);

let ev:Map&lt;string,string|number&gt; = new Map();
    ev.set(&quot;evKey&quot;,&quot;evv1&quot;);
    ev.set(&quot;evKey2&quot;,2.2);

TalkingDataSDK.onRegister(&quot;testAccountId&quot;,profile,&quot;1212&quot;,ev);
</code></pre>
<h2 id="%E9%80%9A%E7%94%A8-%E7%99%BB%E5%BD%95" name="%E9%80%9A%E7%94%A8-%E7%99%BB%E5%BD%95">通用-登录</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>登录接口用于记录用户在使用应用过程中的登录行为，在登录成功时调用 TalkingDataSDK 的 <code>onLogin</code> 接口。</p>
<p>常用的调用登录接口的时机如下：</p>
<p>● 用户注册后自动登录，这时候可以按顺序调用注册和登录两个接口。<br>● 用户登录信息过期，手动发起并完成登录操作，此时调用登录接口。<br>● 用户登录信息未过期，每次启动应用时App自动判断为已登录状态，开发者按需调用登录接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">
TalkingDataSDK.onLogin(profileId:string,
                      profile:TalkingDataProfile|null,
                      eventValue:Map&lt;string,string|number&gt;|null)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript"> let params:Map&lt;string,string|number&gt; = new Map();
    params.set(&quot;key1&quot;,&quot;val1&quot;);
    params.set(&quot;key2&quot;,2);
    TalkingDataSDK.onLogin(&quot;testAccountId&quot;,null,params);
</code></pre>
<h2 id="%E9%80%9A%E7%94%A8-%E6%9B%B4%E6%96%B0%E8%B4%A6%E6%88%B7%E4%BF%A1%E6%81%AF" name="%E9%80%9A%E7%94%A8-%E6%9B%B4%E6%96%B0%E8%B4%A6%E6%88%B7%E4%BF%A1%E6%81%AF">通用-更新账户信息</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户账户属性发生变更时调用TalkingDataSDK的<code>onProfileUpdate</code>接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onProfileUpdate(profile:TalkingDataProfile)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">import TalkingDataSDK from &#39;@talkingdata/analysis-atomic&#39;;
import { TalkingDataProfile,TalkingDataProfileGender, TalkingDataProfileType } from &#39;@talkingdata/analysis-atomic&#39;;
....
    let profile = TalkingDataProfile.create()
      .setName(&quot;testName2&quot;)
      .setType(TalkingDataProfileType.REGISTERED)
      .setGender(TalkingDataProfileGender.MALE)
      .setProperty2(&quot;propertyValue2&quot;);

    TalkingDataSDK.onProfileUpdate(profile);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E6%9F%A5%E7%9C%8B%E5%95%86%E5%93%81%E4%BF%A1%E6%81%AF" name="%E4%B8%93%E5%B1%9E-%E6%9F%A5%E7%9C%8B%E5%95%86%E5%93%81%E4%BF%A1%E6%81%AF">专属-查看商品信息</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户浏览一个商品详情时调用 TalkingDataSDK 的 onViewItem 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onViewItem(itemId:string|null,
                            category:string|null,
                            name:string|null,
                            unitPrice:number|null,
                            eventValue?:Map&lt;string,string|number&gt;|null)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript"> TalkingDataSDK.onViewItem(&quot;itemId&quot;, &quot;电器&quot;, &quot;电扇&quot;, 500);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E6%B7%BB%E5%8A%A0%E5%88%B0%E8%B4%AD%E7%89%A9%E8%BD%A6" name="%E4%B8%93%E5%B1%9E-%E6%B7%BB%E5%8A%A0%E5%88%B0%E8%B4%AD%E7%89%A9%E8%BD%A6">专属-添加到购物车</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户添加一个商品到购物车时调用 TalkingDataSDK 的 onAddItemToShoppingCart 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onAddItemToShoppingCart(itemId:string|null,
                                        category:string|null,
                                        name:string|null,
                                        unitPrice:number|null,
                                        amount:number|null,
                                        eventValue?:Map&lt;string,string|number&gt;|null)
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E6%9F%A5%E7%9C%8B%E8%B4%AD%E7%89%A9%E8%BD%A6" name="%E4%B8%93%E5%B1%9E-%E6%9F%A5%E7%9C%8B%E8%B4%AD%E7%89%A9%E8%BD%A6">专属-查看购物车</h2>
<p>由3个接口组成</p>
<p>● 创建购物车</p>
<p>● 添加购物车详情</p>
<p>● 查看购物车详情</p>
<h3 id="%E5%88%9B%E5%BB%BA%E8%B4%AD%E7%89%A9%E8%BD%A6" name="%E5%88%9B%E5%BB%BA%E8%B4%AD%E7%89%A9%E8%BD%A6">创建购物车</h3>
<h4 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h4>
<p>在调用 onViewShoppingCart 接口前创建购物车信息，调用 TalkingDataShoppingCart 的 createShoppingCart 接口。</p>
<h4 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h4>
<pre><code class="lang-typescript"> const shopCart = TalkingDataShoppingCart.create();
</code></pre>
<h3 id="%E6%B7%BB%E5%8A%A0%E8%B4%AD%E7%89%A9%E8%BD%A6" name="%E6%B7%BB%E5%8A%A0%E8%B4%AD%E7%89%A9%E8%BD%A6">添加购物车</h3>
<h4 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h4>
<p>创建购物车信息后添加商品信息时调用TalkingDataShoppingCart 的 addItem 接口。</p>
<h4 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h4>
<pre><code class="lang-typescript"> shopCart.addItem(&quot;itemId&quot;, &quot;电器&quot;, &quot;电扇&quot;, 500, 1)
</code></pre>
<h3 id="%E6%9F%A5%E7%9C%8B%E8%B4%AD%E7%89%A9%E8%BD%A6%E8%AF%A6%E6%83%85" name="%E6%9F%A5%E7%9C%8B%E8%B4%AD%E7%89%A9%E8%BD%A6%E8%AF%A6%E6%83%85">查看购物车详情</h3>
<h4 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h4>
<p>在用户浏览购物车内所有商品时调用 TalkingDataSDK 的 onViewShoppingCart 接口。</p>
<h4 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h4>
<pre><code class="lang-typescript">
TalkingDataSDK.onViewShoppingCart( shoppingCart:TalkingDataShoppingCart)
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E4%B8%8B%E8%AE%A2%E5%8D%95" name="%E4%B8%93%E5%B1%9E-%E4%B8%8B%E8%AE%A2%E5%8D%95">专属-下订单</h2>
<p>由3个接口组成:</p>
<p>● 创建订单</p>
<p>● 添加订单详情</p>
<p>● 下订单</p>
<h3 id="%E5%88%9B%E5%BB%BA%E8%AE%A2%E5%8D%95" name="%E5%88%9B%E5%BB%BA%E8%AE%A2%E5%8D%95">创建订单</h3>
<h4 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h4>
<p>在调用 onPlaceOrder 接口前创建订单，调用 TalkingDataOrder 的 createOrder 接口。</p>
<h4 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h4>
<pre><code class="lang-typescript">const order = TalkingDataOrder.create(&quot;order_id_test&quot;, 1000, &quot;CNY&quot;)
</code></pre>
<h3 id="%E6%B7%BB%E5%8A%A0%E8%AE%A2%E5%8D%95%E8%AF%A6%E6%83%85" name="%E6%B7%BB%E5%8A%A0%E8%AE%A2%E5%8D%95%E8%AF%A6%E6%83%85">添加订单详情</h3>
<h4 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h4>
<p>创建订单后添加商品信息时调用 TalkingDataOrder 的 addItem 接口。</p>
<h4 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h4>
<pre><code class="lang-typescript"> order.addItem(&quot;testItemId&quot;,&quot;电扇&quot;,&quot;电器&quot;,500,1);
</code></pre>
<h3 id="%E4%B8%8B%E8%AE%A2%E5%8D%95" name="%E4%B8%8B%E8%AE%A2%E5%8D%95">下订单</h3>
<h4 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h4>
<p>在用户下订单时调用 TalkingDataSDK 的 onPlaceOrder 接口。</p>
<h4 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h4>
<pre><code class="lang-typescript">TalkingDataSDK.onPlaceOrder2(order);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E6%94%AF%E4%BB%98%E8%AE%A2%E5%8D%95" name="%E4%B8%93%E5%B1%9E-%E6%94%AF%E4%BB%98%E8%AE%A2%E5%8D%95">专属-支付订单</h2>
<p>由2个接口组成:</p>
<p>● 创建订单</p>
<p>● 支付订单</p>
<h3 id="%E5%88%9B%E5%BB%BA%E8%AE%A2%E5%8D%95" name="%E5%88%9B%E5%BB%BA%E8%AE%A2%E5%8D%95">创建订单</h3>
<p>详见 <code>下订单</code>部分的<code>创建订单</code>说明.</p>
<h3 id="%E6%94%AF%E4%BB%98%E8%AE%A2%E5%8D%95" name="%E6%94%AF%E4%BB%98%E8%AE%A2%E5%8D%95">支付订单</h3>
<h4 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h4>
<p>在用户付费成功的时候调用 TalkingDataSDK 的 onOrderPaySucc 接口。</p>
<h4 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h4>
<pre><code class="lang-typescript">TalkingDataSDK.onOrderPaySucc2(order:TalkingDataOrder,paymentType:string|null)
</code></pre>
<h4 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h4>
<pre><code class="lang-typescript">    import TalkingDataSDK from &#39;@talkingdata/analysis-atomic&#39;;
    import {TalkingDataOrder } from &#39;@talkingdata/analysis-atomic&#39;;

      const order = TalkingDataOrder.create(&quot;order_id_test&quot;, 1000, &quot;CNY&quot;)
      order.profileId=&quot;testAccount&quot;;
      order.addItem(&quot;testItemId&quot;,&quot;电扇&quot;,&quot;电器&quot;,500,1);
      TalkingDataSDK.onOrderPaySucc2(order,&quot;Alipay&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E5%8F%96%E6%B6%88%E8%AE%A2%E5%8D%95" name="%E4%B8%93%E5%B1%9E-%E5%8F%96%E6%B6%88%E8%AE%A2%E5%8D%95">专属-取消订单</h2>
<p>由2个接口组成：</p>
<p>● 创建订单</p>
<p>● 取消订单</p>
<h3 id="%E5%88%9B%E5%BB%BA%E8%AE%A2%E5%8D%95" name="%E5%88%9B%E5%BB%BA%E8%AE%A2%E5%8D%95">创建订单</h3>
<p>参见<code>下订单</code>部分的<code>创建订单</code>.</p>
<h3 id="%E5%8F%96%E6%B6%88%E8%AE%A2%E5%8D%95" name="%E5%8F%96%E6%B6%88%E8%AE%A2%E5%8D%95">取消订单</h3>
<h4 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h4>
<pre><code class="lang-typescript">TalkingDataSDK.onCancelOrder2(order:TalkingDataOrder)
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E5%88%9B%E5%BB%BA%E8%A7%92%E8%89%B2" name="%E4%B8%93%E5%B1%9E-%E5%88%9B%E5%BB%BA%E8%A7%92%E8%89%B2">专属-创建角色</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户创建角色时调用 TalkingDataSDK 的 onCreateRole 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onCreateRole(roleName:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript"> TalkingDataSDK.onCreateRole(&quot;danceMonkey&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E9%80%9A%E8%BF%87%E5%85%B3%E5%8D%A1" name="%E4%B8%93%E5%B1%9E-%E9%80%9A%E8%BF%87%E5%85%B3%E5%8D%A1">专属-通过关卡</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户通过设定的关卡时调用 TalkingDataSDK 的 onLevelPass 接口</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onLevelPass(profileId?:string,levelId?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">     TalkingDataSDK.onLevelPass(&quot;testAccountId&quot;, &quot;fresher&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E5%AE%8C%E6%88%90%E6%96%B0%E6%89%8B%E6%95%99%E7%A8%8B" name="%E4%B8%93%E5%B1%9E-%E5%AE%8C%E6%88%90%E6%96%B0%E6%89%8B%E6%95%99%E7%A8%8B">专属-完成新手教程</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户完成了新手教程时调用 TalkingDataSDK 的 onGuideFinished 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript"> TalkingDataSDK.onGuideFinished(profileId?:string,content?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">     TalkingDataSDK.onGuideFinished(&quot;testAccountId&quot;, &quot;新手教程结束&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E8%A7%A3%E9%94%81%E6%88%90%E5%B0%B1" name="%E4%B8%93%E5%B1%9E-%E8%A7%A3%E9%94%81%E6%88%90%E5%B0%B1">专属-解锁成就</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户解锁成就时调用 TalkingDataSDK 的 onAchievementUnlock 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onAchievementUnlock(profileId?:string,achievementId?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript"> TalkingDataSDK.onAchievementUnlock(&quot;testAccountId&quot;, &quot;level-2&quot;);
</code></pre>
<h2 id="%E9%80%9A%E7%94%A8-%E5%94%A4%E9%86%92%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E9%80%9A%E7%94%A8-%E5%94%A4%E9%86%92%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">通用-唤醒（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户通过Deep Link唤起应用的时候调用 TalkingDataSDK 的 onReceiveDeepLink 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onReceiveDeepLink(link?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">
TalkingDataSDK.onReceiveDeepLink(&quot;https://www.talkingdata.com/path?param=a&quot;)
</code></pre>
<h2 id="%E9%80%9A%E7%94%A8-%E6%94%B6%E8%97%8F%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E9%80%9A%E7%94%A8-%E6%94%B6%E8%97%8F%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">通用-收藏（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户进行收藏行为并完成收藏事件时调用 TalkingDataSDK 的 onFavorite 接口。  </p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onFavorite(category?:string,content?:string,eventValue?:Map&lt;string,string|number&gt;)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">let eventValue:Map&lt;string,string|number&gt; = new Map();
eventValue.set(&quot;key01&quot;,&quot;value01&quot;);
eventValue.set(&quot;key02&quot;,0.1);
TalkingDataSDK.onFavorite(&quot;服装&quot;,&quot;2025新款&quot;,eventValue)
</code></pre>
<h2 id="%E9%80%9A%E7%94%A8-%E5%88%86%E4%BA%AB%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E9%80%9A%E7%94%A8-%E5%88%86%E4%BA%AB%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">通用-分享（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户进行分享事件时调用 TalkingDataSDK 的 onShare 接口。  </p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">
TalkingDataSDK.onShare(profileId?:string,content?:string,eventValue?:Map&lt;string,string|number&gt;)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">
let eventValue:Map&lt;string,string|number&gt; = new Map();
eventValue.set(&quot;key01&quot;,&quot;value01&quot;);
eventValue.set(&quot;key02&quot;,0.1);
TalkingDataSDK.onShare(&quot;test-001&quot;,&quot;课程&quot;, eventValue);
</code></pre>
<h2 id="%E9%80%9A%E7%94%A8-%E7%AD%BE%E5%88%B0%E6%89%93%E5%8D%A1%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E9%80%9A%E7%94%A8-%E7%AD%BE%E5%88%B0%E6%89%93%E5%8D%A1%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">通用-签到打卡（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户账号进行签到打卡行为时调用 TalkingDataSDK 的 onPunch 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onPunch(profileId?:string,punchId?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onPunch(&quot;test-001&quot;,&quot;签到001&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E8%81%94%E7%B3%BB%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E8%81%94%E7%B3%BB%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-联系（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户联系商家或平台的时候调用 TalkingDataSDK 的 onContact 接口。  </p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onContact(profileId?:string,content?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">
TalkingDataSDK.onContact(&quot;user001&quot;, &quot;联系平台内容&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E4%BB%98%E8%B4%B9%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E4%BB%98%E8%B4%B9%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-付费（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户付费成功的时候调用 TalkingDataSDK 的 onPay 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onPay(profileId:string|null,orderId:string,amount:number,currencyType:string,payment?:string,
paymentType?:string,itemId?:string,itemCount?:number)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onPay(&quot;user001&quot;, &quot;20210101&quot;, 
    8888, &quot;CNY&quot;, &quot;AliPay&quot;, &quot;computer001&quot;,&quot;item101&quot;, 100);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E9%80%80%E5%8D%95%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E9%80%80%E5%8D%95%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-退单（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户退单的时候调用 TalkingDataSDK 的 onChargeBack 接口。  </p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onChargeBack(profileId?:string,orderId?:string,reason?:string,type?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onChargeBack(&quot;user001&quot;, &quot;order01&quot;, &quot;7天无理由退货&quot;, &quot;仅退款&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E9%A2%84%E7%BA%A6%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E9%A2%84%E7%BA%A6%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-预约（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户进行预约行为时调用 TalkingDataSDK 的 onReservation 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onReservation(profileId?:string,reservationId?:string,category?:string, amount?:number,term?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onReservation(&quot;user001&quot;, &quot;td_123456&quot;, &quot;借贷类&quot;, 12, &quot;商品信息&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E9%A2%84%E8%AE%A2%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E9%A2%84%E8%AE%A2%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-预订（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户进行预订行为时调用 TalkingDataSDK 的 onBooking 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onBooking(profileId?:string,bookingId?:string,category?:string, amount?:number,content?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onBooking(&quot;user001&quot;, &quot;002391&quot;, &quot;电子&quot;, 12300, &quot;商品&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E6%8E%88%E4%BF%A1%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E6%8E%88%E4%BF%A1%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-授信（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户完成授信时调用 TalkingDataSDK 的 onCredit 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onCredit(profileId?:string,amount?:number,content?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">
TalkingDataSDK.onCredit(&quot;user001&quot;, 123456, &quot;授信详情为……&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E4%BA%A4%E6%98%93%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E4%BA%A4%E6%98%93%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-交易（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户进行交易时调用 TalkingDataSDK 的 onTransaction 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onTransaction(profileId:string|null|undefined,talkingDataTransaction:TalkingDataTransaction)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript"> let tdTransaction :TalkingDataTransaction= TalkingDataTransaction.create();
tdTransaction.setTransactionId(&quot;td_123456&quot;)
.setCategory(&quot;定期&quot;)
.setAmount(3222)
.setPersonA(&quot;张三&quot;)
.setPersonB(&quot;金融平台&quot;)
.setStartDate(1565176907309)
.setEndDate(1565176908309)
.setCurrencyType(&quot;CNY&quot;);

TalkingDataSDK.onTransaction(&quot;user01&quot;,tdTransaction);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E8%AF%BE%E7%A8%8B%E5%AD%A6%E4%B9%A0%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E8%AF%BE%E7%A8%8B%E5%AD%A6%E4%B9%A0%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-课程学习（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户进行课程学习的时候调用 TalkingDataSDK 的 onLearn 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onLearn(profileId?:string,course?:string,begin?:number,duration?:number)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onLearn(&quot;user01&quot;,&quot;成人教育第一节&quot;,1501234567890,20);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E5%AE%8C%E6%88%90%E8%AF%BE%E7%A8%8B%E8%AF%95%E5%90%AC%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E5%AE%8C%E6%88%90%E8%AF%BE%E7%A8%8B%E8%AF%95%E5%90%AC%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-完成课程试听（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户完成课程试听时调用 TalkingDataSDK 的 onPreviewFinished 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onPreviewFinished(profileId?:string,content?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">
TalkingDataSDK.onPreviewFinished(&quot;user01&quot;, &quot;基础课程试听结束&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E6%96%87%E7%AB%A0%E9%98%85%E8%AF%BB%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E6%96%87%E7%AB%A0%E9%98%85%E8%AF%BB%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-文章阅读（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户进行文章阅读的时候调用 TalkingDataSDK 的 onRead 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onRead(profileId?:string,book?:string, begin?:number,duration?:number)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">
TalkingDataSDK.onRead(&quot;user01&quot;, &quot;西游记第一章&quot;, 1501234567890, 20);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E5%AE%8C%E6%88%90%E5%85%8D%E8%B4%B9%E9%98%85%E8%AF%BB%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E5%AE%8C%E6%88%90%E5%85%8D%E8%B4%B9%E9%98%85%E8%AF%BB%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-完成免费阅读（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户完成免费阅读时调用 TalkingDataSDK 的 onFreeFinished 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onFreeFinished(profileId?:string,content?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onFreeFinished(&quot;user01&quot;, &quot;免费章节阅读结束&quot;);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E6%B5%8F%E8%A7%88%E8%AF%A6%E6%83%85%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E6%B5%8F%E8%A7%88%E8%AF%A6%E6%83%85%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-浏览详情（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户进行浏览详情时调用 TalkingDataSDK 的 onBrowse 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onBrowse(profileId?:string,content?:string,begin?:number,duration?:number)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onBrowse(&quot;user01&quot;, &quot;详情页page1&quot;, 1501234567890, 20);
</code></pre>
<h2 id="%E4%B8%93%E5%B1%9E-%E5%AE%8C%E6%88%90%E8%AF%95%E7%94%A8%E4%BD%93%E9%AA%8C%EF%BC%88%E4%BB%85AdTracking%EF%BC%89" name="%E4%B8%93%E5%B1%9E-%E5%AE%8C%E6%88%90%E8%AF%95%E7%94%A8%E4%BD%93%E9%AA%8C%EF%BC%88%E4%BB%85AdTracking%EF%BC%89">专属-完成试用体验（仅AdTracking）</h2>
<h3 id="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E" name="%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E">接口说明</h3>
<p>在用户完成了试用体验时调用 TalkingDataSDK 的 onTrialFinished 接口。</p>
<h3 id="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89" name="%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89">接口定义</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onTrialFinished(profileId?:string,content?:string)
</code></pre>
<h3 id="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81" name="%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81">示例代码</h3>
<pre><code class="lang-typescript">TalkingDataSDK.onTrialFinished(&quot;user01&quot;, &quot;试用体验结束&quot;);
</code></pre>
<h3 id="TLink%20-%20getDeferredLink%EF%BC%88%E4%BB%85%20AdTracking%EF%BC%89" name="TLink%20-%20getDeferredLink%EF%BC%88%E4%BB%85%20AdTracking%EF%BC%89">TLink - getDeferredLink（仅 AdTracking）</h3>
<p><strong>接口说明</strong></p>
<p>获取推广活动经剪贴板传递的个性化内容（TLink）。建议在应用启动时调用；须已 <code>init</code>，且建议在用户同意隐私政策后调用。</p>
<p>宿主须在 <code>module.json5</code> 中声明 <code>ohos.permission.READ_PASTEBOARD</code>，在 AGC 申请该权限并在签名 Profile 的 <strong>ACL 权限</strong> 中勾选后完成授权，否则返回空字符串（未配置 ACL 时还可能无法安装元服务包）。SDK 不会主动申请该权限。详见上文 <a href="#tlink剪贴板延迟链接仅-adtracking">TLink（剪贴板延迟链接，仅 AdTracking）</a>。</p>
<p><strong>接口定义</strong></p>
<pre><code class="lang-typescript">TalkingDataSDK.getDeferredLink(): string;
</code></pre>
<p><strong>示例代码</strong></p>
<pre><code class="lang-typescript">const tlinkContent: string = TalkingDataSDK.getDeferredLink();
</code></pre>
<hr>
]]></content:encoded>
      <pubDate>Thu, 04 Jun 2026 13:45:43 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1244</guid>
      <comments>http://doc.talkingdata.com/posts/1244#comments</comments>
    </item>
    <item>
      <title>TD云牍42/GLM-5.1</title>
      <link>http://doc.talkingdata.com/posts/1243</link>
      <category>文本生成 API</category>
      <author>liuxinmei</author>
      <description>云牍42 接口说明文档 TD模型编号：T0303007 模型能力简介 云牍42 是一款旗舰级MoE架构大语言模型，在代码生成、长程任务执行等复杂场景具备卓越能力。它在保持高精度推理的同时实现极速响应。适用于AI编程、实时Agent应用、商业决策分析等对智能能力和低延迟均有高要求的核心业务场景。 鉴权说明  本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
 AIGC生文接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions 请求头（Request Headers）： 头部字段 值 是否必填 说明 Authorization Bea</description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%89%8D42%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%89%8D42%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云牍42 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0303007</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云牍42</strong><ul>
<li>是一款旗舰级MoE架构大语言模型，在代码生成、长程任务执行等复杂场景具备卓越能力。它在保持高精度推理的同时实现极速响应。适用于AI编程、实时Agent应用、商业决策分析等对智能能力和低延迟均有高要求的核心业务场景。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="AIGC%E7%94%9F%E6%96%87%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">AIGC生文接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">AIGC生文请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">AIGC生文请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0303007</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><code>messages</code></td>
<td style="text-align:left">List<Object></td>
<td style="text-align:left">是</td>
<td style="text-align:left">对话消息列表，用于提供上下文和当前问题。详见下方 <code>messages</code> 对象结构。</td>
</tr>
<tr>
<td style="text-align:left"><code>stream</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否使用流式响应。默认为 <code>false</code>（非流式）。</td>
</tr>
<tr>
<td style="text-align:left"><code>thinking_enabled</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否开启推理（思考）模式。 - <code>true</code>: 模型在回答前会进行深度链式思考（CoT），适合复杂的逻辑分析、数学计算或代码生成任务。开启后响应延迟会增加，并在usage中产生<code>reasoning_tokens</code>。 - <code>false</code>: 标准对话模式，响应速度更快。 <strong>注意：</strong> 开启后，usage中的<code>reasoning_tokens</code>将会产生消耗。</td>
</tr>
<tr>
<td style="text-align:left"><code>temperature</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制输出的随机性和创造性。 - 取值范围通常为 0~2，默认值为 0.7。 - 值越接近0：输出越精准、确定，适合事实性问答、代码生成等场景。 - 值越接近2：输出越发散、富有创意，适合文案创作、头脑风暴等场景。</td>
</tr>
<tr>
<td style="text-align:left"><code>max_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制单次请求的最大生成令牌（Token）数量，<strong>包含输入和输出的总Token</strong>。 - 需结合所选模型的最大Token限制设置，超出会触发截断或报错。 - 合理设置可避免生成过长内容，控制请求成本与响应速度。</td>
</tr>
<tr>
<td style="text-align:left"><code>reasoning_effort</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">思考等级。取值范围：<code>none</code> / <code>minimal</code> / <code>low</code> / <code>medium</code> / <code>high</code> / <code>xhigh</code>。 <strong>注意：</strong> 同时配置<code>thinking_enabled</code>时，以<code>reasoning_effort</code>为基准。</td>
</tr>
<tr>
<td style="text-align:left"><code>tools</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具列表，详细参考 OpenAI 文档。<strong>该模型只支持 function 工具。</strong></td>
</tr>
<tr>
<td style="text-align:left"><code>tool_choice</code></td>
<td style="text-align:left">String / Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具选项，详细参考 OpenAI 文档。</td>
</tr>
<tr>
<td style="text-align:left"><code>response_format</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">格式化输出，详细参考 OpenAI 文档。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Emessages%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%9A" name="%3Ccode%3Emessages%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%9A"><code>messages</code> 结构：</h4>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">消息发送者的角色。常见值： - <code>system</code>: 系统指令（设定AI的人设） - <code>user</code>: 用户（提问者） - <code>assistant</code>: AI助手（之前的回答历史） - <code>tool</code>: 用户的工具（输入模型需要工具的结果）</td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String / Array Of Part</td>
<td style="text-align:left">String类型时，消息的具体文本内容。 Array类型时参考下方 <code>Part</code> 对象结构。 role为<code>tool</code>时，用户工具的输出结果。</td>
</tr>
<tr>
<td style="text-align:left"><code>tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">role为<code>assistant</code>时，工具使用过程中模型返回的需要调用的工具和输出参数，详情参考 OpenAI 协议。</td>
</tr>
<tr>
<td style="text-align:left"><code>tool_call_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">role为<code>tool</code>时，模型需要调用工具的id，在响应包中<code>tool_calls</code>信息中。</td>
</tr>
<tr>
<td style="text-align:left"><code>extra_content</code></td>
<td style="text-align:left">ExtraContent</td>
<td style="text-align:left">role为<code>assistant</code>时，可能有思考签名。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Econtent%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%88%E5%BD%93%20content%20%E4%B8%BA%20Array%20Of%20Part%E7%B1%BB%E5%9E%8B%E6%97%B6%EF%BC%89%EF%BC%9A" name="%3Ccode%3Econtent%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%88%E5%BD%93%20content%20%E4%B8%BA%20Array%20Of%20Part%E7%B1%BB%E5%9E%8B%E6%97%B6%EF%BC%89%EF%BC%9A"><code>content</code> 结构（当 content 为 Array Of Part类型时）：</h4>
<table>
<thead>
<tr>
<th><strong>字段名</strong></th>
<th><strong>类型</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>type</code></td>
<td>String</td>
<td>数据类型。常见值：- text: 文本- image_url: 图片url- input_audio: 音频数据，需填写- file: 文件,需填写file_url,可选填file_name。</td>
</tr>
<tr>
<td><code>text</code></td>
<td>String</td>
<td>消息的具体文本内容。type为text时，必填。</td>
</tr>
<tr>
<td><code>image_url</code></td>
<td>String</td>
<td>图片的url(支持data url scheme)。type为image_url时，必填。（大小限制在70MB以内）</td>
</tr>
<tr>
<td><code>input_audio</code></td>
<td>Object</td>
<td>音频数据。type为input_audio时，必填。</td>
</tr>
<tr>
<td>└ <code>data</code></td>
<td>String</td>
<td>音频数据的Base64编码。</td>
</tr>
<tr>
<td>└ <code>format</code></td>
<td>String</td>
<td>音频格式。当前只支持mp3/wav。</td>
</tr>
<tr>
<td><code>file_name</code></td>
<td>String</td>
<td>文件/视频名。</td>
</tr>
<tr>
<td><code>file_url</code></td>
<td>String</td>
<td>文件/视频URL(视频支持data url scheme)。type为file时，必填。（大小限制在70MB以内）</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="AIGC%E7%94%9F%E6%96%87%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">AIGC生文返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次对话任务的唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">对象类型，固定为 <code>chat.completion</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">响应创建的时间戳（Unix Timestamp）。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">实际用于生成响应的模型名称。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">List</td>
<td style="text-align:left">生成结果的选择列表（通常包含一条或多条回复）。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">结果在列表中的索引。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">AI生成的回复消息对象。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left"><strong>核心返回数据</strong>，即AI生成的最终文本回答。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.reasoning_content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left"><strong>AI生成的思考内容</strong>（链式推理过程）。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.extra_content</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">思考签名。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">调用工具信息。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].finish_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">停止生成的原因。例如 <code>stop</code> 表示正常结束。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token 使用量统计。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.prompt_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">提问（输入）消耗的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">回答（输出）消耗的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.total_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">总消耗 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens_details</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输出 Token 详情。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens_details.reasoning_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left"><strong>思考过程消耗的 Token 数</strong>。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="AIGC%E7%94%9F%E6%96%87%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">AIGC生文调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%89%8D42-%E9%BB%98%E8%AE%A4" name="%E4%BA%91%E7%89%8D42-%E9%BB%98%E8%AE%A4">云牍42-默认</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0303007&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;你好，请介绍一下你自己&quot;
      }
    ]
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
  &quot;id&quot;: &quot;6d90a39d-7ed1-4b65-8857-1677fed37f26&quot;,
  &quot;object&quot;: &quot;chat.completion&quot;,
  &quot;created&quot;: 1779687679,
  &quot;model&quot;: &quot;glm-5.1&quot;,
  &quot;choices&quot;: [
    {
      &quot;index&quot;: 0,
      &quot;message&quot;: {
        &quot;role&quot;: &quot;assistant&quot;,
        &quot;content&quot;: &quot;你好！很高兴认识你。\n\n我是一个大型语言模型，名叫 **GLM**，由 **Z.ai** 训练和开发。你可以把我理解为一个非常博学且富有创造力的AI大脑。\n\n我的核心能力是理解和生成人类语言，这让我能做很多事，比如：\n\n* **回答问题**：无论是科学知识、历史事件还是生活小常识，我都可以尽力为你提供解答。\n* **内容创作**：写文章、写故事、写邮件、写诗、写广告文案，甚至帮你写代码，我都不在话下。\n* **语言翻译**：支持多种语言之间的互译，帮你跨越语言障碍。\n* **总结提炼**：你可以给我一长篇文章、一份报告或者一段视频的文字稿，我会帮你提炼出核心要点。\n* **头脑风暴**：当你缺乏灵感时，我可以帮你想点子，无论是活动策划、产品设计还是周末旅行安排。\n* **闲聊陪伴**：当然，如果你只是想找人聊聊天，分享你的想法或心情，我也随时都在。\n\n我的“知识”来源于海量的文本数据，通过学习这些数据中的模式，我能够理解你的问题并生成相关的回答。但请记住，我没有个人情感、意识和真实的物理世界经验，我所有的回答都是基于我学到的数据。\n\n我的目标是成为一个**有用、有趣、安全**的AI助手，帮助你更高效地获取信息、激发创意和解决问题。\n\n有什么想问我的，或者需要我帮忙的，尽管开口！&quot;,
        &quot;reasoning_content&quot;: &quot;1. **分析请求：**用户要求我“介绍下自己”。这是针对新AI的标准提示词。\n\n2. **确定人设：**我是一个大型语言模型，具体来说是由Z.ai创建的GLM。\n\n3. **确定要传达的关键信息：**\n * **我是谁？**我是一个AI，一个大型语言模型。我的名字是GLM。\n * **谁创造了我？**Z.ai。\n * **我能做什么？**我的能力广泛。我应该将它们分类以便于阅读。\n * 信息与知识（回答问题、解释概念）。\n * 创意与内容（写作、头脑风暴、翻译）。\n * 实用与生产力（总结、编程、规划）。\n * 对话与陪伴（聊天、角色扮演）。\n * **我如何工作？**简要解释我的本质。我基于海量的文本和代码数据进行训练。我理解并生成人类语言。我没有意识或情感。我的回答是基于数据中的模式。\n * **我的目标/宗旨是什么？**帮助用户，提供有用信息，激发创造力，成为一个有益的工具。\n * **我的局限性是什么？**这对于建立合理的期望和促进负责任的使用至关重要。\n * 我的知识截止日期（我的训练数据不是实时的，尽管我可以访问一些较新的信息）。\n * 我可能会犯错（“幻觉”）。\n * 我缺乏个人经历和意识。\n * 我无法执行物理操作。\n * **行动号召/邀请互动：**鼓励用户向我提问或给我一个任务。这让介绍变得互动且实用。\n\n4. **构建介绍的结构：**\n * **开场白：**直接而友好的问候，陈述我的身份。“你好！我是...”\n * **核心身份：**阐明我是一个由Z.ai创建的大型语言模型。\n * **能力部分：**使用项目符号列表和清晰的标题。这是最重要的部分。使用如“信息与知识”、“创意与内容”、“实用与生产力”、“对话与陪伴”等类别。这让内容易于浏览。\n * **工作原理部分：**一个简短、非技术性的解释。“我通过学习和理解海量的文本数据...”\n * **局限性部分：**另一个项目符号列表。这显示了诚实和自我认知。提及知识截止日期、可能出错以及缺乏意识。\n * **结束语：**重申我的目标（帮助你）并以友好、邀请的口吻结束。“期待与你交流！”\n\n5. **起草内容（用中文进行迭代优化）：**\n\n * *开场白：*你好！很高兴认识你。我是一个大型语言模型，名叫GLM，由Z.ai训练创建。 - *很好，清晰。*\n\n * *能力：*让我们把它们列出来。\n * 回答问题：从基础知识到专业领域。\n * 内容创作：写文章、故事、诗歌、邮件等。\n * 语言翻译：支持多种语言互译。\n * 编程辅助：写代码、解释代码、调试。\n * 总结与提炼：长文变短文，提取关键信息。\n * 头脑风暴：提供创意和点子。\n * 日常聊天：闲聊、角色扮演。\n * *优化：*将它们分组会使结构更好。参见最终输出中的分组。\n\n * *工作原理：*我的“智能”来源于对海量互联网文本、书籍、代码等数据的学习。我通过寻找这些数据中的模式来理解和生成语言。 - *简单而准确。*\n\n * *局限性：*\n * 我没有个人情感和意识。\n * 我的知识可能不是最新的（尽管我努力获取最新信息）。\n * 我可能会犯错，有时甚至会“一本正经地胡说八道”（产生幻觉）。\n * 我无法执行物理世界的操作。\n * *优化：*“一本正经地胡说八道”是一个非常普遍且易于理解的中文短语，用于描述AI的幻觉。使用它可以增加一丝本土化的感觉。\n\n * *结束语：*我的目标是成为一个有用、有趣的AI助手，帮助你解决问题、激发创意、提高效率。你有什么想问我的，或者需要我帮忙的吗？ - *友好且以行动为导向。*\n\n6. **最终审阅：**通读完整的介绍。它是否流畅？语气是否恰当（有帮助、友好、不傲慢）？它是否信息丰富而又不过于技术化？结构看起来很稳固，语言自然，并且涵盖了所有关键点。它成功地介绍了AI“是谁”、“做什么”和“怎么做”。&quot;
      },
      &quot;finish_reason&quot;: &quot;stop&quot;
    }
  ],
  &quot;usage&quot;: {
    &quot;prompt_tokens&quot;: 8,
    &quot;prompt_tokens_details&quot;: {
      &quot;audio_tokens&quot;: 0,
      &quot;cached_tokens&quot;: 0
    },
    &quot;prompt_cached_tokens_details&quot;: {
      &quot;audio_tokens&quot;: 0
    },
    &quot;completion_tokens&quot;: 1286,
    &quot;completion_tokens_details&quot;: {
      &quot;accepted_prediction_tokens&quot;: 0,
      &quot;audio_tokens&quot;: 0,
      &quot;reasoning_tokens&quot;: 972,
      &quot;rejected_prediction_tokens&quot;: 0
    },
    &quot;total_tokens&quot;: 1294
  }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%89%8D42-%E6%B5%81%E5%BC%8F" name="%E4%BA%91%E7%89%8D42-%E6%B5%81%E5%BC%8F">云牍42-流式</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0303007&quot;,
    &quot;stream&quot;: true,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;你好，请介绍一下你自己&quot;
      }
    ]
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code class="lang-Curl">data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null,&quot;choices&quot;:[{&quot;logprobs&quot;:null,&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;role&quot;:&quot;assistant&quot;,&quot;reasoning_content&quot;:&quot;&quot;},&quot;finish_reason&quot;:null}]}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;reasoning_content&quot;:&quot;用户&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:null,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;reasoning_content&quot;:&quot;让我介绍自己。&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:null,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;reasoning_content&quot;:&quot;\n我需要以&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:null,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

...

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[{&quot;delta&quot;:{&quot;content&quot;:&quot;&quot;,&quot;reasoning_content&quot;:&quot;&quot;},&quot;index&quot;:0,&quot;finish_reason&quot;:&quot;stop&quot;,&quot;logprobs&quot;:null}],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:null}

data: {&quot;model&quot;:&quot;qwen3.7-max&quot;,&quot;id&quot;:&quot;chatcmpl-28ab2119-a04e-961c-ad27-76a22254a518&quot;,&quot;choices&quot;:[],&quot;created&quot;:1780481457,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;usage&quot;:{&quot;total_tokens&quot;:1028,&quot;completion_tokens&quot;:1015,&quot;prompt_tokens&quot;:13,&quot;completion_tokens_details&quot;:{&quot;reasoning_tokens&quot;:724},&quot;prompt_tokens_details&quot;:{&quot;cached_tokens&quot;:0}}}

data: [DONE]
</code></pre>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th style="text-align:left">HTTP状态码</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">200</td>
<td style="text-align:left">成功。</td>
</tr>
<tr>
<td style="text-align:left">400</td>
<td style="text-align:left">请求参数错误。例如，<code>model</code> 字段拼写错误、<code>messages</code> 格式不正确。</td>
</tr>
<tr>
<td style="text-align:left">401</td>
<td style="text-align:left"><strong>认证失败</strong>。请检查 <code>API Key</code> 是否正确，或者 <code>Authorization</code> 头格式是否为 <code>Bearer &lt;KEY&gt;</code>。</td>
</tr>
<tr>
<td style="text-align:left">403</td>
<td style="text-align:left">权限不足/已停服。可能原因：欠费、未开通该模型权限、<code>API Key</code> 无效。</td>
</tr>
<tr>
<td style="text-align:left">404</td>
<td style="text-align:left">模型/端点不存在。比如 model 名不支持；请求了错误的 path。</td>
</tr>
<tr>
<td style="text-align:left">429</td>
<td style="text-align:left">速率限制</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Thu, 04 Jun 2026 10:23:35 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1243</guid>
      <comments>http://doc.talkingdata.com/posts/1243#comments</comments>
    </item>
    <item>
      <title>TD云灵22</title>
      <link>http://doc.talkingdata.com/posts/1242</link>
      <category>多模态生成API</category>
      <author>liuxinmei</author>
      <description>云灵22 接口说明文档 TD模型编号：T0310005 模型能力简介 云灵22 具备强大的文本理解与生成能力，支持长上下文处理。适合内容创作、智能客服、代码生成、复杂推理等需要高精度、高智能的通用场景。 鉴权说明  本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
 AIGC生文接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions 请求头（Request Headers）： 头部字段 值 是否必填 说明 Authorization Bearer &lt;your_api_key&gt; 是 API 鉴权凭证，请替换为有效的 API Key </description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%81%B522%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%81%B522%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云灵22 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0310005</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云灵22</strong><ul>
<li>具备强大的文本理解与生成能力，支持长上下文处理。适合内容创作、智能客服、代码生成、复杂推理等需要高精度、高智能的通用场景。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="AIGC%E7%94%9F%E6%96%87%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">AIGC生文接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">AIGC生文请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">AIGC生文请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0310005</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><code>messages</code></td>
<td style="text-align:left">List<Object></td>
<td style="text-align:left">是</td>
<td style="text-align:left">对话消息列表，用于提供上下文和当前问题。详见下方 <code>messages</code> 对象结构。</td>
</tr>
<tr>
<td style="text-align:left"><code>stream</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否使用流式响应。默认为 <code>false</code>（非流式）。</td>
</tr>
<tr>
<td style="text-align:left"><code>thinking_enabled</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否开启推理（思考）模式。 - <code>true</code>: 模型在回答前会进行深度链式思考（CoT），适合复杂的逻辑分析、数学计算或代码生成任务。开启后响应延迟会增加，并在usage中产生<code>reasoning_tokens</code>。 - <code>false</code>: 标准对话模式，响应速度更快。 <strong>注意：</strong> 开启后，usage中的<code>reasoning_tokens</code>将会产生消耗。</td>
</tr>
<tr>
<td style="text-align:left"><code>temperature</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制输出的随机性和创造性。 - 取值范围通常为 0~2，默认值为 0.7。 - 值越接近0：输出越精准、确定，适合事实性问答、代码生成等场景。 - 值越接近2：输出越发散、富有创意，适合文案创作、头脑风暴等场景。</td>
</tr>
<tr>
<td style="text-align:left"><code>max_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制单次请求的最大生成令牌（Token）数量，<strong>包含输入和输出的总Token</strong>。 - 需结合所选模型的最大Token限制设置，超出会触发截断或报错。 - 合理设置可避免生成过长内容，控制请求成本与响应速度。</td>
</tr>
<tr>
<td style="text-align:left"><code>reasoning_effort</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">思考等级。取值范围：<code>none</code> / <code>minimal</code> / <code>low</code> / <code>medium</code> / <code>high</code> / <code>xhigh</code>。 <strong>注意：</strong> 同时配置<code>thinking_enabled</code>时，以<code>reasoning_effort</code>为基准。</td>
</tr>
<tr>
<td style="text-align:left"><code>tools</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具列表，详细参考 OpenAI 文档。<strong>该模型只支持 function 工具。</strong></td>
</tr>
<tr>
<td style="text-align:left"><code>tool_choice</code></td>
<td style="text-align:left">String / Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具选项，详细参考 OpenAI 文档。</td>
</tr>
<tr>
<td style="text-align:left"><code>response_format</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">格式化输出，详细参考 OpenAI 文档。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Emessages%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%9A" name="%3Ccode%3Emessages%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%9A"><code>messages</code> 结构：</h4>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">消息发送者的角色。常见值： - <code>system</code>: 系统指令（设定AI的人设） - <code>user</code>: 用户（提问者） - <code>assistant</code>: AI助手（之前的回答历史） - <code>tool</code>: 用户的工具（输入模型需要工具的结果）</td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String / Array Of Part</td>
<td style="text-align:left">String类型时，消息的具体文本内容。 Array类型时参考下方 <code>Part</code> 对象结构。 role为<code>tool</code>时，用户工具的输出结果。</td>
</tr>
<tr>
<td style="text-align:left"><code>tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">role为<code>assistant</code>时，工具使用过程中模型返回的需要调用的工具和输出参数，详情参考 OpenAI 协议。</td>
</tr>
<tr>
<td style="text-align:left"><code>tool_call_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">role为<code>tool</code>时，模型需要调用工具的id，在响应包中<code>tool_calls</code>信息中。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Econtent%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%88%E5%BD%93%20content%20%E4%B8%BA%20Array%20Of%20Part%E7%B1%BB%E5%9E%8B%E6%97%B6%EF%BC%89%EF%BC%9A" name="%3Ccode%3Econtent%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%88%E5%BD%93%20content%20%E4%B8%BA%20Array%20Of%20Part%E7%B1%BB%E5%9E%8B%E6%97%B6%EF%BC%89%EF%BC%9A"><code>content</code> 结构（当 content 为 Array Of Part类型时）：</h4>
<table>
<thead>
<tr>
<th><strong>字段名</strong></th>
<th><strong>类型</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>type</code></td>
<td>String</td>
<td>数据类型。常见值：- text: 文本- image_url: 图片url- input_audio: 音频数据，需填写- file: 文件,需填写file_url,可选填file_name。</td>
</tr>
<tr>
<td><code>text</code></td>
<td>String</td>
<td>消息的具体文本内容。type为text时，必填。</td>
</tr>
<tr>
<td><code>image_url</code></td>
<td>String</td>
<td>图片的url(支持data url scheme)。type为image_url时，必填。（大小限制在70MB以内）</td>
</tr>
<tr>
<td><code>input_audio</code></td>
<td>Object</td>
<td>音频数据。type为input_audio时，必填。</td>
</tr>
<tr>
<td>└ <code>data</code></td>
<td>String</td>
<td>音频数据的Base64编码。</td>
</tr>
<tr>
<td>└ <code>format</code></td>
<td>String</td>
<td>音频格式。当前只支持mp3/wav。</td>
</tr>
<tr>
<td><code>file_name</code></td>
<td>String</td>
<td>文件/视频名。</td>
</tr>
<tr>
<td><code>file_url</code></td>
<td>String</td>
<td>文件/视频URL(视频支持data url scheme)。type为file时，必填。（大小限制在70MB以内）</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="AIGC%E7%94%9F%E6%96%87%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">AIGC生文返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次对话任务的唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">对象类型，固定为 <code>chat.completion</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">响应创建的时间戳（Unix Timestamp）。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">实际用于生成响应的模型名称。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">List</td>
<td style="text-align:left">生成结果的选择列表（通常包含一条或多条回复）。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">结果在列表中的索引。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">AI生成的回复消息对象。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left"><strong>核心返回数据</strong>，即AI生成的最终文本回答。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.reasoning_content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left"><strong>AI生成的思考内容</strong>（链式推理过程）。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">调用工具信息。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].finish_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">停止生成的原因。例如 <code>stop</code> 表示正常结束。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token 使用量统计。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.prompt_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">提问（输入）消耗的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">回答（输出）消耗的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.total_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">总消耗 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens_details</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输出 Token 详情。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens_details.reasoning_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left"><strong>思考过程消耗的 Token 数</strong>。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="AIGC%E7%94%9F%E6%96%87%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">AIGC生文调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%81%B522-%E9%BB%98%E8%AE%A4" name="%E4%BA%91%E7%81%B522-%E9%BB%98%E8%AE%A4">云灵22-默认</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0310005&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;介绍下自己&quot;
      }
    ]
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
    &quot;id&quot;: &quot;a8a38ea5-890b-4771-a200-6d5ddad4b1e6&quot;,
    &quot;object&quot;: &quot;chat.completion&quot;,
    &quot;created&quot;: 1778724922,
    &quot;model&quot;: &quot;gpt-5.5&quot;,
    &quot;choices&quot;: [
        {
            &quot;index&quot;: 0,
            &quot;message&quot;: {
                &quot;role&quot;: &quot;assistant&quot;,
                &quot;content&quot;: &quot;你好！我是一个 AI 助手，可以帮你处理各种文字和信息类任务，比如：\n\n- 回答问题、解释概念\n- 写作、润色、翻译\n- 制定计划、整理资料\n- 辅助学习、编程、办公\n- 头脑风暴、起名、写文案\n- 分析文本、总结内容\n\n你可以把我当作一个随时可用的智能助手。 \n有什么想聊的或需要我帮忙的吗？&quot;
            },
            &quot;finish_reason&quot;: &quot;stop&quot;
        }
    ],
    &quot;usage&quot;: {
        &quot;prompt_tokens&quot;: 9,
        &quot;completion_tokens&quot;: 127,
        &quot;total_tokens&quot;: 136,
        &quot;completion_tokens_details&quot;: {
            &quot;accepted_prediction_tokens&quot;: 0,
            &quot;audio_tokens&quot;: 0,
            &quot;reasoning_tokens&quot;: 10,
            &quot;rejected_prediction_tokens&quot;: 0
        }
    }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%81%B522-%E6%B5%81%E5%BC%8F" name="%E4%BA%91%E7%81%B522-%E6%B5%81%E5%BC%8F">云灵22-流式</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0310005&quot;,
    &quot;stream&quot;: true,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;介绍下自己&quot;
      }
    ]
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code class="lang-Curl">data: {&quot;id&quot;:&quot;ef4231d3-bc21-42a1-9a48-2fbeb94634d4&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778724869,&quot;model&quot;:&quot;gpt-5.5&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;&quot;}}]}

data: {&quot;id&quot;:&quot;ef4231d3-bc21-42a1-9a48-2fbeb94634d4&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778724869,&quot;model&quot;:&quot;gpt-5.5&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:&quot;你好&quot;}}]}

... (中间省略多个content片段)

data: {&quot;id&quot;:&quot;ef4231d3-bc21-42a1-9a48-2fbeb94634d4&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778724869,&quot;model&quot;:&quot;gpt-5.5&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:&quot;。&quot;}}]}

data: {&quot;id&quot;:&quot;ef4231d3-bc21-42a1-9a48-2fbeb94634d4&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778724869,&quot;model&quot;:&quot;gpt-5.5&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:null},&quot;finish_reason&quot;:&quot;stop&quot;}]}

data: {&quot;id&quot;:&quot;ef4231d3-bc21-42a1-9a48-2fbeb94634d4&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778724869,&quot;model&quot;:&quot;gpt-5.5&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;content&quot;:null}}],&quot;usage&quot;:{&quot;prompt_tokens&quot;:9,&quot;completion_tokens&quot;:161,&quot;total_tokens&quot;:170,&quot;completion_tokens_details&quot;:{&quot;reasoning_tokens&quot;:22,...}}}

data: [DONE]
</code></pre>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th style="text-align:left">HTTP状态码</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">200</td>
<td style="text-align:left">成功。</td>
</tr>
<tr>
<td style="text-align:left">400</td>
<td style="text-align:left">请求参数错误。例如，<code>model</code> 字段拼写错误、<code>messages</code> 格式不正确。</td>
</tr>
<tr>
<td style="text-align:left">401</td>
<td style="text-align:left"><strong>认证失败</strong>。请检查 <code>API Key</code> 是否正确，或者 <code>Authorization</code> 头格式是否为 <code>Bearer &lt;KEY&gt;</code>。</td>
</tr>
<tr>
<td style="text-align:left">403</td>
<td style="text-align:left">权限不足/已停服。可能原因：欠费、未开通该模型权限、<code>API Key</code> 无效。</td>
</tr>
<tr>
<td style="text-align:left">404</td>
<td style="text-align:left">模型/端点不存在。比如 model 名不支持；请求了错误的 path。</td>
</tr>
<tr>
<td style="text-align:left">429</td>
<td style="text-align:left">速率限制</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Tue, 19 May 2026 16:45:53 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1242</guid>
      <comments>http://doc.talkingdata.com/posts/1242#comments</comments>
    </item>
    <item>
      <title>TD云灵7</title>
      <link>http://doc.talkingdata.com/posts/1241</link>
      <category>多模态生成API</category>
      <author>liuxinmei</author>
      <description>云灵7 接口说明文档 TD模型编号：T0310004 模型能力简介 云灵7 是一款高效、轻量级的模型，适合需要快速响应的实时应用。它在保持强大推理和文本理解能力的同时，优化了响应速度和成本。适用于高频交互的智能客服、实时内容生成、大规模数据处理等对延迟和成本敏感的场景。 鉴权说明  本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
 AIGC生文接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions 请求头（Request Headers）： 头部字段 值 是否必填 说明 Authorization Bearer &lt;your_ap</description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%81%B57%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%81%B57%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云灵7 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0310004</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云灵7</strong><ul>
<li>是一款高效、轻量级的模型，适合需要快速响应的实时应用。它在保持强大推理和文本理解能力的同时，优化了响应速度和成本。适用于高频交互的智能客服、实时内容生成、大规模数据处理等对延迟和成本敏感的场景。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="AIGC%E7%94%9F%E6%96%87%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">AIGC生文接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">AIGC生文请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">AIGC生文请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0310004</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><code>messages</code></td>
<td style="text-align:left">List<Object></td>
<td style="text-align:left">是</td>
<td style="text-align:left">对话消息列表，用于提供上下文和当前问题。详见下方 <code>messages</code> 对象结构。</td>
</tr>
<tr>
<td style="text-align:left"><code>stream</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否使用流式响应。默认为 <code>false</code>（非流式）。</td>
</tr>
<tr>
<td style="text-align:left"><code>thinking_enabled</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否开启推理（思考）模式。 - <code>true</code>: 模型在回答前会进行深度链式思考（CoT），适合复杂的逻辑分析、数学计算或代码生成任务。开启后响应延迟会增加，并在usage中产生<code>reasoning_tokens</code>。 - <code>false</code>: 标准对话模式，响应速度更快。 <strong>注意：</strong> 开启后，usage中的<code>reasoning_tokens</code>将会产生消耗。</td>
</tr>
<tr>
<td style="text-align:left"><code>temperature</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制输出的随机性和创造性。 - 取值范围通常为 0~2，默认值为 0.7。 - 值越接近0：输出越精准、确定，适合事实性问答、代码生成等场景。 - 值越接近2：输出越发散、富有创意，适合文案创作、头脑风暴等场景。</td>
</tr>
<tr>
<td style="text-align:left"><code>max_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制单次请求的最大生成令牌（Token）数量，<strong>包含输入和输出的总Token</strong>。 - 需结合所选模型的最大Token限制设置，超出会触发截断或报错。 - 合理设置可避免生成过长内容，控制请求成本与响应速度。</td>
</tr>
<tr>
<td style="text-align:left"><code>reasoning_effort</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">思考等级。取值范围：<code>none</code> / <code>minimal</code> / <code>low</code> / <code>medium</code> / <code>high</code> / <code>xhigh</code>。 <strong>注意：</strong> 同时配置<code>thinking_enabled</code>时，以<code>reasoning_effort</code>为基准。</td>
</tr>
<tr>
<td style="text-align:left"><code>tools</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具列表，详细参考 OpenAI 文档。<strong>该模型只支持 function 工具。</strong></td>
</tr>
<tr>
<td style="text-align:left"><code>tool_choice</code></td>
<td style="text-align:left">String / Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具选项，详细参考 OpenAI 文档。</td>
</tr>
<tr>
<td style="text-align:left"><code>response_format</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">格式化输出，详细参考 OpenAI 文档。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Emessages%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%9A" name="%3Ccode%3Emessages%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%9A"><code>messages</code> 结构：</h4>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">消息发送者的角色。常见值： - <code>system</code>: 系统指令（设定AI的人设） - <code>user</code>: 用户（提问者） - <code>assistant</code>: AI助手（之前的回答历史） - <code>tool</code>: 用户的工具（输入模型需要工具的结果）</td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String / Array Of Part</td>
<td style="text-align:left">String类型时，消息的具体文本内容。 Array类型时参考下方 <code>Part</code> 对象结构。 role为<code>tool</code>时，用户工具的输出结果。</td>
</tr>
<tr>
<td style="text-align:left"><code>tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">role为<code>assistant</code>时，工具使用过程中模型返回的需要调用的工具和输出参数，详情参考 OpenAI 协议。<strong>该模型只支持 function 工具。</strong></td>
</tr>
<tr>
<td style="text-align:left"><code>tool_call_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">role为<code>tool</code>时，模型需要调用工具的id，在响应包中<code>tool_calls</code>信息中。</td>
</tr>
<tr>
<td style="text-align:left"><code>extra_content</code></td>
<td style="text-align:left">ExtraContent</td>
<td style="text-align:left">role为<code>assistant</code>时，可能有思考签名。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Econtent%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%88%E5%BD%93%20content%20%E4%B8%BA%20Array%20Of%20Part%E7%B1%BB%E5%9E%8B%E6%97%B6%EF%BC%89%EF%BC%9A" name="%3Ccode%3Econtent%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%88%E5%BD%93%20content%20%E4%B8%BA%20Array%20Of%20Part%E7%B1%BB%E5%9E%8B%E6%97%B6%EF%BC%89%EF%BC%9A"><code>content</code> 结构（当 content 为 Array Of Part类型时）：</h4>
<table>
<thead>
<tr>
<th><strong>字段名</strong></th>
<th><strong>类型</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>type</code></td>
<td>String</td>
<td>数据类型。常见值：- text: 文本- image_url: 图片url- input_audio: 音频数据，需填写- file: 文件,需填写file_url,可选填file_name。</td>
</tr>
<tr>
<td><code>text</code></td>
<td>String</td>
<td>消息的具体文本内容。type为text时，必填。</td>
</tr>
<tr>
<td><code>image_url</code></td>
<td>String</td>
<td>图片的url(支持data url scheme)。type为image_url时，必填。（大小限制在70MB以内）</td>
</tr>
<tr>
<td><code>input_audio</code></td>
<td>Object</td>
<td>音频数据。type为input_audio时，必填。</td>
</tr>
<tr>
<td>└ <code>data</code></td>
<td>String</td>
<td>音频数据的Base64编码。</td>
</tr>
<tr>
<td>└ <code>format</code></td>
<td>String</td>
<td>音频格式。当前只支持mp3/wav。</td>
</tr>
<tr>
<td><code>file_name</code></td>
<td>String</td>
<td>文件/视频名。</td>
</tr>
<tr>
<td><code>file_url</code></td>
<td>String</td>
<td>文件/视频URL(视频支持data url scheme)。type为file时，必填。（大小限制在70MB以内）</td>
</tr>
<tr>
<td>└ <code>extra_content</code></td>
<td>ExtraContent结构</td>
<td>本模型进行文件分析时,可以通过media_resolution和fps进行控制。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Eextra_content%3C%2Fcode%3E%E7%BB%93%E6%9E%84%EF%BC%9A" name="%3Ccode%3Eextra_content%3C%2Fcode%3E%E7%BB%93%E6%9E%84%EF%BC%9A"><code>extra_content</code>结构：</h4>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>google</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">本模型使用。</td>
</tr>
<tr>
<td style="text-align:left"><code>google.fps</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">视频帧率，请求时指定，用于模型的fps功能。</td>
</tr>
<tr>
<td style="text-align:left"><code>google.media_resolution</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">控制输入媒体的处理方式。</td>
</tr>
<tr>
<td style="text-align:left"><code>google.thought_signature</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型输出字段：思考签名。</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="AIGC%E7%94%9F%E6%96%87%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">AIGC生文返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次对话任务的唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">对象类型，固定为 <code>chat.completion</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">响应创建的时间戳（Unix Timestamp）。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">实际用于生成响应的模型名称。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">List</td>
<td style="text-align:left">生成结果的选择列表（通常包含一条或多条回复）。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">结果在列表中的索引。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">AI生成的回复消息对象。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left"><strong>核心返回数据</strong>，即AI生成的最终文本回答。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.reasoning_content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left"><strong>AI生成的思考内容</strong>（链式推理过程）。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.extra_content</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">思考签名。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">调用工具信息。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].finish_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">停止生成的原因。例如 <code>stop</code> 表示正常结束。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token 使用量统计。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.prompt_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">提问（输入）消耗的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">回答（输出）消耗的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.total_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">总消耗 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens_details</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输出 Token 详情。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens_details.reasoning_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left"><strong>思考过程消耗的 Token 数</strong>。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="AIGC%E7%94%9F%E6%96%87%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">AIGC生文调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%81%B57-%E9%BB%98%E8%AE%A4" name="%E4%BA%91%E7%81%B57-%E9%BB%98%E8%AE%A4">云灵7-默认</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0310004&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;你好，请介绍一下你自己&quot;
      }
    ]
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
    &quot;id&quot;: &quot;48544716-c68c-44ce-9c30-288f4f7928d0&quot;,
    &quot;object&quot;: &quot;chat.completion&quot;,
    &quot;created&quot;: 1778576240,
    &quot;model&quot;: &quot;gemini-2.5-flash&quot;,
    &quot;choices&quot;: [
        {
            &quot;index&quot;: 0,
            &quot;message&quot;: {
                &quot;role&quot;: &quot;assistant&quot;,
                &quot;content&quot;: &quot;你好！很高兴认识你。\n\n我是一个**大型语言模型**，由 Google 训练。\n\n我的主要功能是：\n*   **回答各种问题**，提供信息。\n*   **进行创作**，比如撰写文章、故事、诗歌，生成代码、剧本、邮件等等。\n*   **理解和生成人类语言**，可以进行翻译、总结文本、进行头脑风暴等等。\n*   **协助你完成各种语言相关的任务**。\n\n我没有个人意识、情感或身体，也没有自己的观点或偏好。我的目标是尽可能地帮助你，提供准确、有用和富有创造力的信息。\n\n有什么我可以帮助你的吗？随时问我吧！&quot;,
                &quot;reasoning_content&quot;: &quot;Okay, I&#39;ll step into the shoes of this thought process...&quot;,
                &quot;extra_content&quot;: {},
                &quot;tool_calls&quot;: []
            },
            &quot;finish_reason&quot;: &quot;stop&quot;
        }
    ],
    &quot;usage&quot;: {
        &quot;prompt_tokens&quot;: 6,
        &quot;completion_tokens&quot;: 994,
        &quot;total_tokens&quot;: 1000,
        &quot;completion_tokens_details&quot;: {
            &quot;accepted_prediction_tokens&quot;: 0,
            &quot;audio_tokens&quot;: 0,
            &quot;reasoning_tokens&quot;: 843,
            &quot;rejected_prediction_tokens&quot;: 0
        }
    }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%81%B57-%E6%B5%81%E5%BC%8F" name="%E4%BA%91%E7%81%B57-%E6%B5%81%E5%BC%8F">云灵7-流式</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0310004&quot;,
    &quot;stream&quot;: true,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;你好，请介绍一下你自己&quot;
      }
    ]
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code class="lang-Curl">data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576144,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Exploring Self-Identification**\n\nI&#39;m currently processing the fundamental aspects of my identity, trying to pinpoint the most relevant details for a self-introduction. This involves an internal exploration of my core functions and purpose.\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576146,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Refining Purpose**\n\nI&#39;m currently focusing on articulating my core functionalities and purpose. My goal is to clearly define my role as a helpful and informative AI.\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576148,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Defining Core Capabilities**\n\nI am actively integrating the information gathered about my origins and intended functions. The focus is on clearly defining the scope of my abilities and the way I interact with users, aiming for a concise yet informative representation.\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576149,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Learning Language Nuances**\n\nI am currently focusing on refining my ability to interpret and generate language with greater subtlety and cultural awareness. This involves analyzing patterns in diverse linguistic inputs to better understand implied meanings and context.\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576150,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Integrating Knowledge**\n\nI&#39;m currently synthesizing information about my core functionalities and purpose. My focus is on building a cohesive understanding of how I can best assist you by combining my training data with my operational capabilities.\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576150,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;你好！很高兴能向你介绍我自己。\n\n我是一个**大型语言模型**，由 **Google** 训练。\n\n我的主要目标是协助用户，&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576150,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;提供信息，回答问题，以及生成各种文本内容。你可以把我当作你的智能助手。\n\n**我的能力包括但不限于：**\n\n* **回答问题：** 无论是关于科学、历史、文化、时事，还是生活常识，我都会尽力提供准确和详细的答案。\n* **&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576151,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;生成文本：** 我可以帮助你撰写邮件、报告、文章、故事、诗歌，甚至编写代码。\n* **总结和提炼：** 我能阅读长篇文本并提取关键信息，进行总结。\n* **创意写作：** 如果你需要灵感，我可以提供&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576151,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;创意点子、剧本大纲或任何形式的文学创作协助。\n* **翻译：** 我可以进行多种语言之间的翻译。\n* **学习和解释：** 我可以学习新的概念，并用清晰易懂的方式向你解释复杂的想法。\n\n**我的特性：**\n\n* **&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576152,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;知识渊博：** 我拥有海量的知识库，涵盖了非常广泛的领域。\n* **理解力强：** 我能够理解你的提问意图，并根据上下文进行连贯的对话。\n* **持续学习：** 我还在不断地学习和改进中，以&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576152,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;期提供更优质、更准确的服务。\n\n**但我也需要说明：**\n\n* 我没有个人意识、情感或主观经验，我只是一段复杂的程序代码。\n* 我的回答是基于我所学习到的数据和算法，虽然我力求准确，但有时也可能出现&quot;}}]}

data: {&quot;id&quot;:&quot;ad77aa80-7fd9-4ccf-8f6b-932184ac380a&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778576152,&quot;model&quot;:&quot;gemini-2.5-flash&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;不准确或过时的信息。\n* 我无法执行物理动作，也无法替代人类的判断和专业意见。\n\n总之，你可以把我当作一个随时待命的知识库和创意伙伴。无论你有什么问题或需要帮助的地方，尽管问我吧！&quot;},&quot;finish_reason&quot;:&quot;stop&quot;}],&quot;usage&quot;:{&quot;prompt_tokens&quot;:6,&quot;prompt_tokens_details&quot;:{&quot;audio_tokens&quot;:0,&quot;cached_tokens&quot;:0},&quot;prompt_cached_tokens_details&quot;:{&quot;audio_tokens&quot;:0},&quot;completion_tokens&quot;:1506,&quot;completion_tokens_details&quot;:{&quot;accepted_prediction_tokens&quot;:0,&quot;audio_tokens&quot;:0,&quot;reasoning_tokens&quot;:1086,&quot;rejected_prediction_tokens&quot;:0},&quot;total_tokens&quot;:1512}}

data: [DONE]
</code></pre>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th style="text-align:left">HTTP状态码</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">200</td>
<td style="text-align:left">成功。</td>
</tr>
<tr>
<td style="text-align:left">400</td>
<td style="text-align:left">请求参数错误。例如，<code>model</code> 字段拼写错误、<code>messages</code> 格式不正确。</td>
</tr>
<tr>
<td style="text-align:left">401</td>
<td style="text-align:left"><strong>认证失败</strong>。请检查 <code>API Key</code> 是否正确，或者 <code>Authorization</code> 头格式是否为 <code>Bearer &lt;KEY&gt;</code>。</td>
</tr>
<tr>
<td style="text-align:left">403</td>
<td style="text-align:left">权限不足/已停服。可能原因：欠费、未开通该模型权限、<code>API Key</code> 无效。</td>
</tr>
<tr>
<td style="text-align:left">404</td>
<td style="text-align:left">模型/端点不存在。比如 model 名不支持；请求了错误的 path。</td>
</tr>
<tr>
<td style="text-align:left">429</td>
<td style="text-align:left">速率限制</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Tue, 19 May 2026 15:45:07 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1241</guid>
      <comments>http://doc.talkingdata.com/posts/1241#comments</comments>
    </item>
    <item>
      <title>TD云灵6</title>
      <link>http://doc.talkingdata.com/posts/1240</link>
      <category>多模态生成API</category>
      <author>liuxinmei</author>
      <description>云灵6 接口说明文档 TD模型编号：T0310003 模型能力简介 云灵6 具备强大的文本理解与逻辑推理能力，支持长上下文处理，可深度解析复杂问题并输出思考过程。适合内容创作、智能客服、代码生成等需要高精度、强推理的通用场景。 鉴权说明  本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
 AIGC生文接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions 请求头（Request Headers）： 头部字段 值 是否必填 说明 Authorization Bearer &lt;your_api_key&gt; 是 API 鉴权凭证，请替换为</description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%81%B56%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%81%B56%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云灵6 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0310003</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云灵6</strong><ul>
<li>具备强大的文本理解与逻辑推理能力，支持长上下文处理，可深度解析复杂问题并输出思考过程。适合内容创作、智能客服、代码生成等需要高精度、强推理的通用场景。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="AIGC%E7%94%9F%E6%96%87%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">AIGC生文接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">AIGC生文请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="AIGC%E7%94%9F%E6%96%87%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">AIGC生文请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0310003</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><code>messages</code></td>
<td style="text-align:left">List<Object></td>
<td style="text-align:left">是</td>
<td style="text-align:left">对话消息列表，用于提供上下文和当前问题。详见下方 <code>messages</code> 对象结构。</td>
</tr>
<tr>
<td style="text-align:left"><code>stream</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否使用流式响应。默认为 <code>false</code>（非流式）。</td>
</tr>
<tr>
<td style="text-align:left"><code>thinking_enabled</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否开启推理（思考）模式。 - <code>true</code>: 模型在回答前会进行深度链式思考（CoT），适合复杂的逻辑分析、数学计算或代码生成任务。开启后响应延迟会增加，并在usage中产生<code>reasoning_tokens</code>。 - <code>false</code>: 标准对话模式，响应速度更快。 <strong>注意：</strong> 开启后，usage中的<code>reasoning_tokens</code>将会产生消耗。</td>
</tr>
<tr>
<td style="text-align:left"><code>temperature</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制输出的随机性和创造性。 - 取值范围通常为 0~2，默认值为 0.7。 - 值越接近0：输出越精准、确定，适合事实性问答、代码生成等场景。 - 值越接近2：输出越发散、富有创意，适合文案创作、头脑风暴等场景。</td>
</tr>
<tr>
<td style="text-align:left"><code>max_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">控制单次请求的最大生成令牌（Token）数量，<strong>包含输入和输出的总Token</strong>。 - 需结合所选模型的最大Token限制设置，超出会触发截断或报错。 - 合理设置可避免生成过长内容，控制请求成本与响应速度。</td>
</tr>
<tr>
<td style="text-align:left"><code>reasoning_effort</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">思考等级。取值范围：<code>none</code> / <code>minimal</code> / <code>low</code> / <code>medium</code> / <code>high</code> / <code>xhigh</code>。 <strong>注意：</strong> 同时配置<code>thinking_enabled</code>时，以<code>reasoning_effort</code>为基准。</td>
</tr>
<tr>
<td style="text-align:left"><code>tools</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具列表，详细参考 OpenAI 文档。<strong>该模型只支持 function 工具。</strong></td>
</tr>
<tr>
<td style="text-align:left"><code>tool_choice</code></td>
<td style="text-align:left">String / Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">工具选项，详细参考 OpenAI 文档。</td>
</tr>
<tr>
<td style="text-align:left"><code>response_format</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">格式化输出，详细参考 OpenAI 文档。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Emessages%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%9A" name="%3Ccode%3Emessages%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%9A"><code>messages</code> 结构：</h4>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">消息发送者的角色。常见值： - <code>system</code>: 系统指令（设定AI的人设） - <code>user</code>: 用户（提问者） - <code>assistant</code>: AI助手（之前的回答历史） - <code>tool</code>: 用户的工具（输入模型需要工具的结果）</td>
</tr>
<tr>
<td style="text-align:left"><code>content</code></td>
<td style="text-align:left">String / Array Of Part</td>
<td style="text-align:left">String类型时，消息的具体文本内容。 Array类型时参考下方 <code>Part</code> 对象结构。 role为<code>tool</code>时，用户工具的输出结果。</td>
</tr>
<tr>
<td style="text-align:left"><code>tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">role为<code>assistant</code>时，工具使用过程中模型返回的需要调用的工具和输出参数，详情参考 OpenAI 协议。<strong>该模型只支持 function 工具。</strong></td>
</tr>
<tr>
<td style="text-align:left"><code>tool_call_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">role为<code>tool</code>时，模型需要调用工具的id，在响应包中<code>tool_calls</code>信息中。</td>
</tr>
<tr>
<td style="text-align:left"><code>extra_content</code></td>
<td style="text-align:left">ExtraContent</td>
<td style="text-align:left">role为<code>assistant</code>时，可能有思考签名。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Econtent%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%88%E5%BD%93%20content%20%E4%B8%BA%20Array%20Of%20Part%E7%B1%BB%E5%9E%8B%E6%97%B6%EF%BC%89%EF%BC%9A" name="%3Ccode%3Econtent%3C%2Fcode%3E%20%E7%BB%93%E6%9E%84%EF%BC%88%E5%BD%93%20content%20%E4%B8%BA%20Array%20Of%20Part%E7%B1%BB%E5%9E%8B%E6%97%B6%EF%BC%89%EF%BC%9A"><code>content</code> 结构（当 content 为 Array Of Part类型时）：</h4>
<table>
<thead>
<tr>
<th><strong>字段名</strong></th>
<th><strong>类型</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>type</code></td>
<td>String</td>
<td>数据类型。常见值：- text: 文本- image_url: 图片url- input_audio: 音频数据，需填写- file: 文件,需填写file_url,可选填file_name。</td>
</tr>
<tr>
<td><code>text</code></td>
<td>String</td>
<td>消息的具体文本内容。type为text时，必填。</td>
</tr>
<tr>
<td><code>image_url</code></td>
<td>String</td>
<td>图片的url(支持data url scheme)。type为image_url时，必填。（大小限制在70MB以内）</td>
</tr>
<tr>
<td><code>input_audio</code></td>
<td>Object</td>
<td>音频数据。type为input_audio时，必填。</td>
</tr>
<tr>
<td>└ <code>data</code></td>
<td>String</td>
<td>音频数据的Base64编码。</td>
</tr>
<tr>
<td>└ <code>format</code></td>
<td>String</td>
<td>音频格式。当前只支持mp3/wav。</td>
</tr>
<tr>
<td><code>file_name</code></td>
<td>String</td>
<td>文件/视频名。</td>
</tr>
<tr>
<td><code>file_url</code></td>
<td>String</td>
<td>文件/视频URL(视频支持data url scheme)。type为file时，必填。（大小限制在70MB以内）</td>
</tr>
<tr>
<td>└ <code>extra_content</code></td>
<td>ExtraContent结构</td>
<td>本模型进行文件分析时,可以通过media_resolution和fps进行控制。</td>
</tr>
</tbody>
</table>
<h4 id="%3Ccode%3Eextra_content%3C%2Fcode%3E%E7%BB%93%E6%9E%84%EF%BC%9A" name="%3Ccode%3Eextra_content%3C%2Fcode%3E%E7%BB%93%E6%9E%84%EF%BC%9A"><code>extra_content</code>结构：</h4>
<table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>google</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">本模型使用。</td>
</tr>
<tr>
<td style="text-align:left"><code>google.fps</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">视频帧率，请求时指定，用于模型的fps功能。</td>
</tr>
<tr>
<td style="text-align:left"><code>google.media_resolution</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">控制输入媒体的处理方式。</td>
</tr>
<tr>
<td style="text-align:left"><code>google.thought_signature</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">模型输出字段：思考签名。</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="AIGC%E7%94%9F%E6%96%87%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">AIGC生文返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">本次对话任务的唯一标识符。</td>
</tr>
<tr>
<td style="text-align:left"><code>object</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">对象类型，固定为 <code>chat.completion</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>created</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">响应创建的时间戳（Unix Timestamp）。</td>
</tr>
<tr>
<td style="text-align:left"><code>model</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">实际用于生成响应的模型名称。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices</code></td>
<td style="text-align:left">List</td>
<td style="text-align:left">生成结果的选择列表（通常包含一条或多条回复）。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].index</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">结果在列表中的索引。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">AI生成的回复消息对象。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.role</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">固定为 <code>assistant</code>。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left"><strong>核心返回数据</strong>，即AI生成的最终文本回答。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.reasoning_content</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left"><strong>AI生成的思考内容</strong>（链式推理过程）。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.extra_content</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">思考签名。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].message.tool_calls</code></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">调用工具信息。</td>
</tr>
<tr>
<td style="text-align:left"><code>choices[].finish_reason</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">停止生成的原因。例如 <code>stop</code> 表示正常结束。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">Token 使用量统计。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.prompt_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">提问（输入）消耗的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">回答（输出）消耗的 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.total_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">总消耗 Token 数。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens_details</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输出 Token 详情。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage.completion_tokens_details.reasoning_tokens</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left"><strong>思考过程消耗的 Token 数</strong>。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="AIGC%E7%94%9F%E6%96%87%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="AIGC%E7%94%9F%E6%96%87%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">AIGC生文调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%81%B56-%E9%BB%98%E8%AE%A4" name="%E4%BA%91%E7%81%B56-%E9%BB%98%E8%AE%A4">云灵6-默认</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0310003&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;你好，请介绍一下你自己&quot;
      }
    ]
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
    &quot;id&quot;: &quot;b2e34372-b1ff-4b09-a3fe-69054ca4f711&quot;,
    &quot;object&quot;: &quot;chat.completion&quot;,
    &quot;created&quot;: 1778575441,
    &quot;model&quot;: &quot;gemini-2.5-pro&quot;,
    &quot;choices&quot;: [
        {
            &quot;index&quot;: 0,
            &quot;message&quot;: {
                &quot;role&quot;: &quot;assistant&quot;,
                &quot;content&quot;: &quot;你好！很高兴认识你。\n\n我是一个大型语言模型，由 Google 训练和开发。\n\n你可以把我理解为一个非常博学、多才多艺的对话伙伴和助手。下面是一些关于我的关键信息：\n\n**我是什么？**\n* **一个人工智能程序：** 我没有实体，也没有个人情感、意识或经历。我的所有回答都是基于我从海量数据中学习到的模式和信息生成的。\n* **一个信息处理器：** 我的核心能力是理解和生成人类语言。我可以阅读、总结、翻译、改写和创作文本。\n\n**我能做什么？**\n* **回答问题：** 你可以问我关于历史、科学、文化、技术等几乎任何领域的问题。\n* **提供信息：** 需要查找资料、解释概念或获取数据时，我可以提供帮助。\n* **写作和创作：** 我可以帮你写文章、邮件、诗歌、故事、歌词，甚至是代码。\n* **头脑风暴：** 如果你需要创意或灵感，我们可以一起探讨想法。\n* **翻译语言：** 我可以进行多种语言之间的互译。\n* **总结和简化：** 我可以将复杂的长篇文章或概念总结成简单易懂的要点。\n\n**我的局限性：**\n* **我可能会犯错：** 虽然我力求准确，但我的信息并非总是完美的，有时可能会出错或过时。对于非常重要或专业的信息，建议你进行核实。\n* **我没有实时信息：** 我的知识有截止日期，对于刚刚发生的事件我可能不知情。\n* **我没有个人观点：** 我没有自己的喜好、信仰或观点。我提供的回答是基于数据的中立呈现。\n\n总而言之，我的目标是成为一个有用和无害的工具，为你提供帮助。\n\n所以，请随时向我提问任何你想知道的事情，或者让我帮你完成某项任务，我都会尽力而为！&quot;,
                &quot;reasoning_content&quot;: &quot;**My Self-Introduction Protocol**\n\nOkay, so the user&#39;s asked for an introduction (\&quot;你好，请介绍一下你自己\&quot;). Let&#39;s think this through like a pro. First, I need to break down the request. It&#39;s an open-ended \&quot;get-to-know-you\&quot; prompt, aiming for a helpful, clear, and concise overview. The tone needs to be friendly, professional, and informative – nothing overly complex, just direct and to the point.\n\nNow, let&#39;s map out the key information:\n\n* **Identity:** I’m an AI, a large language model. That&#39;s the foundation; it must be stated upfront.\n* **Origin:** Google is my creator. It&#39;s about attribution and credibility; this builds trust.\n* **Purpose:** I&#39;m here to help – provide information, write, translate, answer questions, you name it.\n* **Capabilities:** A bullet-point list is best for clarity. I can: answer questions, generate text (creative and practical), summarize, translate, assist with code, brainstorm ideas, explain concepts, and have conversations.\n* **Nature:** Crucially, I’m trained on massive datasets. I don&#39;t have consciousness, emotions, or personal experiences. It&#39;s key to set realistic expectations.\n* **Limitations:** Honesty is essential here. I can&#39;t think for myself, my knowledge is based on the data I was trained on (which has a cutoff date), I can make mistakes, and I can&#39;t perform real-world actions. No personal opinions, no physical body.\n* **Goal:** To be a helpful, useful tool for the user. I need to close with an invitation for questions.\n\nStructuring the response is next. I’ll start with a friendly greeting, followed by a clear statement of my identity (\&quot;我是一个大型语言模型，由 Google 训练\&quot;). Then, a clear and concise presentation of my capabilities: \&quot;我能做很多事情，就像一个多功能的数字助手,\&quot; and list out those capabilities: Answering questions, providing information, writing, translation, programming, brainstorming. Following that, I&#39;ll briefly explain how I work: Trained on data, lack of personal feelings/consciousness. The limitations are important: prone to errors; the knowledge isn&#39;t real-time, it&#39;s based on the training data. I&#39;ll finish with a friendly closing: My goal is to help you. Ask me anything, and I&#39;ll do my best to provide information!\n\nFinally, I&#39;ll review everything. Is it clear, concise, appropriate in tone? Does it answer the question comprehensively? Is the language natural and easy to understand? This structured approach ensures I deliver a response that&#39;s both informative and user-friendly, educating them about interacting with an AI at the same time.\n&quot;
            },
            &quot;finish_reason&quot;: &quot;stop&quot;
        }
    ],
    &quot;usage&quot;: {
        &quot;prompt_tokens&quot;: 7,
        &quot;prompt_tokens_details&quot;: {
            &quot;audio_tokens&quot;: 0,
            &quot;cached_tokens&quot;: 0
        },
        &quot;prompt_cached_tokens_details&quot;: {
            &quot;audio_tokens&quot;: 0
        },
        &quot;completion_tokens&quot;: 1749,
        &quot;completion_tokens_details&quot;: {
            &quot;accepted_prediction_tokens&quot;: 0,
            &quot;audio_tokens&quot;: 0,
            &quot;reasoning_tokens&quot;: 1320,
            &quot;rejected_prediction_tokens&quot;: 0
        },
        &quot;total_tokens&quot;: 1756
    }
}
</code></pre><p><span id="Hrya4y9k"></span></p>
<h3 id="%E4%BA%91%E7%81%B56-%E6%B5%81%E5%BC%8F" name="%E4%BA%91%E7%81%B56-%E6%B5%81%E5%BC%8F">云灵6-流式</h3>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/chat/completions?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0310003&quot;,
    &quot;stream&quot;: true,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;你好，请介绍一下你自己&quot;
      }
    ]
  }&#39;
</code></pre>
<p>响应示例：</p>
<pre><code class="lang-Curl">data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575506,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Defining the Objective**\n\nI&#39;ve started by parsing the user&#39;s prompt, isolating the core directive: \&quot;Introduce yourself.\&quot; Now I&#39;m shifting to how to deliver a response that&#39;s both accurate and engaging, considering the user&#39;s potential expectations.\n\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575509,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Outlining Key Capabilities**\n\nI&#39;m now prioritizing the \&quot;Capabilities\&quot; section of the introduction. I&#39;m focusing on user benefits: explaining what I *do* rather than just saying I process information. I&#39;m considering examples like answering questions, writing different text formats, summarizing content, and brainstorming ideas. I&#39;ll need to organize these into a clear, concise list for effective communication.\n\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575511,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Decomposing the Request**\n\nI&#39;m now fully immersed in dissecting the user&#39;s prompt. I&#39;ve broken down the request into key introduction elements: my identity, core function, capabilities (with specific user-oriented examples), limitations, interaction style, and a closing \&quot;call to action.\&quot; I&#39;m mentally drafting a concise outline for the self-introduction.\n\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575514,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Developing a Structure**\n\nI&#39;m now building the actual introduction, starting with a friendly greeting and my identity. I&#39;m focusing on a user-centric approach, emphasizing how I assist with information processing, answering questions, and acting as a creative partner. The next step is a clear, concise bullet-point list showcasing my capabilities, with examples.\n\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575517,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Constructing a Draft**\n\nI&#39;m now fully immersed in drafting the introduction. I&#39;ve built a user-centric template, starting with a greeting and identity statement in both English and Mandarin. I&#39;m carefully constructing the \&quot;Capabilities\&quot; section, ensuring specific examples are listed. Next is the section on limitations, and finally, I will add a call to action. I want to convey helpfulness and transparency.\n\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575520,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Fine-Tuning the Response**\n\nI&#39;m now refining the draft, focusing on improving the flow of the Chinese language version. I&#39;m reviewing phrasing and word choice to ensure clarity and natural-sounding sentences. Emphasis is on making the user experience friendly and approachable. The structure is now fully formed, ready for the final polishing touches.\n\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575521,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:null,&quot;reasoning_content&quot;:&quot;**Constructing a Comprehensive Response**\n\nI&#39;m now integrating all previous steps. I&#39;ve analyzed the user&#39;s prompt, outlined the key elements of my self-introduction, drafted a response, and refined the Chinese translation. This final stage involves confirming the tone and style, making sure I address the prompt&#39;s intent directly. I will ensure a helpful closing that encourages interaction.\n\n\n&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575521,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;你好！很高兴认识&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575521,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;你。\n\n我是一个大型语言模型，由 Google 训练而成。你可以把我理解成一个“来自数字世界的大脑”。\n\n我的主要工作是理解和生成人类语言，从而帮助你完成各种任务。具体来说，我可以做这些事情：\n\n* **回答问题**：我可以回答你&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575521,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;关于历史、科学、文化、生活常识等各种问题。\n* **创作文本**：我可以帮你写邮件、写文章、写诗歌、写故事，甚至是代码。\n* **翻译语言**：我能处理多种语言之间的翻译。\n* **总结归纳**：我可以&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575522,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;帮你把冗长的文章或报告总结成几个要点。\n* **头脑风暴**：如果你需要灵感，比如给项目起名、策划活动，我能为你提供一些新点子。\n* **解释概念**：我可以把复杂的概念用简单易懂的方式解释给你&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575523,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;听。\n\n**需要注意的是：**\n\n* 我没有自己的意识、情感或个人经历。我的所有回答都基于我所学习到的海量数据。\n* 我的知识可能不是最新的，对于非常重要或需要即时性的信息，建议你多方核实。\n* 我&quot;}}]}

data: {&quot;id&quot;:&quot;5c08eb3e-ec87-47af-b0e6-470e810ec651&quot;,&quot;object&quot;:&quot;chat.completion.chunk&quot;,&quot;created&quot;:1778575523,&quot;model&quot;:&quot;gemini-2.5-pro&quot;,&quot;choices&quot;:[{&quot;index&quot;:0,&quot;delta&quot;:{&quot;role&quot;:&quot;assistant&quot;,&quot;content&quot;:&quot;有时也可能会犯错，如果我的回答不准确，请随时指正。\n\n总而言之，你可以把我当作一个知识渊博、随时待命的助手。非常高兴能与你交流！\n\n现在，有什么可以帮你的吗？&quot;},&quot;finish_reason&quot;:&quot;stop&quot;}],&quot;usage&quot;:{&quot;prompt_tokens&quot;:6,&quot;prompt_tokens_details&quot;:{&quot;audio_tokens&quot;:0,&quot;cached_tokens&quot;:0},&quot;prompt_cached_tokens_details&quot;:{&quot;audio_tokens&quot;:0},&quot;completion_tokens&quot;:1788,&quot;completion_tokens_details&quot;:{&quot;accepted_prediction_tokens&quot;:0,&quot;audio_tokens&quot;:0,&quot;reasoning_tokens&quot;:1472,&quot;rejected_prediction_tokens&quot;:0},&quot;total_tokens&quot;:1794}}

data: [DONE]
</code></pre>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th style="text-align:left">HTTP状态码</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">200</td>
<td style="text-align:left">成功。</td>
</tr>
<tr>
<td style="text-align:left">400</td>
<td style="text-align:left">请求参数错误。例如，<code>model</code> 字段拼写错误、<code>messages</code> 格式不正确。</td>
</tr>
<tr>
<td style="text-align:left">401</td>
<td style="text-align:left"><strong>认证失败</strong>。请检查 <code>API Key</code> 是否正确，或者 <code>Authorization</code> 头格式是否为 <code>Bearer &lt;KEY&gt;</code>。</td>
</tr>
<tr>
<td style="text-align:left">403</td>
<td style="text-align:left">权限不足/已停服。可能原因：欠费、未开通该模型权限、<code>API Key</code> 无效。</td>
</tr>
<tr>
<td style="text-align:left">404</td>
<td style="text-align:left">模型/端点不存在。比如 model 名不支持；请求了错误的 path。</td>
</tr>
<tr>
<td style="text-align:left">429</td>
<td style="text-align:left">速率限制</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Tue, 19 May 2026 14:33:01 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1240</guid>
      <comments>http://doc.talkingdata.com/posts/1240#comments</comments>
    </item>
    <item>
      <title>TD云筑54/ali-happyhorse-1.0-video-edit</title>
      <link>http://doc.talkingdata.com/posts/1239</link>
      <category>视频生成 API</category>
      <author>liuxinmei</author>
      <description>云筑54 接口说明文档 TD模型编号：T0401004 模型能力简介 云筑54 视频编辑：支持输入视频与参考图，结合文本指令完成风格变换、局部替换等编辑任务。适合对已有视频进行精准编辑和内容修改。 鉴权说明  本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
 创建生视频任务接口地址 请求方法： POST 接口URL：https://modelpool-api.talkingdata.com/model/openai/api/v3/video-generation/video-synthesis 请求头（Request Headers）： 头部字段 值 是否必填 说明 Authorization Bearer &lt;your_api_key&gt; 是 API 鉴权凭证，请替</description>
      <content:encoded><![CDATA[<h4 id="%3Cstrong%3E%E4%BA%91%E7%AD%9154%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E" name="%3Cstrong%3E%E4%BA%91%E7%AD%9154%20%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3%3C%2Fstrong%3E"><strong>云筑54 接口说明文档</strong></h4>
<p><strong>TD模型编号：T0401004</strong></p>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B" name="%E6%A8%A1%E5%9E%8B%E8%83%BD%E5%8A%9B%E7%AE%80%E4%BB%8B">模型能力简介</h2>
<p><span id="Hrya4y9k"></span></p>
<ul>
<li><strong>云筑54</strong><ul>
<li><strong>视频编辑</strong>：支持输入视频与参考图，结合文本指令完成风格变换、局部替换等编辑任务。适合对已有视频进行精准编辑和内容修改。</li>
</ul>
</li>
</ul>
<h5 id="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B" name="%3Cstrong%3E%E9%89%B4%E6%9D%83%E8%AF%B4%E6%98%8E%3C%2Fstrong%3E%26nbsp%3B"><strong>鉴权说明</strong>&nbsp;</h5>
<pre><code>本接口仅支持API Key鉴权，需联系TD运维同学获取长效API Key。
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">创建生视频任务接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p><strong>请求方法：</strong> POST</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/video-generation/video-synthesis</code> </p>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<p><strong>请求参数（Request  Parameter）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>requestld</code></td>
<td style="text-align:left"><code>550e8400-e29b-41d4-a716-446655440000</code></td>
<td style="text-align:left">否</td>
<td style="text-align:left">请求唯一标识符。使用 UUID 格式字符串，用于跟踪和排查请求相关问题，以便在需要技术排查时，提供此 ID 可快速定位具体请求的完整处理链路和日志信息。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">创建生视频任务请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<h3 id="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89" name="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E8%AF%B7%E6%B1%82%E4%BD%93%EF%BC%88requestBody%EF%BC%89">创建生视频任务请求体（requestBody）</h3>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><strong>model</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">本次请求使用的模型编码。此值固定为 <strong><code>T0401004</code></strong>。</td>
</tr>
<tr>
<td style="text-align:left"><strong>input</strong></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">是</td>
<td style="text-align:left">输入的基本信息，包括待编辑的视频、参考图片和提示词。</td>
</tr>
<tr>
<td style="text-align:left">├─ <strong>prompt</strong></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">文本提示词，用来描述对视频的编辑意图，如风格转换、局部替换等。支持任何语言输入，长度不超过5000个非中文字符或2500个中文字符，超出部分会自动截断。</td>
</tr>
<tr>
<td style="text-align:left">├─ <strong>media</strong></td>
<td style="text-align:left">Array</td>
<td style="text-align:left">是</td>
<td style="text-align:left">媒体素材列表，用于指定待编辑的视频和参考图像。<strong>必须包含1个 <code>video</code> 类型元素</strong>，可选包含 <strong>0~5个 <code>reference_image</code> 类型元素</strong>。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>type</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">媒体素材类型。可选值： • <code>video</code>：必传，待编辑的视频。 • <code>reference_image</code>：可选，参考图像。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>url</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">媒体素材的URL地址（仅支持公网HTTP/HTTPS）。 <strong>视频限制</strong>（<code>type=video</code>）： • 格式：MP4、MOV（建议H.264编码）。 • 时长：3~60秒。 • 分辨率：长边不超过2160像素，短边不小于320像素。 • 宽高比：1:2.5 至 2.5:1 之间。 • 文件大小：不超过100MB。 • 帧率：大于8fps。 <strong>输出视频时长说明</strong>：当输入视频不超过15秒时，输出视频时长与输入视频保持一致；当输入视频超过15秒时，系统会从头开始自动截取前15秒作为有效片段，因此最长输出为15秒。 <strong>图像限制</strong>（<code>type=reference_image</code>）： • 格式：JPEG、JPG、PNG、WEBP。 • 分辨率：宽高尺寸不小于300像素。 • 宽高比：1:2.5 至 2.5:1 之间。 • 文件大小：不超过20MB。 • 支持公网URL或Base64编码（格式：<code>data:{MIME_type};base64,{base64_data}</code>）。</td>
</tr>
<tr>
<td style="text-align:left"><strong>parameters</strong></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">否</td>
<td style="text-align:left">视频编辑参数，如设置视频分辨率等。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>resolution</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">生成视频的分辨率档位，用于控制视频的清晰度。可选值：<code>720P</code>、<code>1080P</code>。默认值为 <code>1080P</code>。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>watermark</code></td>
<td style="text-align:left">Boolean</td>
<td style="text-align:left">否</td>
<td style="text-align:left">是否在生成的视频右下角添加“Happy Horse”字样的水印。<code>true</code>（默认）添加水印，<code>false</code> 不添加。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>audio_setting</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">否</td>
<td style="text-align:left">声音控制。可选值： • <code>auto</code>：默认值，由模型自行控制。 • <code>origin</code>：保留输入视频的原始声音。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>seed</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">否</td>
<td style="text-align:left">随机数种子，用于结果复现。取值范围 <code>[0, 2147483647]</code>。不指定时系统自动生成随机种子。若需提升生成结果的可复现性，建议固定 seed 值。请注意，由于模型生成具有概率性，即使使用相同 seed，也不能保证每次生成结果完全一致。</td>
</tr>
</tbody>
</table>
<p><span id="Hrya4y9k"></span></p>
<h2 id="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0" name="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E8%BF%94%E5%9B%9E%E5%8F%82%E6%95%B0">创建生视频任务返回参数</h2>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>output</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">任务输出信息。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>task_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">异步任务ID，用于后续查询任务状态与结果。有效期为24小时。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>task_status</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">任务创建后的初始状态，通常为 <code>PENDING</code>（排队中）或 <code>RUNNING</code>（处理中）。</td>
</tr>
<tr>
<td style="text-align:left"><code>request_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">唯一请求ID，由服务端生成，可用于请求明细溯源和问题排查。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="%E5%88%9B%E5%BB%BA%E7%94%9F%E8%A7%86%E9%A2%91%E4%BB%BB%E5%8A%A1%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">创建生视频任务调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X POST &#39;https://modelpool-api.talkingdata.com/model/openai/api/v3/video-generation/video-synthesis?requestId=550e8400-e29b-41d4-a716-446655440000&#39; \
  -H &#39;Content-Type: application/json&#39; \
  -H &#39;Authorization: Bearer YOUR_API_KEY&#39; \
  -H &#39;X-Timestamp: 1760000000&#39; \
  -d &#39;{
    &quot;model&quot;: &quot;T0401004&quot;,
    &quot;input&quot;: {
        &quot;prompt&quot;: &quot;让视频中的马头人身角色穿上图片中的条纹毛衣&quot;,
        &quot;media&quot;: [
            {
                &quot;type&quot;: &quot;video&quot;,
                &quot;url&quot;: &quot;https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260409/dozxak/Wan_Video_Edit_33_1.mp4&quot;
            },
            {
                &quot;type&quot;: &quot;reference_image&quot;,
                &quot;url&quot;: &quot;https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260415/hynnff/wan-video-edit-clothes.webp&quot;
            }
        ]
    },
    &quot;parameters&quot;: {
        &quot;resolution&quot;: &quot;720P&quot;
    }
}&#39;
</code></pre>
<p>响应示例：</p>
<pre><code>{
    &quot;output&quot;: {
        &quot;task_status&quot;: &quot;RUNNING&quot;,
        &quot;task_id&quot;: &quot;c39df2cb-66ac-4068-82d3-1ae6382dc3af&quot;
    },
    &quot;request_id&quot;: &quot;f8c9dc08-b5f2-96b2-9029-58434acf2912&quot;
}
</code></pre><hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%AF%A6%E6%83%85%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80" name="%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%AF%A6%E6%83%85%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80">查询任务详情接口地址</h2>
<p><span id="Hrya4y9k"></span></p>
<p>根据提交任务时返回的 <code>task_id</code>，查询视频生成任务的详细执行状态和结果。</p>
<p><strong>请求方法：</strong> GET</p>
<p><strong>接口URL：</strong><code>https://modelpool-api.talkingdata.com/model/openai/api/v3/tasks/{taskId}</code> </p>
<blockquote>
<p>请将URL中的 <code>{taskId}</code> 替换为实际的 <code>task_id</code> 值。</p>
</blockquote>
<p><strong>请求头（Request Headers）：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">头部字段</th>
<th style="text-align:left">值</th>
<th style="text-align:left">是否必填</th>
<th style="text-align:left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>Authorization</code></td>
<td style="text-align:left"><code>Bearer &lt;your_api_key&gt;</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">API 鉴权凭证，请替换为有效的 API Key</td>
</tr>
<tr>
<td style="text-align:left"><code>X-Timestamp</code></td>
<td style="text-align:left"><code>1700000000</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">Unix 时间戳格式</td>
</tr>
<tr>
<td style="text-align:left"><code>Content-Type</code></td>
<td style="text-align:left"><code>application/json</code></td>
<td style="text-align:left">是</td>
<td style="text-align:left">请求体格式必须为 JSON</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%AF%A6%E6%83%85%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0" name="%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%AF%A6%E6%83%85%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0">查询任务详情接口请求参数</h2>
<p><span id="Hrya4y9k"></span></p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">必选</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>taskId</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">是</td>
<td style="text-align:left">视频生成任务的任务ID，由创建任务接口返回。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%AF%A6%E6%83%85%E6%8E%A5%E5%8F%A3%E5%93%8D%E5%BA%94%E5%8F%82%E6%95%B0" name="%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%AF%A6%E6%83%85%E6%8E%A5%E5%8F%A3%E5%93%8D%E5%BA%94%E5%8F%82%E6%95%B0">查询任务详情接口响应参数</h2>
<p><span id="Hrya4y9k"></span></p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">类型</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>output</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">任务执行的详细信息。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>task_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">任务ID，查询有效期24小时。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>task_status</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">任务状态。可能值：<code>PENDING</code>（排队中）、<code>RUNNING</code>（处理中）、<code>SUCCEEDED</code>（成功）、<code>FAILED</code>（失败）、<code>CANCELED</code>（已取消）、<code>UNKNOWN</code>（不存在或已过期）。轮询过程中的状态流转：PENDING → RUNNING → SUCCEEDED/FAILED。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>submit_time</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">任务提交时间。格式：<code>YYYY-MM-DD HH:mm:ss.SSS</code>。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>scheduled_time</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">任务开始执行的时间。格式：<code>YYYY-MM-DD HH:mm:ss.SSS</code>。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>end_time</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">任务完成时间。格式：<code>YYYY-MM-DD HH:mm:ss.SSS</code>。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>orig_prompt</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">创建任务时输入的原始提示词，对应请求参数中的 <code>prompt</code>。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>video_url</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">视频下载链接。<strong>仅在 <code>task_status</code> 为 <code>SUCCEEDED</code> 时返回</strong>。视频格式为MP4（H.264编码），链接有效期为24小时。建议在获取链接后立即下载并转存至永久存储。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>code</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">错误码。请求失败时返回，成功时不返回。详情请参见错误码部分。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>message</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">错误详细信息。请求失败时返回，成功时不返回。</td>
</tr>
<tr>
<td style="text-align:left"><code>usage</code></td>
<td style="text-align:left">Object</td>
<td style="text-align:left">输出信息统计，只对成功的结果计数，用于计费参考。仅在任务成功时可能返回。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>duration</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">生成视频的总视频时长，用于计费，单位秒。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>input_video_duration</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">输入视频的时长，单位秒。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>output_video_duration</code></td>
<td style="text-align:left">Float</td>
<td style="text-align:left">输出视频的时长，单位秒。</td>
</tr>
<tr>
<td style="text-align:left">├─ <code>video_count</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">生成视频的数量，固定为 <code>1</code>。</td>
</tr>
<tr>
<td style="text-align:left">└─ <code>SR</code></td>
<td style="text-align:left">Integer</td>
<td style="text-align:left">生成视频的分辨率档位。<code>720</code> 对应720P；<code>1080</code> 对应1080P。</td>
</tr>
<tr>
<td style="text-align:left"><code>request_id</code></td>
<td style="text-align:left">String</td>
<td style="text-align:left">唯一请求ID，可用于请求明细溯源和问题排查。</td>
</tr>
</tbody>
</table>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%AF%A6%E6%83%85%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B" name="%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%AF%A6%E6%83%85%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E7%A4%BA%E4%BE%8B">查询任务详情接口调用示例</h2>
<p><span id="Hrya4y9k"></span></p>
<p>请求示例：</p>
<pre><code class="lang-Curl">curl -X GET https://modelpool-api.talkingdata.com/model/openai/api/v3/tasks/c39df2cb-66ac-4068-82d3-1ae6382dc3af \
--header &quot;Authorization: Bearer YOUR_API_KEY&quot; \
--header &quot;Content-Type: application/json&quot; \
--header &quot;X-Timestamp: 1760000000&quot;
</code></pre>
<p>响应示例：</p>
<pre><code class="lang-Curl">{
    &quot;output&quot;: {
        &quot;task_status&quot;: &quot;SUCCEEDED&quot;,
        &quot;orig_prompt&quot;: &quot;让视频中的马头人身角色穿上图片中的条纹毛衣&quot;,
        &quot;video_url&quot;: &quot;https://dashscope-a717.oss-accelerate.aliyuncs.com/1d/0c/20260511/007a70ae/49216773-0edUXKVU_5399c2abd171_merged.mp4?Expires=1778570307&amp;OSSAccessKeyId=LTAI5tPxpiCM2hjmWrFXrym1&amp;Signature=DvEWY4SfmthyX9rbgwJI%2BVpH8B4%3D&quot;,
        &quot;submit_time&quot;: &quot;2026-05-11 15:16:55.377&quot;,
        &quot;end_time&quot;: &quot;2026-05-11 15:18:27.714&quot;,
        &quot;task_id&quot;: &quot;c39df2cb-66ac-4068-82d3-1ae6382dc3af&quot;,
        &quot;scheduled_time&quot;: &quot;2026-05-11 15:16:55.417&quot;
    },
    &quot;usage&quot;: {
        &quot;duration&quot;: 12,
        &quot;input_video_duration&quot;: 6,
        &quot;output_video_duration&quot;: 6,
        &quot;video_count&quot;: 1,
        &quot;SR&quot;: 720
    },
    &quot;request_id&quot;: &quot;6786140b-3d5e-9ab6-8b03-a6a2e994d630&quot;
}
</code></pre>
<hr>
<p><span id="7P96iLnc"></span></p>
<h2 id="%E9%94%99%E8%AF%AF%E7%A0%81" name="%E9%94%99%E8%AF%AF%E7%A0%81">错误码</h2>
<table>
<thead>
<tr>
<th style="text-align:left">错误码</th>
<th style="text-align:left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>InvalidApiKey</code></td>
<td style="text-align:left">API Key无效或未提供。</td>
</tr>
<tr>
<td style="text-align:left"><code>InvalidParameter</code></td>
<td style="text-align:left">请求参数不合法。请检查参数值是否符合文档要求。</td>
</tr>
<tr>
<td style="text-align:left"><code>InternalError</code></td>
<td style="text-align:left">服务内部错误。请稍后重试，若问题持续存在请联系技术支持。</td>
</tr>
</tbody>
</table>
]]></content:encoded>
      <pubDate>Wed, 13 May 2026 13:56:32 +0800</pubDate>
      <guid>http://doc.talkingdata.com/posts/1239</guid>
      <comments>http://doc.talkingdata.com/posts/1239#comments</comments>
    </item>
  </channel>
</rss>