查询日账单
日账单(每自然日一行;project_id/key 为过滤维度;模型 × 计费项 × key 拆分见嵌套 model_details),游标分页(has_more/next)。金额为毫分;T 日数据于 T+1 日 07:00(UTC+8)起可查;此前返回 400 data_not_ready。
GET
/
v1
/
admin
/
organizations
/
billings
/
daily_bills
查询日账单
curl --request GET \
--url https://api.moonshot.cn/v1/admin/organizations/billings/daily_bills \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonshot.cn/v1/admin/organizations/billings/daily_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/daily_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/daily_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/daily_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/daily_bills")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/admin/organizations/billings/daily_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": [
{
"date": "2026-06-30",
"total_fee": 1,
"recharge_fee": 1,
"voucher_fee": 1,
"model_details": [
{
"model_id": "kimi-k2.6",
"token_type": "prompt",
"tokens": 123,
"key": "<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 日界。授权
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/daily_bills \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonshot.cn/v1/admin/organizations/billings/daily_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/daily_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/daily_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/daily_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/daily_bills")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.cn/v1/admin/organizations/billings/daily_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": [
{
"date": "2026-06-30",
"total_fee": 1,
"recharge_fee": 1,
"voucher_fee": 1,
"model_details": [
{
"model_id": "kimi-k2.6",
"token_type": "prompt",
"tokens": 123,
"key": "<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>"
}
}