From d51018aeff747242357f310d453281af3b811408 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 11 Jun 2026 15:59:30 +0800 Subject: [PATCH] docs: add GET /v1/pricing endpoint to API documentation --- wwwroot/api_doc.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/wwwroot/api_doc.md b/wwwroot/api_doc.md index c932348..1f345ae 100644 --- a/wwwroot/api_doc.md +++ b/wwwroot/api_doc.md @@ -1145,6 +1145,67 @@ curl 'https://token.opencomputing.cn/llmage/v1/models/catelog?catelogid=t2i' \ --- +## GET /v1/pricing + +获取模型定价展示信息,根据模型名称查询其关联的定价程序并返回可读的定价文本。 + +### 必填参数 + +| 参数 | 类型 | 说明 | +|------|------|------| +| `model` | string | 模型名称,如 `"qwen3.7-max"` | + +### 可选参数 + +| 参数 | 类型 | 说明 | +|------|------|------| +| `catelogid` | string | 目录类型ID,默认 `"t2t"` | + +### 请求示例 + +``` +GET /llmage/v1/pricing?model=qwen3.7-max +``` + +```bash +curl 'https://token.opencomputing.cn/llmage/v1/pricing?model=qwen3.7-max' \ + -H 'Authorization: Bearer *** +``` + +### 响应格式 + +```json +{ + "status": "ok", + "data": { + "ppid": "pp_xxx", + "name": "qwen3.7-max", + "pricing_type": "per_use", + "display_text": "【通义千问 qwen3.7-max】定价:\n - 输入Token: 12 元/百万 [模型=qwen3.7-max]\n - 输出Token: 48 元/百万 [模型=qwen3.7-max]", + "items": [ + { + "factor": "输入Token", + "price": 12, + "unit": "百万", + "filters": "模型=qwen3.7-max" + } + ] + } +} +``` + +### 错误响应 + +```json +{"status": "error", "message": "model parameter required"} +``` + +```json +{"status": "error", "message": "model 'xxx' not found or has no pricing"} +``` + +--- + ## 通用说明 ### catelogid 目录类型ID对照表