Skip to main content
GET
Daily Bill Query
Query consumption details and day-level summaries by date for reconciliation, cost analysis, and bill collection on the client side.

Endpoint info

Endpoints

Authentication

All requests must include a Bearer credential in the HTTP header. Either of the following credentials is accepted:
string
required
Format Bearer <credential>; use either credential above
Authentication failure returns HTTP 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:

Business error codes


Consumption details

Returns consumption details keyed by (bill day ร— account ร— model ร— token type).

Query parameters

string
required
Start date, format yyyy-MM-dd
string
required
End date, format yyyy-MM-dd; span with startDate must not exceed 92 days
string
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 100
string
required
Page number as a positive integer string, starting from 1
Pagination is by consumption detail row; data.total is the total number of matching detail rows.

Response row fields (data.rows[])

tokenType enum

Sort order: billDay descending, then account, modelName, tokenType, currency ascending.

Request example

Response example


Day summary

Returns day-level net consumption summaries. The payload is lighter than the details endpoint and is suited for bill overviews, daily trends, and monthly reports.

Query parameters

string
required
Start date, format yyyy-MM-dd
string
required
End date, format yyyy-MM-dd; span with startDate must not exceed 366 days
string
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 400
string
required
Page number as a positive integer string, starting from 1
Pagination is by (bill day ร— account); data.total is the total number of matching combinations.

Response row fields (data.rows[])

Sort order: billDay descending, then account ascending.

Request example

Response example


Business rules

  1. Amount precision: All amount fields are transmitted as string with 8 decimal places to avoid JSON number precision loss.
  2. 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).
  3. Zero-consumption days: Days with no consumption in the query range are omitted.
  4. Data lag: Bill data is T+1 โ€” the latest dayโ€™s data becomes queryable the next day.
  5. 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/userName returns 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.
  6. Out-of-range pages: When pageNum exceeds the total page count, rows is empty while total remains the true total.