← Back to changelog Marc Klingen
Marc Klingen
February 19, 2024
New API: GET /metrics/daily
 Marc Klingen
Marc KlingenRetrieve aggregated daily usage metrics via a unified endpoint. Filters for application type, user, or tags are available for tailored data retrieval.
⚠️
Since the initial release, the API was extended with additional filters and metrics. Please refer to the docs.
Overview
Returned data includes:
- Daily trace count
- Daily total cost
- Daily usage per model (broken down by input and output)
Optional filters
- traceNameto commonly filter by the application type, depending on how you use- namein your traces
- userIdto filter by user
- tagsto filter by tags
See API reference for more details.
Do you miss any other GET API routes or metrics on this one? Add them to our idea board!
Example
GET /api/public/metrics/daily?traceName=my-copilot&userId=john{
  "data": [
    {
      "date": "2024-02-18",
      "countTraces": 1500,
      "totalCost": 102.19,
      "usage": [
        {
          "model": "llama2",
          "inputUsage": 1200,
          "outputUsage": 1300,
          "totalUsage": 2500
        },
        {
          "model": "gpt-4",
          "inputUsage": 500,
          "outputUsage": 550,
          "totalUsage": 1050
        }
      ]
    },
    {
      "date": "2024-02-17",
      "countTraces": 1250,
      "totalCost": 250.0,
      "usage": [
        {
          "model": "llama2",
          "inputUsage": 1000,
          "outputUsage": 1100,
          "totalUsage": 2100
        }
      ]
    }
  ],
  "meta": {
    "page": 1,
    "limit": 2,
    "totalItems": 60,
    "totalPages": 30
  }
}