Get usage timeseries

Retrieve usage metrics bucketed by time interval.

Returns time-series data showing how usage changes over time. Useful for creating charts, identifying trends, and monitoring usage patterns.

Intervals:

  • hour: Bucket data by hour
  • day: Bucket data by day
  • week: Bucket data by week

Each data point includes the timestamp and all usage metrics for that time period.

GET
/usage/timeseries
AuthorizationBearer <token>

Project API key

In: header

Query Parameters

interval*string

Time interval for bucketing data

Value in"hour" | "day" | "week"
customerId?string

Filter usage by customer ID

eventType?string

Filter usage by event type

model?string

Filter usage by model name

startDate*string

Start of the date range (ISO 8601 format)

Formatdate-time
endDate*string

End of the date range (ISO 8601 format)

Formatdate-time

Response Body

application/json

application/json

application/json

curl -X GET "https://api.limitry.com/v1/usage/timeseries?interval=hour&startDate=2019-08-24T14%3A15%3A22Z&endDate=2019-08-24T14%3A15%3A22Z"
{
  "data": [
    {
      "timestamp": "2024-01-15T00:00:00Z",
      "totalEvents": 100,
      "totalTokens": 50000,
      "totalInputTokens": 30000,
      "totalOutputTokens": 20000,
      "totalCostCents": 50
    },
    {
      "timestamp": "2024-01-15T01:00:00Z",
      "totalEvents": 150,
      "totalTokens": 75000,
      "totalInputTokens": 45000,
      "totalOutputTokens": 30000,
      "totalCostCents": 75
    }
  ]
}
{
  "error": "Invalid request"
}
{
  "error": "Invalid or missing API key"
}