Tencent Cloud TokenHub bills have no API key: how are key-level costs calculated?
The first step of LLM cost governance is knowing how much each API key spent. Alibaba Cloud Model Studio instance bills can be attributed to keys directly, but Tencent Cloud bills by inference service / model and does not include the API key. This is how TokenTally solves it.
Two sets of data
- Bill details: the real amount per day, per model and per billing item (input / cache hit / output).
- TokenHub usage: token usage per "key × model × day".
The allocation formula
Key cost = the real bill amount of that model and billing item for the day × the key's share of the matching tokens
Each billing item is allocated separately because input, cache hits and output have different prices; allocating by total tokens would overstate keys with high cache hit rates.
Why the total matches the bill
The last key in each group (date × model × billing item) takes the remainder instead of being rounded proportionally too, so the total of all keys matches the Tencent Cloud bill exactly. When the billed resource is itself an API key, it is attributed directly; without billing permissions, costs can be estimated at list prices and are clearly labeled "estimated".
A note on definitions
"Amount payable" = list price − discounts − coupons / vouchers, resource packs and other credits, as in the billing center; "amount after discounts" does not deduct coupons. Discounts count on the day the cloud actually applies them, so when you look at a few days within a month, amounts are not spread evenly per day.
Learn more on the TokenTally product page.