主题
获取 Claude LLM Responses 任务结果
通过本接口,可根据任务 id 获取指定 Claude 模型生成的结构化响应结果。
标准模式提交的任务最长可能需要 72 小时完成。如果在该时限仍未完成,任务会被标记为失败,预扣的 USD 0.01 将退回。按换算口径,参考价约 ¥0.1600 / 次预扣。 另请注意:如果账户余额为负,即使任务执行成功,也无法获取结果。
接口地址
GET https://api.seermartech.cn/v3/ai_optimization/claude/llm_responses/task_get/$id
计费说明
本接口不会因重复获取结果而重复收费。费用只在创建任务时扣除,任务结果可在30 天获取。 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
路径参数
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。任务创建后可在 30 天 随时使用该 id 获取结果。 |
返回结构
接口返回 JSON 数据,顶层 tasks 数组,每个任务对象对应一个获取结果。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用状态码。完整错误码可参考 /v3/appendix/errors。建议对异常状态进行统一处理。 |
status_message | string | 通用状态信息。 |
time | string | 执行耗时,单位秒。 |
cost | float | 本次请求总成本,单位 USD。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
tasks 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。 |
status_code | integer | 任务状态码,范围通常为 10000-60000。完整列表参考 /v3/appendix/errors。 |
status_message | string | 任务状态说明。 |
time | string | 任务执行耗时,单位秒。 |
cost | float | 任务成本,单位 USD。基础任务价格与 money_spent。 |
result_count | integer | result 数组中的数量。 |
path | array | 请求路径。 |
data | object | 与创建任务时 POST 请求中传的参数一致。 |
result | array | 返回结果数组。 |
result 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
model_name | string | 实使用的 AI 模型名称。 |
input_tokens | integer | token 数,总处理量。 |
output_tokens | integer | 输出 token 数,表示模型生成的 token 总量。 |
reasoning_tokens | integer | 推理 token 数,用于生成 reasoning。 |
web_search | boolean | 是否启用了联网搜索。 |
money_spent | float | AI token 实消耗成本,单位 USD。该费用由第三方模型提供方产生。 |
datetime | string | 结果生成时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。例如:2019-11-15 12:57:46 +00:00 |
items | array | 响应数组,结构化 AI 输出。 |
fan_out_queries | array | 扩展查询数组,表示系统围绕主问题派生出的检索词。 |
items结构
items 中通常 reasoning 和 message 两类。
reasoning 对象
在支持推理的模型中返回,不保证一定出现。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 reasoning。 |
sections | array | 推理链分段数组。 |
reasoning.sections 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 summary_text。 |
text | string | 推理链摘要文本,用于概括模型思考过程。 |
message 对象
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 message。 |
sections | array | AI 响应分段。 |
message.sections 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 text。 |
text | string | AI 生成的文本。 |
annotations | array | 生成时引用的来源列表;如果 web_search=false,该字段为 null。即使 web_search=true,如果未检索到可引用结果,也可能返回空。 |
annotations 字段
| 字段 | 类型 | 说明 |
|---|---|---|
title | string | 引用来源的域名或标题。 |
url | string | 引用来源链接。 |
请求示例
cURL
bash
# 将 task_id 替换为创建任务后返回的任务 ID
task_id="02031608-0696-0110-0000-a81d0414edbe"
curl --location --request GET "https://api.seermartech.cn/v3/ai_optimization/claude/llm_responses/task_get/${task_id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "07211938-0696-0613-0000-674a0f948d6b"
url = f"https://api.seermartech.cn/v3/ai_optimization/claude/llm_responses/task_get/{task_id}"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json)
# 可在此处理任务结果TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios({
method: "get",
url: `https://api.seermartech.cn/v3/ai_optimization/claude/llm_responses/task_get/${taskId}`,
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
})
.then((response) => {
console.log(response.data);
// 可在此处理任务结果
})
.catch((error) => {
console.error(error);
});响应示例
json
{
"version": "0.1.20250724",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0849 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "07211938-0696-0613-0000-674a0f948d6b",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0211 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"ai_optimization",
"claude",
"llm_responses",
"task_get",
"07211938-0696-0613-0000-674a0f948d6b"
],
"data": {
"api": "ai_optimization",
"function": "llm_responses",
"se": "claude",
"system_message": "communicate as if we are in a business meeting",
"message_chain": [],
"max_output_tokens": 1024,
"temperature": 0.3,
"top_p": 0.5,
"web_search_country_iso_code": "FR",
"model_name": "claude-sonnet-4-0",
"web_search": true,
"user_prompt": "provide information on how relevant the amusement park business is in France now"
},
"result": [
{
"model_name": "claude-sonnet-4-0",
"input_tokens": 0,
"output_tokens": 0,
"reasoning_tokens": 0,
"web_search": true,
"money_spent": 0,
"datetime": "2025-07-24 12:57:46 +00:00",
"items": [
{
"type": "message",
"sections": [
{
"type": "text",
"text": "## Leading Market Players",
"annotations": null
},
{
"type": "text",
"text": "2,842,000 visitors in 2024, establishing a new record",
"annotations": [
{
"title": "example.com",
"url": "https://example.com/source-1"
}
]
},
{
"type": "text",
"text": "The global amusement parks market size was estimated at USD 102.67 billion in 2024 and is projected to reach USD 149.32 billion by 2030.",
"annotations": [
{
"title": "example.org",
"url": "https://example.org/report"
}
]
}
]
}
],
"fan_out_queries": [
"France amusement park market size",
"French theme park attendance 2024"
]
}
]
}
]
}状态码与错误处理
- 顶层
status_code表示整个请求的处理状态。 tasks[].status_code表示单个任务的处理状态。- 建议同时校验这两个字段,“请求成功但任务失败”被误判为成功。
- 完整状态码与错误说明请参考
/v3/appendix/errors。
常见处理建议:
- 顶层
status_code != 20000:说明接口请求本身失败,应直接错误处理流程。 - 顶层成功但
tasks_error > 0:说明至少有一个任务返回异常,应逐个检查tasks[].status_code。 - 任务仍在处理中:可稍后使用相同
id再次调用本接口查询。 4.过 72 小时未完成:任务会标记为失败,预扣费用退回。 - 账户余额为负:即使任务已完成,也无法返回结果。
使用说明
- 该接口用于按任务 ID 获取结果,不能创建新任务。
- 任务提交后,建议保存返回的
id,作为后续轮询查询的唯一依据。 - 若启用了
web_search,可结合annotations和fan_out_queries分析模型引用来源与扩展检索路径。 data字段可用于回溯任务提交时的原始参数,便于日志审计和结果对账。
实用场景
- 轮询异步任务结果:在批量提交 AI 分析任务后,按
id定时拉取完成结果,支撑稳定的异步处理流程。 - 审查 AI 输出引用来源:通过
annotations查看模型引用的网站与链接,评估回答可追溯性与可信度。 - 统计模型消耗成本:结合
input_tokens、output_tokens、reasoning_tokens与money_spent,核算不同任务的生成成本。 - 分析联网搜索覆盖度:通过
web_search、annotations与fan_out_queries判断模型是否有效使用外部信息,优化提示词和检索策略。 - 沉淀行业研究结果:将
message.sections中的结构化文本结果直接库,用于竞品研究、市场洞察和 SEO策划。