Llm Analytics
Get Cost Analytics
GET
apiKeyAuthheader
x-api-key<token>FastStats API key. Pass it in the x-api-key header or as a Bearer token in the Authorization header.
idOrSlug*stringmaxAgeMs?stringfrom?stringto?stringLlmCostAnalytics
application/json- response
summary*timeseries*array<>byModel*array<>topTraces*array<>curl -X GET 'https://api.faststats.dev/v0/projects/string/llm/costs'Example Response
{ "summary": { "totalRequests": 0, "inputCost": 0, "outputCost": 0, "totalCost": 0, "promptTokens": 0, "completionTokens": 0, "cachedTokens": 0, "reasoningTokens": 0, "totalTokens": 0 }, "timeseries": [ { "bucket": "string", "inputCost": 0, "outputCost": 0, "totalCost": 0 } ], "byModel": [ { "model": "string", "providerName": "string", "inputCost": 0, "outputCost": 0, "cost": 0, "promptTokens": 0, "completionTokens": 0, "cachedTokens": 0, "reasoningTokens": 0, "totalTokens": 0 } ], "topTraces": [ { "traceId": "string", "spanId": "string", "model": "string", "providerName": "string", "promptTokens": 0, "completionTokens": 0, "totalCost": 0 } ]}GET
curl -X GET 'https://api.faststats.dev/v0/projects/string/llm/costs'{
"summary": {
"totalRequests": 0,
"inputCost": 0,
"outputCost": 0,
"totalCost": 0,
"promptTokens": 0,
"completionTokens": 0,
"cachedTokens": 0,
"reasoningTokens": 0,
"totalTokens": 0
},
"timeseries": [
{
"bucket": "string",
"inputCost": 0,
"outputCost": 0,
"totalCost": 0
}
],
"byModel": [
{
"model": "string",
"providerName": "string",
"inputCost": 0,
"outputCost": 0,
"cost": 0,
"promptTokens": 0,
"completionTokens": 0,
"cachedTokens": 0,
"reasoningTokens": 0,
"totalTokens": 0
}
],
"topTraces": [
{
"traceId": "string",
"spanId": "string",
"model": "string",
"providerName": "string",
"promptTokens": 0,
"completionTokens": 0,
"totalCost": 0
}
]
}