Available on Scale and Enterprise, including BYOC. An admin or finance member makes the key. Below Scale, existing usage keys can still be listed and revoked, but the endpoint refuses them.
Make a usage key
Open Connect › API keys and choose New usage key. Give it a name. The key is shown once, so put it in your job’s secret store straight away. A usage key reads one route and nothing else. Any other path answers 403 withThis is a usage key: it can only read GET /v1/api/cost/customer-usage. The endpoint, in turn, refuses every other kind of key and any console session.
Usage keys belong to the workspace, not to the person who made them. If that person leaves, the key keeps working and the admins get an alert saying it’s worth rotating. Nothing revokes it for you. To rotate, make a new key, switch your job over, then revoke the old one from the same page.
The calls you want priced need the customer tag, because usage is read per customer. See Attribution.
The request
A range spans at most 92 days, counting both ends. For a longer stretch, make several calls.
The response
cost_cents is the same counted figure Spend › Customers shows, matched to the provider’s bill where the bill is known. See How TensorCost counts AI spend.
Settled days
A day is settled once it is three days old.settled_through is the latest settled day: today (UTC) minus three days. A row’s settled is true when its day is on or before that date.
Settled figures are final. Unsettled rows are there so you can watch the month build, but the figure can still move while calls are counted and bills arrive. If you invoice from this endpoint, price only the rows where settled is true and pick up the rest on a later run.
Paging
page_size counts customers, not rows. Each page holds every row in your range for that many customers, in customer-id order. When next_cursor is null, you have everything. Otherwise pass it back as cursor with the same since, until and page_size.
The cursor is only good for values this endpoint gave you. An invented one is a 400.
The first page on a large workspace can take several seconds, because it matches the range against provider bills. The endpoint gives up at 55 seconds.