Skip to content
Last updated

Retrieve year-by-year usage breakdown for long-term trend analysis.

GEThttps://api.aitronos.com/v1/analytics/usage/yearly/{org_id}

Path Parameters

org_id string required

The organization ID.

Query Parameters

years integer

Number of years to retrieve. Default: 2. Range: 1-10.

Returns

Returns a YearlyUsageResponse object with year-by-year usage analytics including costs, requests, and growth rates.

Bash
curl "https://api.aitronos.com/v1/analytics/usage/yearly/org_abc123?years=2" \
  -H "X-API-Key: $FREDDY_API_KEY"

Response:

{
  "organization_id": "org_abc123",
  "period": "yearly",
  "data": [
    {
      "year": 2025,
      "total_cost_chf": 12500.50,
      "total_requests": 50000,
      "total_synapses": 25000000.0,
      "total_tokens": 5000000,
      "growth_rate_percent": 15.2
    },
    {
      "year": 2024,
      "total_cost_chf": 10870.25,
      "total_requests": 45000,
      "total_synapses": 22500000.0,
      "total_tokens": 4500000,
      "growth_rate_percent": null
    }
  ],
  "total_requests": 95000,
  "total_cost": 23370.75,
  "summary": {
    "start_year": 2024,
    "end_year": 2025,
    "years_included": 2,
    "currency": "CHF"
  }
}