v1

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

Get external service usage costs

Return non-LLM service usage costs aggregated by source, model, and time period.

post/llm/services/cost

Query parameters

cookie_namestring nullable
tenant_idinteger

Request body

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

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').

sourcestring nullable

Filter by usage source (e.g. doc_intelligence, interpreter).

modelstring nullable

Filter by specific model catalog name.

providerstring nullable

Filter by provider.

Example request

{
  "granularity": "monthly",
  "date_start": "2026-01-01T00:00:00Z",
  "date_end": "2026-01-31T23:59:59Z",
  "source": "doc_intelligence",
  "model": "gpt-4o",
  "provider": "azure"
}

Response

Successful Response

start_datestring date-time required

Start of the aggregation window.

end_datestring date-time required

End of the aggregation window.

total_costnumber required

Total cost across the window.

total_tokensinteger required

Total tokens across the window.

total_prompt_tokensinteger required

Total prompt tokens across the window.

total_completion_tokensinteger required

Total completion tokens across the window.

total_cached_tokensinteger required

Total cached prompt tokens across the window.

record_countinteger required

Total number of usage records.

Example response

{
  "start_date": "2026-01-01T00:00:00Z",
  "end_date": "2026-01-31T23:59:59Z",
  "total_cost": 123.45,
  "total_tokens": 120000,
  "total_prompt_tokens": 80000,
  "total_completion_tokens": 40000,
  "total_cached_tokens": 5000,
  "record_count": 420,
  "by_source": [
    {
      "source": "doc_intelligence",
      "total_cost": 12.34,
      "total_tokens": 10000,
      "prompt_tokens": 6000,
      "completion_tokens": 4000,
      "record_count": 42
    }
  ],
  "by_model": [
    {
      "provider": "azure",
      "model": "gpt-4o",
      "total_cost": 12.34,
      "total_tokens": 10000,
      "prompt_tokens": 6000,
      "completion_tokens": 4000,
      "record_count": 42
    }
  ],
  "timeseries": [
    {
      "date": "2026-01-15",
      "cost": 12.34,
      "tokens": 1234,
      "record_count": 5
    }
  ]
}