public-api

Public Get Billing Spend By Tenant

Changed on

Spend and usage by your own customers (TRA-1307).

Send your customer's organization id as the X-Tenant-Id header on each inference request, and its display name as X-Tenant-Name. This returns one row per X-Tenant-Id your requests carried between start and end. Rows are priced at the team's rates and sorted by tokens, most first. tenant_name is the name that tenant sent most recently. Requests sent without the header form one row with a null tenant_id, so the rows add up to what /v1/billing/spend reports for the same window and model. A dedicated GPU day is split across the tenants that ran on the GPU by their share of each 15-minute cell, so tenants that shared the GPU share its cost rather than each paying for it.

The window and model work as they do on /v1/billing/spend. A 503 means the gateway has not finished building per-tenant usage for the window yet. Its detail names the first day it can answer for.

get/v1/billing/spend/tenants

Request

  • Base URL
    https://api.trainloop.ai (the document declares no server; this is the origin it was published from)
  • Auth
    none declared

Query parameters

startstring date nullable

The first UTC day of the window. The default is 30 days before end.

endstring date nullable

The first UTC day after the window. The default is tomorrow, which puts today inside the window.

modelstring nullable

One model slug, as the /v1/billing/spend models list names it. The default is every model.

Headers

authorizationstring nullable

Response

Successful Response

startstring required
endstring required

Changes