模型
查询生成记录
按生成 ID 查询一次调用的费用、用量与延迟;记录在调用完成后几秒内可查,此前返回 404,稍后重试即可。
先调用「对话」,从响应头 X-Praxis-Generation-Id 取得 id,替换 gen_123。
GET
/model/v1/generation● 支持请求参数
idstring必填◐ 部分支持query: Generation ID from the X-Praxis-Generation-Id response header of the model request.
使用 /model 响应头 X-Praxis-Generation-Id;响应体 id 和 X-Request-Id 不能查询,返回 404。
返回
200
鉴权、限流、参数校验等平台错误按 problem+json 返回;OCR 的错误也为 problem+json,其它模型调用的错误按该端点所属格式(OpenAI 或 Anthropic)返回,参见 错误码
响应
HTTP 200
Generation record
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Generation id that was queried. |
| model | string | Model that served the generation. |
| cost | number | null | Cost charged for the generation in USD; null when not yet priced. |
| usage | object | Token usage of the generation. |
| usage.prompt_tokens | number | Number of prompt tokens. |
| usage.completion_tokens | number | Number of tokens in the completion. |
| usage.total_tokens | number | Prompt plus completion tokens. |
| usage.cached_input_tokens | number | Prompt tokens served from the prompt cache; null when not reported. |
| latency_ms | number | null | Latency of the generation in milliseconds; null when not recorded. |
| created | number | Unix time in seconds at which the generation was recorded. |