Skip to main content
GET
/
v1
/
billing
/
usage
Get Usage Query
curl --request GET \
  --url https://api.faces.sh/v1/billing/usage
{
  "rows": [
    {
      "group_key": "<string>",
      "group_label": "<string>",
      "input_tokens": 123,
      "output_tokens": 123,
      "provider_cost_usd": 123,
      "markup_usd": 123,
      "total_cost_usd": 123,
      "request_count": 123,
      "tokens_saved": 123,
      "usd_saved": 123
    }
  ],
  "totals": {
    "group_key": "<string>",
    "group_label": "<string>",
    "input_tokens": 123,
    "output_tokens": 123,
    "provider_cost_usd": 123,
    "markup_usd": 123,
    "total_cost_usd": 123,
    "request_count": 123,
    "tokens_saved": 123,
    "usd_saved": 123
  }
}

Headers

authorization
string | null

Query Parameters

group_by
string
default:model_iam_id

Grouping dimension: api_key_id | model_iam_id | llm_model | model_username | date

api_key_id
string | null

Filter by API key UUID

model_username
string | null

Filter by model IAM username

model_iam_id
string | null

Filter by model IAM UUID

llm_model
string | null

Filter by underlying LLM model name

from_date
string | null

Start date (ISO format, inclusive)

to_date
string | null

End date (ISO format, inclusive)

Response

Successful Response

Response for GET /v1/billing/usage grouped query.

rows
UsageRow · object[]
required
totals
UsageRow · object
required

One row in a usage GROUP BY result.