Daily Bill Query
curl --request GET \
--url https://maas.gravitex.ai/prod-api/api/logs/getDailyList \
--header 'Authorization: <authorization>'import requests
url = "https://maas.gravitex.ai/prod-api/api/logs/getDailyList"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://maas.gravitex.ai/prod-api/api/logs/getDailyList', 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://maas.gravitex.ai/prod-api/api/logs/getDailyList",
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: <authorization>"
],
]);
$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://maas.gravitex.ai/prod-api/api/logs/getDailyList"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://maas.gravitex.ai/prod-api/api/logs/getDailyList")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://maas.gravitex.ai/prod-api/api/logs/getDailyList")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyInterface module
Daily Bill Query
Query daily bill consumption details and day-level summaries for reconciliation, cost analysis, and bill collection
GET
/
prod-api
/
api
/
logs
/
getDailyList
Daily Bill Query
curl --request GET \
--url https://maas.gravitex.ai/prod-api/api/logs/getDailyList \
--header 'Authorization: <authorization>'import requests
url = "https://maas.gravitex.ai/prod-api/api/logs/getDailyList"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://maas.gravitex.ai/prod-api/api/logs/getDailyList', 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://maas.gravitex.ai/prod-api/api/logs/getDailyList",
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: <authorization>"
],
]);
$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://maas.gravitex.ai/prod-api/api/logs/getDailyList"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://maas.gravitex.ai/prod-api/api/logs/getDailyList")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://maas.gravitex.ai/prod-api/api/logs/getDailyList")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyQuery consumption details and day-level summaries by date for reconciliation, cost analysis, and bill collection on the client side.
Endpoint info
| Item | Description |
|---|---|
| Base URL | https://maas.gravitex.ai/prod-api |
| Content type | application/json |
| Character encoding | UTF-8 |
| Protocol | HTTPS (required) |
| Currency | USD |
| Billing timezone | utc+8 |
Endpoints
| Endpoint | URL | Purpose |
|---|---|---|
| Consumption details | GET /api/logs/getDailyList | Returns details keyed by (bill day ร account ร model ร token type) |
| Day summary | GET /api/logs/getDailySummary | Returns net consumption summary keyed by (bill day ร account) |
Authentication
All requests must include a Bearer credential in the HTTP header. Either of the following credentials is accepted:| Credential type | Description |
|---|---|
| Access Token | Access token assigned to the account by the platform |
| API Key | API key created for the account by the platform, usually starting with sk- |
string
required
Format
Bearer <credential>; use either credential above# Option 1: Access Token
Authorization: Bearer <access_token>
# Option 2: API Key
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxx
401 with business code 40100.
Do not log full keys in URLs, frontend code, logs, or support tickets.
Common response structure
All endpoints return a unified structure:{
"code": 0,
"message": "success",
"data": {
"total": 128,
"rows": []
}
}
| Field | Type | Description |
|---|---|---|
code | integer | Business status code; 0 means success, non-zero means failure |
message | string | Status message |
data | object | Business payload; null on failure |
data.total | integer | Total matching rows (for pagination) |
data.rows | array | Row list |
Business error codes
| code | HTTP status | Description |
|---|---|---|
| 0 | 200 | Success |
| 40001 | 400 | Invalid format error (invalid date format, non-positive pagination params, etc.) |
| 40002 | 400 | Missing required parameter |
| 40003 | 400 | Invalid date range (startDate after endDate, or span exceeds the limit) |
| 40100 | 401 | Token missing, invalid, or expired |
| 50000 | 500 | Internal server error |
Consumption details
GET https://maas.gravitex.ai/prod-api/api/logs/getDailyList
(bill day ร account ร model ร token type).
Query parameters
string
required
Start date, format
yyyy-MM-ddstring
required
End date, format
yyyy-MM-dd; span with startDate must not exceed 92 daysstring
Filter by account ID (multi-sub-account visibility requires Enterprise Management; see Business rules); omit to return accounts visible to the current credential
string
Filter by account name, exact match (multi-sub-account visibility requires Enterprise Management; see Business rules); omit to return accounts visible to the current credential
string
required
Page size as a positive integer string; range
1 ~ 100; values over 100 are capped at 100string
required
Page number as a positive integer string, starting from
1Pagination is by consumption detail row;
data.total is the total number of matching detail rows.Response row fields (data.rows[])
| Field | Type | Description |
|---|---|---|
billMonth | string | Billing month, format yyyyMM |
billDay | string | Billing day, format yyyy-MM-dd |
billingDateTimezone | string | Billing timezone, always utc+8 |
account | string | Account name |
modelType | string | Model category, e.g. claude, gpt, gemini, qwen, deepseek |
modelName | string | Model name |
tokenType | string | Token type; see enum below |
tokenCount | string | Token count for this type (integer as string) |
tokenUnit | string | Token unit, always million (priced per million tokens) |
currency | string | Currency, always USD |
subtotalBeforeTax | string | Pre-discount, pre-tax amount (8 decimal places) |
subtotalAfterDiscount | string | Post-discount, pre-tax amount (8 decimal places) |
totalAmountAfterTax | string | Post-discount, post-tax amount (8 decimal places) |
price | string | Unit price: pre-discount price per 1 tokenUnit (i.e. per million tokens) (8 decimal places). Formula: subtotalBeforeTax = price ร tokenCount รท 1,000,000; may be omitted when tokenCount is 0 |
entryType | string | Entry type; normal means normal consumption |
tokenType enum
| Value | Description |
|---|---|
textInputTokens | Text input tokens |
textOutputTokens | Text output tokens |
reasoningTokens | Reasoning / thinking tokens |
cacheCreationTokens5m | Cache creation tokens (5-minute TTL) |
cacheCreationTokens1h | Cache creation tokens (1-hour TTL) |
cacheTokens | Cache hit (read) tokens |
imageInputTokens | Image input tokens |
imageOutputTokens | Image output tokens |
audioInputTokens | Audio input tokens |
audioOutputTokens | Audio output tokens |
videoInputTokens | Video input tokens |
videoOutputTokens | Video output tokens |
Sort order:
billDay descending, then account, modelName, tokenType, currency ascending.Request example
curl "https://maas.gravitex.ai/prod-api/api/logs/getDailyList?startDate=2026-07-27&endDate=2026-07-27&pageSize=100&pageNum=1" \
-H "Authorization: Bearer <your_token>"
Response example
{
"code": 0,
"message": "success",
"data": {
"total": 23,
"rows": [
{
"billMonth": "202607",
"billDay": "2026-07-27",
"billingDateTimezone": "utc+8",
"account": "your_account",
"modelType": "claude",
"modelName": "claude-opus-4-8",
"tokenType": "textOutputTokens",
"tokenCount": "2931",
"tokenUnit": "million",
"currency": "USD",
"subtotalBeforeTax": "0.07327564",
"subtotalAfterDiscount": "0.07327564",
"totalAmountAfterTax": "0.07327564",
"price": "25.00021836",
"entryType": "normal"
}
]
}
}
Day summary
GET https://maas.gravitex.ai/prod-api/api/logs/getDailySummary
Query parameters
string
required
Start date, format
yyyy-MM-ddstring
required
End date, format
yyyy-MM-dd; span with startDate must not exceed 366 daysstring
Filter by account ID (multi-sub-account visibility requires Enterprise Management; see Business rules); omit to return accounts visible to the current credential
string
Filter by account name, exact match (multi-sub-account visibility requires Enterprise Management; see Business rules); omit to return accounts visible to the current credential
string
required
Page size as a positive integer string; range
1 ~ 400; values over 400 are capped at 400string
required
Page number as a positive integer string, starting from
1Pagination is by
(bill day ร account); data.total is the total number of matching combinations.Response row fields (data.rows[])
| Field | Type | Description |
|---|---|---|
billMonth | string | Billing month, format yyyyMM |
billDay | string | Billing day, format yyyy-MM-dd |
billingDateTimezone | string | Billing timezone, always utc+8 |
account | string | Account name |
currency | string | Currency, always USD |
subtotalBeforeTax | string | Day total, pre-discount pre-tax net (8 decimal places) |
subtotalAfterDiscount | string | Day total, post-discount pre-tax net (8 decimal places) |
totalAmountAfterTax | string | Day total, post-discount post-tax net (8 decimal places) |
Sort order:
billDay descending, then account ascending.Request example
curl "https://maas.gravitex.ai/prod-api/api/logs/getDailySummary?startDate=2026-07-01&endDate=2026-07-27&pageSize=31&pageNum=1" \
-H "Authorization: Bearer <your_token>"
Response example
{
"code": 0,
"message": "success",
"data": {
"total": 2,
"rows": [
{
"billMonth": "202607",
"billDay": "2026-07-27",
"billingDateTimezone": "utc+8",
"account": "your_account",
"currency": "USD",
"subtotalBeforeTax": "0.26569400",
"subtotalAfterDiscount": "0.26569400",
"totalAmountAfterTax": "0.26569400"
}
]
}
}
Business rules
- Amount precision: All amount fields are transmitted as
stringwith 8 decimal places to avoid JSON number precision loss. - Amount consistency: For the same bill day and account, each day-summary amount field equals the sum of the corresponding detail amount fields for that day (sum across pages).
- Zero-consumption days: Days with no consumption in the query range are omitted.
- Data lag: Bill data is T+1 โ the latest dayโs data becomes queryable the next day.
- Account scope and Enterprise Management: By default, a credential can only query its own account. If the account has Enterprise Management enabled and is the primary account, it can see bills for all sub-accounts โ omitting
userId/userNamereturns all sub-accounts; providing them filters to a specific sub-account (a sub-account credential can only query itself). Contact a platform admin to enable Enterprise Management. - Out-of-range pages: When
pageNumexceeds the total page count,rowsis empty whiletotalremains the true total.
