查询生成内容

GET/v1/generation/content

查询一次生成请求保存的输入和输出内容。

使用原始模型响应头中的 X-Trace-ID 作为 generation 查询 ID。如果 X-Trace-IDX-Request-ID 不同,本接口使用 X-Trace-ID。不要使用响应体里的 id,例如 chatcmpl_...

认证

Authorization Bearer

在 Authorization 请求头中使用 API Key 作为 Bearer Token。

查询参数

idstringrequired

原始模型响应头中的 X-Trace-ID。如果 X-Trace-ID 与 X-Request-ID 不同,请使用 X-Trace-ID,而不是响应体 id。

Response

dataobject

保存的生成内容。

data.inputobject | null

可用时返回原始请求载荷。

data.outputobject | null

可用时返回清理后的响应载荷。字段形态可能因模型而异,例如聊天 choices、图片 data 数组或视频任务字段。文本和视觉模型会省略 upstream_usage、usage_from_upstream 等内部上游用量诊断字段;如需用量,请使用 data.output.usage。

错误

  • 400:缺少必填的 id 查询参数。
  • 401:缺少或无效的 Authorization
  • 404:生成记录不存在,或当前认证 API Key 无权访问。

请求

Shell
1curl "https://api.token360.ai/v1/generation/content?id={request_id}" \
2  -H "Authorization: Bearer sk-your-api-key"

响应

JSON
1{
2  "data": {
3    "input": {
4      "max_completion_tokens": 8,
5      "messages": [
6        {
7          "content": "Reply with exactly: ok",
8          "role": "user"
9        }
10      ],
11      "model": "qwen3.6-plus",
12      "temperature": 0
13    },
14    "output": {
15      "choices": [
16        {
17          "finish_reason": "stop",
18          "index": 0,
19          "message": {
20            "content": "ok",
21            "reasoning": "The model reasoning output when available.",
22            "role": "assistant"
23          }
24        }
25      ],
26      "created": 1780973148,
27      "id": "chatcmpl-eb6380452ba9ad685c22db5c",
28      "object": "chat.completion",
29      "usage": {
30        "completion_tokens": 149,
31        "completion_tokens_details": {
32          "reasoning_tokens": 143,
33          "text_tokens": 149
34        },
35        "prompt_tokens": 15,
36        "prompt_tokens_details": {
37          "text_tokens": 15
38        },
39        "total_tokens": 164
40      }
41    }
42  }
43}
此页面对您有帮助吗?