查询产品账单
产品维度账单(按模型/业务类型聚合的费用),游标分页(has_more/next)。金额为毫分;T 日数据于 T+1 日 07:00(UTC+8)起可查。
GET
/
v1
/
admin
/
organizations
/
billings
/
product_bills
查询产品账单
curl --request GET \
--url https://api.moonshot.cn/v1/admin/organizations/billings/product_bills \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonshot.cn/v1/admin/organizations/billings/product_bills"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moonshot.cn/v1/admin/organizations/billings/product_bills', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonshot.cn/v1/admin/organizations/billings/product_bills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moonshot.cn/v1/admin/organizations/billings/product_bills"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moonshot.cn/v1/admin/organizations/billings/product_bills")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/admin/organizations/billings/product_bills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"product": "<string>",
"product_type": "<string>",
"business_type": "<string>",
"total_fee": 1,
"recharge_fee": 1,
"voucher_fee": 1
}
],
"has_more": true,
"next": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}本接口要求 Admin Key 具备
billing:read 作用域。就绪与金额口径:T 日数据于 T+1 日 07:00(UTC+8)起可查;此前返回
400 data_not_ready。金额分列为现金(recharge_fee)与代金券(voucher_fee)两部分,合计为 total_fee(实收金额)。时间窗左闭右开、按 CST 日界。字段与对账关系
product:产品标识(模型/产品名,如kimi-k2.5、moonshot-v1-8k等);product_type:产品类型;business_type:业务类型(如chat、batch等)。枚举会随产品扩展,客户端请保留原始字符串、忽略未知值。- 与
daily_bills的model_details对账:产品账单按产品聚合(不按 key 明细);日账单外层total_fee−model_details明细合计 = 非 token 费用(cache-call、tool_call、cache storage、BatchAPI 等),仅计入外层汇总。
授权
Authorization 请求头携带 Admin API secret 作为 Bearer 令牌,格式为 Bearer sk-admin-***。Admin Key 可在「控制台 → 组织管理 → Admin API Keys」创建。
查询参数
起始时间(epoch 毫秒),含边界。例如 1790784000000(2026-10-01 00:00 CST)。
必填范围:
x >= 0结束时间(epoch 毫秒),不含边界。例如 1792598400000(2026-10-22 00:00 CST)。
必填范围:
x >= 0项目 ID 列表。每个项目都必须属于当前认证组织。
推理 API 密钥 ID 列表。每个 key 都必须属于当前认证组织。
页大小。默认 100,最大 1000。总行数取决于组织内不同产品/业务类型的组合数,默认页大小通常一页即可取完全部数据。
必填范围:
1 <= x <= 1000上一次响应 next 字段返回的游标。游标只携带页位置;每次翻页都需原样重复全部查询参数(limit 除外),服务端不校验参数一致性。
此页面对您有帮助吗?
⌘I
查询产品账单
curl --request GET \
--url https://api.moonshot.cn/v1/admin/organizations/billings/product_bills \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonshot.cn/v1/admin/organizations/billings/product_bills"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.moonshot.cn/v1/admin/organizations/billings/product_bills', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonshot.cn/v1/admin/organizations/billings/product_bills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.moonshot.cn/v1/admin/organizations/billings/product_bills"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.moonshot.cn/v1/admin/organizations/billings/product_bills")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/admin/organizations/billings/product_bills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"product": "<string>",
"product_type": "<string>",
"business_type": "<string>",
"total_fee": 1,
"recharge_fee": 1,
"voucher_fee": 1
}
],
"has_more": true,
"next": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}