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
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
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
}
]
}