curl --request GET \
--url 'https://api.ppio.com/openapi/v1/billing/apikey/bill/list?cycleType=Day&category=llm&startTime=1767225600&endTime=1769817599' \
--header 'Authorization: Bearer <API_KEY>'
curl --request GET \
--url 'https://api.ppio.com/openapi/v1/billing/apikey/bill/list?cycleType=Hour&category=llm&startTime=1767225600&endTime=1767830399' \
--header 'Authorization: Bearer <API_KEY>'
{
"bills": [
{
"userId": "<string>",
"startTime": "1767225600",
"endTime": "1767311999",
"billingMethod": 1,
"productName": "<string>",
"category": "llm",
"ownerID": "<api_key_id>",
"billNum0": "1000",
"billNum1": "500",
"basePrice0": "0",
"basePrice1": "0",
"discountPrice0": "0",
"discountPrice1": "0",
"amount": "10000",
"voucherAmount": "0",
"payAmount": "10000",
"payAmountDisplay": 1,
"pricePrecision": 1,
"productId": "<string>",
"apikeyName": "<string>",
"apikeyMask": "sk-****"
}
]
}
账单管理
查询 API Key 账单
PPIO 管理 API 文档说明“查询 API Key 账单”的使用方式,帮助开发者按密钥核对模型服务支出,了解相关请求与结果处理。
GET
/
openapi
/
v1
/
billing
/
apikey
/
bill
/
list
curl --request GET \
--url 'https://api.ppio.com/openapi/v1/billing/apikey/bill/list?cycleType=Day&category=llm&startTime=1767225600&endTime=1769817599' \
--header 'Authorization: Bearer <API_KEY>'
curl --request GET \
--url 'https://api.ppio.com/openapi/v1/billing/apikey/bill/list?cycleType=Hour&category=llm&startTime=1767225600&endTime=1767830399' \
--header 'Authorization: Bearer <API_KEY>'
{
"bills": [
{
"userId": "<string>",
"startTime": "1767225600",
"endTime": "1767311999",
"billingMethod": 1,
"productName": "<string>",
"category": "llm",
"ownerID": "<api_key_id>",
"billNum0": "1000",
"billNum1": "500",
"basePrice0": "0",
"basePrice1": "0",
"discountPrice0": "0",
"discountPrice1": "0",
"amount": "10000",
"voucherAmount": "0",
"payAmount": "10000",
"payAmountDisplay": 1,
"pricePrecision": 1,
"productId": "<string>",
"apikeyName": "<string>",
"apikeyMask": "sk-****"
}
]
}
请求头
查询参数
统计粒度。取值:
Hour:按小时。Day:按天。Week:按周。Month:按月。
该接口仅支持查询
2026-01-01 00:00:00 之后的数据。当前接口不分页,单次查询的时间跨度按统计粒度分档限制:cycleType=Hour:最长 7 天。cycleType=Day、Week、Month:最长 31 天。
time range must not exceed 7 days for cycleType "Hour"。如需拉取更长时间,请按自然周或自然月分段请求。cycleType=Hour 时,返回的每条账单对应一个自然小时:startTime 为该小时的整点,endTime 为该小时的 59 分 59 秒。时间跨度上限本次新增为服务端校验。此前该限制只在控制台生效,直接调用本接口不做校验,因此原先发送更长跨度请求(例如以
Month 粒度查询 3 个月)的调用方,会从本次更新起收到参数错误。请按上述上限分段请求,并在代码中处理该错误。响应参数
API Key 账单列表。
隐藏 properties
隐藏 properties
curl --request GET \
--url 'https://api.ppio.com/openapi/v1/billing/apikey/bill/list?cycleType=Day&category=llm&startTime=1767225600&endTime=1769817599' \
--header 'Authorization: Bearer <API_KEY>'
curl --request GET \
--url 'https://api.ppio.com/openapi/v1/billing/apikey/bill/list?cycleType=Hour&category=llm&startTime=1767225600&endTime=1767830399' \
--header 'Authorization: Bearer <API_KEY>'
{
"bills": [
{
"userId": "<string>",
"startTime": "1767225600",
"endTime": "1767311999",
"billingMethod": 1,
"productName": "<string>",
"category": "llm",
"ownerID": "<api_key_id>",
"billNum0": "1000",
"billNum1": "500",
"basePrice0": "0",
"basePrice1": "0",
"discountPrice0": "0",
"discountPrice1": "0",
"amount": "10000",
"voucherAmount": "0",
"payAmount": "10000",
"payAmountDisplay": 1,
"pricePrecision": 1,
"productId": "<string>",
"apikeyName": "<string>",
"apikeyMask": "sk-****"
}
]
}
最后修改于 2026年10月13日