v1

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-25173140700.7 KB
Llm

Get LLM cost metrics

Return current-month total LLM cost and per-model cost timeseries for the tenant.

post/llm/cost

Query parameters

cookie_namestring nullable
tenant_idinteger

Request body

granularity'monthly' | 'yearly' | 'custom' required

Aggregation window; 'custom' requires date_start and date_end.

date_startstring date-time nullable

Start of the custom range (used only when granularity is 'custom').

date_endstring date-time nullable

End of the custom range (used only when granularity is 'custom').

Example request

{
  "granularity": "monthly",
  "date_start": "2026-01-01T00:00:00Z",
  "date_end": "2026-01-31T23:59:59Z"
}

Response

Successful Response

total_costnumber required

Total LLM cost for the current month across all models.

timeseriesobject required

Cost timeseries keyed by model name.

Example response

{
  "total_cost": 123.45,
  "timeseries": {
    "gpt-4o": [
      {
        "cost": 12.34,
        "date": "2026-01-15"
      }
    ]
  }
}