查询 RDS AI 助手旗舰版的 Token 使用记录。
接口说明
适用引擎
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
rdsai:DescribeMOTokenUsageDetail |
get |
*全部资源
|
无 | 无 |
请求语法
GET HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Region |
string |
否 |
实例所在地域。 |
cn-beijing |
| InstanceId |
string |
是 |
实例名 |
rds_copilot***_public_cn-*********6 |
| ApiKey |
string |
否 |
使用的 ApiKey |
sk-rds-***** |
| UsageType |
string |
否 |
查看类型 |
text |
| ConsumerName |
string |
否 |
api key 对应的 consumer |
16******4_rds_copilot****_public_cn-4****02 |
| Model |
string |
否 |
调用的模型 |
qwen-flash |
| StartTime |
string |
否 |
开始时间(ISO8601 格式,UTC 时间) |
2026-01-04T16:00:00Z |
| EndTime |
string |
否 |
结束时间(格式:ISO8601 格式,UTC 时间) |
2025-12-13T16:00:00Z |
| Cursor |
string |
否 |
游标翻页令牌,优先级高于 |
eyJpZCI6MTIzNDUsInRzIjoiMjAyNi0wNC0wOFQwMDowMDowMFoifQ== |
| Page |
integer |
否 |
页码。起始值:1。默认值:1。 |
2 |
| PageSize |
integer |
否 |
每页记录数。 |
10 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
FE9C65D7-930F-57A5-A207-8C396329241C |
| TotalCount |
integer |
TotalCount 本次请求条件下的数据总量 |
20 |
| NextCursor |
string |
下一页游标;空表示已到末页 |
eyJpZCI6MTIzNDUsInRzIjoiMjAyNi0wNC0wOFQwMDowMDowMFoifQ== |
| PageSize |
integer |
每页记录数。 |
10 |
| Page |
integer |
页码 |
1 |
| Records |
array<object> |
返回结果的记录列表。 |
|
|
object |
Token 使用记录 |
||
| Region |
string |
实例所在地域。 |
cn-beijing |
| InstanceId |
string |
实例名 |
rds_copilot***_public_cn-*********6 |
| ConsumerName |
string |
api key 对应的 consumer |
16******4_rds_copilot****_public_cn-4****02 |
| Model |
string |
调用的模型 |
qwen-flash |
| TotalTokens |
number |
总 Token 数 |
100000 |
| InputTokens |
number |
token 输入使用量 |
10000 |
| OutputTokens |
number |
token 输出使用量 |
10000 |
| RequestTime |
string |
请求时间(ISO8601 格式,UTC 时间) |
2026-04-01T01:00:00Z |
| ExtraInfo |
string |
用户在请求时传入 extra_info 的额外信息字段,json 字符串 |
{"label": "test"} |
| CacheTokens |
number |
token 输入缓存命中量 |
8000 |
| UsageType |
string |
类型 |
text |
示例
正常返回示例
JSON格式
{
"RequestId": "FE9C65D7-930F-57A5-A207-8C396329241C",
"TotalCount": 20,
"NextCursor": "eyJpZCI6MTIzNDUsInRzIjoiMjAyNi0wNC0wOFQwMDowMDowMFoifQ==",
"PageSize": 10,
"Page": 1,
"Records": [
{
"Region": "cn-beijing",
"InstanceId": "rds_copilot***_public_cn-*********6",
"ConsumerName": "16******4_rds_copilot****_public_cn-4****02",
"Model": "qwen-flash",
"TotalTokens": 100000,
"InputTokens": 10000,
"OutputTokens": 10000,
"RequestTime": "2026-04-01T01:00:00Z",
"ExtraInfo": "{\"label\": \"test\"}",
"CacheTokens": 8000
}
],
"UsageType": "text"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | MoQueryRangeTooLargeError | Usage detail query time range is too large. | |
| 400 | MoQueryBeforeRetentionError | Usage detail query is earlier than RDS retention and archive query is not enabled. | |
| 400 | MoExportBeforeRetentionError | Usage detail export is earlier than RDS retention and archive query is not enabled. | |
| 503 | MoColdPathQueryFailedError | Cold path usage detail query failed. | |
| 429 | MoExportQueueFullError | Usage detail export queue is full, please try again later. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。