模型

查询生成记录

按生成 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

名称类型说明
idstringGeneration id that was queried.
modelstringModel that served the generation.
costnumber | nullCost charged for the generation in USD; null when not yet priced.
usageobjectToken usage of the generation.
usage.prompt_tokensnumberNumber of prompt tokens.
usage.completion_tokensnumberNumber of tokens in the completion.
usage.total_tokensnumberPrompt plus completion tokens.
usage.cached_input_tokensnumberPrompt tokens served from the prompt cache; null when not reported.
latency_msnumber | nullLatency of the generation in milliseconds; null when not recorded.
creatednumberUnix time in seconds at which the generation was recorded.