主题
获取 Chat GPT LLM Responses 任务结果
接口说明
该接口用于按任务 ID 获取 Chat GPT 模型生成的结构化响应结果。你可以在创建任务后,使用返回的任务标识查询处理结果。
需要注意:
- 使用 Standard 方式提交的任务,最长可能需要 72 小时完成
- 如果任务在 72 小时仍未完成,会被标记为失败,预扣费用会退回
- 如果账户余额为负,即使任务已成功完成,也无法获取结果
- 任务结果可在任务创建后的 30 天重复拉取,不会重复收费
请求方式: GET接口地址: https://api.seermartech.cn/v3/ai_optimization/chat_gpt/llm_responses/task_get/$id
计费说明
本接口在创建任务时计费,后续 30 天获取结果。
如按平台基础预扣金额 $0.01 估算,参考价约 ¥0.1600 / 次。 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
路径参数
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。该 ID 可在 30 天用于随时查询任务结果。 |
响应结构
接口返回 JSON 数据,顶层 tasks 数组,每个任务对应一条结果。
顶层字段
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本号。 |
status_code | integer | 通用状态码。完整错误码参见 /v3/appendix/errors。建议在系统中实现完整的异常处理逻辑。 |
status_message | string | 通用状态信息。完整状态说明参见 /v3/appendix/errors。 |
time | string | 执行耗时,单位秒。 |
cost | float | 本次请求总成本,单位 USD。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
tasks[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
id | string | 任务 ID,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 | 实结果数组。 |
tasks[].result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
model_name | string | 实使用的 AI 模型名称。 |
input_tokens | integer | 消耗的 token 总数。 |
output_tokens | integer | 输出生成的 token 总数。 |
reasoning_tokens | integer | 用于推理生成的 token 数量。 |
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 未设置为 true,该字段为 null。即使启用了网页搜索,也可能为空,表示模型尝试检索但未找到合适引用。 |
annotations[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
title | string | 引用来源的域名或标题。 |
url | string | 引用来源 URL。 |
请求示例
cURL
bash
id="02031608-0696-0110-0000-a81d0414edbe"
curl --location --request GET "https://api.seermartech.cn/v3/ai_optimization/chat_gpt/llm_responses/task_get/${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/chat_gpt/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/chat_gpt/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.0312 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"ai_optimization",
"chat_gpt",
"llm_responses",
"task_get",
"07211938-0696-0613-0000-674a0f948d6b"
],
"data": {
"api": "ai_optimization",
"function": "llm_responses",
"se": "chat_gpt",
"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": "gpt-4.1-mini",
"web_search": true,
"user_prompt": "provide information on how relevant the amusement park business is in France now"
},
"result": [
{
"model_name": "gpt-4.1-mini",
"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": "法国游乐园行业目前仍较高市场性,受业、家庭娱乐消费和大型主题园持续带动。回答中可市场规模、主要园区、技术趋势、成本压力等。",
"annotations": [
{
"title": "示例来源 1",
"url": "https://example.com/source-1"
},
{
"title": "示例来源 2",
"url": "https://example.com/source-2"
}
]
}
]
}
],
"fan_out_queries": [
"france amusement park market size",
"disneyland paris attendance",
"france tourism leisure trends"
]
}
]
}
]
}状态码与错误处理
建议至少按以下层级处理错误:
- HTTP 层错误:如
401、404、500 - 顶层状态错误:检查
status_code和status_message - 任务级错误:遍历
tasks[],检查每个任务的status_code - 结果未就绪:任务可能仍在处理中,应结合状态码与任务状态说明进行重试
- 结果为空:
result_count = 0时表示暂未返回可用结果或任务失败
完整错误码说明请参考 /v3/appendix/errors。
使用说明
- 通过对应的创建任务接口创建 LLM Responses 任务
- 记录返回的任务 ID
- 使用本接口按 ID 轮询任务状态与结果
- 当任务完成后,从
tasks[].result[]中解析模型输出 - 如启用了网页搜索,可进一步读取
annotations与fan_out_queries做来源分析和扩展研究
实用场景
- 追踪问答结果落地:获取指定提示词的最终结构化回答,用于评估 AI 对品牌、产品或行业问题的输出效果。
- 提取引用来源做审校:读取
annotations中的来源网址,核查 AI 回答是否引用了可信站点,降低事实性风险。 - 分析模型推理与输出成本:结合
input_tokens、output_tokens、reasoning_tokens和money_spent,评估不同提示词方案的成本与产出比。 - 挖掘扩展搜索意图:利用
fan_out_queries发现模型围绕主问题延展出的检索词, SEO 选题和补。 - 监控地区化行业洞察生成结果:结合
web_search_country_iso_code与回答,验证模型在特定国家/地区场景下的行业分析是否。