Levain LabsLevain Labs
API ReferenceAnalytics

Timeseries

Cost, token, and request-count series bucketed for plotting.

Hour granularity is capped to 30 days; day granularity is capped to 365 days.

GET
/api/v1/analytics/timeseries

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

granularity?Granularity
Default"day"
Value in"hour" | "day"
start?|null
end?|null

Header Parameters

X-API-Key?string|null

Response Body

application/json

application/json

curl -X GET "https://api.levainlabs.com/api/v1/analytics/timeseries"
[
  {
    "bucket": "2019-08-24T14:15:22Z",
    "cost_usd": 0,
    "billed_usd": 0,
    "tokens_in": 0,
    "tokens_out": 0,
    "request_count": 0
  }
]
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}