client.getGeneration()。
示例
参数
id(字符串,必填):之前调用返回的请求 ID。
返回值
生成记录(JSON) 如果网关保存了完整请求详情,返回记录会包含replay_supported 和 replay_request。将 replay_request 发回原端点即可受控地重新运行请求。
时间字段遵循网关统一语义:
latency_ms:记录到的首个 token 或首个输出字节/帧的耗时generation_ms:记录到的延迟后生成耗时
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
调用 /generation 获取以前的生成记录。
client.getGeneration()。
const record = await client.getGeneration("G-01ABC...");
id(字符串,必填):之前调用返回的请求 ID。replay_supported 和 replay_request。将 replay_request 发回原端点即可受控地重新运行请求。
时间字段遵循网关统一语义:
latency_ms:记录到的首个 token 或首个输出字节/帧的耗时generation_ms:记录到的延迟后生成耗时{
"created_at": "2026-05-05T12:00:00.000Z",
"request_id": "G-01ABC123",
"team_id": "team-123",
"app_id": "app-123",
"endpoint": "chat/completions",
"model_id": "openai/gpt-4o-mini",
"provider": "openai",
"native_response_id": "chatcmpl-123",
"stream": false,
"byok": false,
"status_code": 200,
"success": true,
"error_code": null,
"error_message": null,
"latency_ms": 1500,
"generation_ms": 1400,
"usage": {
"prompt_tokens": 9,
"completion_tokens": 9,
"total_tokens": 18
},
"cost_nanos": 1000000,
"currency": "USD",
"pricing_lines": [],
"key_id": "key-123",
"throughput": null,
"replay_supported": true,
"replay_request": {
"model": "openai/gpt-4o-mini",
"messages": [
{ "role": "user", "content": "Say hello" }
]
}
}