Bill Query
Interface Modules
Bill Query
Pull day-level consumption details and summaries from TenndaAI for reconciliation, cost analysis, and bill collection
GET
Bill Query
Overview
Two read-only billing endpoints: day summaries for net spend trends, and line items broken down by model × token type. Amounts are alwaysUSD, billing timezone is utc+8, and data is T+1.
Consumption details
getDailyList: grain (bill day × account × model × token type). Max span 92 days per request; pageSize capped at 100.Day summary
getDailySummary: grain (bill day × account). Max span 366 days per request; pageSize capped at 400.Endpoints
Authentication
Send a Bearer credential in the request header — either option works:
Auth failure: HTTP
401, business code 40100.
Common response
Business error codes
Details · getDailyList
(bill day × account × model × token type).
Request parameters
string
required
Start date,
yyyy-MM-ddstring
required
End date,
yyyy-MM-dd; span with startDate must not exceed 92 daysstring
Filter by account ID. Multi-sub-account visibility requires Enterprise Management — see Conventions. Omit to return accounts visible to the current credential.
string
Filter by account name (exact). Same Enterprise Management rules; omit to return accounts visible to the current credential.
string
required
Positive integer string,
1 ~ 100; values over 100 are capped at 100string
required
Positive integer string, starting at
1Pagination is by detail row;
data.total is the total number of matching detail rows.Response fields (data.rows[])
tokenType
Sort:
billDay desc, then account, modelName, tokenType, currency asc.Request example
Response example
Day summary · getDailySummary
Request parameters
string
required
Start date,
yyyy-MM-ddstring
required
End date,
yyyy-MM-dd; span with startDate must not exceed 366 daysstring
Filter by account ID (same Enterprise Management rules as details)
string
Filter by account name, exact (same Enterprise Management rules as details)
string
required
Positive integer string,
1 ~ 400; values over 400 are capped at 400string
required
Positive integer string, starting at
1Pagination is by
(bill day × account); data.total is the combination count.Response fields (data.rows[])
Sort:
billDay desc, then account asc.Request example
Response example
Conventions
- Amounts: Always
stringwith 8 decimal places — use Decimal / BigDecimal; do not convert to binary floats. - Consistency: For the same bill day and account, each day-summary amount equals the sum of the matching detail amounts that day (sum across pages).
- Zero days: Days with no consumption in the range are omitted.
- Freshness: Bills are T+1 — the latest day is queryable the next day.
- Account scope: Default is own account only. A primary account with Enterprise Management can see all sub-accounts — omit
userId/userNamefor all, or pass them to filter; a sub-account credential only sees itself. Contact a TenndaAI admin to enable Enterprise Management. - Out-of-range pages: When
pageNumexceeds total pages,rowsis empty whiletotalremains the true total.
