Llm Analytics

Get Cost Analytics

GET
/v0/projects/{idOrSlug}/llm/costs

Authorization

apiKeyAuth
headerx-api-key<token>

FastStats API key. Pass it in the x-api-key header or as a Bearer token in the Authorization header.

Path Parameters

idOrSlug*string

Query Parameters

maxAgeMs?string
from?string
to?string

Response Body

LlmCostAnalytics

application/json
  1. response
summary*
timeseries*array<>
byModel*array<>
topTraces*array<>
Example Request
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    }  ]}