Friendli Suite exposes two administration endpoints that let you track consumption programmatically:
- Cost (
GET /v1/team/cost) — rated dollar amounts for your team, grouped by billing line item.
- Usage (
GET /v1/team/usage) — metered quantities such as token counts and GPU time, with filters by model, product type, and user.
Use the cost endpoint when you need dollar figures. Use the usage endpoint when you need raw consumption numbers — for example, to build a dashboard, do chargeback accounting, or compare token volume across models.
Authentication
Both endpoints require a Personal API Key (for example, flp_XXX) passed as a bearer token in the Authorization header.
If you do not already have one, generate it from Friendli Suite > Personal Settings > API Keys. For the full steps, see the Personal API Keys guide.
Specifying a Team
To target a specific team, pass the team ID in the X-Friendli-Team header. Omit it to use your default team.
Rate Limits and Polling
Both endpoints return 429 if you call them too frequently. Wait at least 5 minutes between repeated calls.
Cost API
GET /v1/team/cost returns daily cost buckets for a time range you specify. Each bucket contains the total cost in USD and, when grouped by line item, a breakdown by billing category.
Parameters
Example: Get Daily Cost Totals
Example: Cost Broken Down by Line Item
Pass group_by=line_item to see which billing categories drove the cost.
Usage API
GET /v1/team/usage returns usage buckets with metered quantities: request counts, token counts, and GPU time. You can filter and group by model, product type, and user.
Parameters
Example: Daily Usage Totals
Example: Usage by Model and Product Type
Group by model and product_type to see which models consumed the most tokens across both Model APIs and Dedicated Endpoints.
Example: Usage by user
Group by user_id to break down consumption per user. This shows who is driving usage across both Model APIs and Dedicated Endpoints.
Who is user_id?
The user_id field identifies who consumed the usage, but the attribution depends on the product type:
- Model APIs: The
user_id is the owner of the Personal API Key that made the inference request. If multiple team members use the same API key, all usage is attributed to that key’s owner.
- Dedicated Endpoints — token consumption: The
user_id is the owner of the Personal API Key that sent the request, same as Model APIs.
- Dedicated Endpoints — GPU time: GPU time in the
gpu_usage field is attributed to the user who created the endpoint, not the user who sent inference requests to it. If Alice creates an endpoint and Bob sends requests to it, the token usage appears under Bob’s user_id but the GPU time appears under Alice’s.
When grouping by user_id, Dedicated Endpoints GPU time is attributed to the endpoint creator, not the API caller. If your chargeback model assumes per-request attribution, handle GPU time separately in your aggregation logic. Use group_by=model together with group_by=user_id to separate endpoint-level GPU time from token usage per user.