Skip to main content
GET
https://api.naga.ac
/
v1
/
account
/
activity
Account Activity
curl --request GET \
  --url https://api.naga.ac/v1/account/activity \
  --header 'Authorization: Bearer <token>'
{
  "period_days": 123,
  "total_stats": {
    "total_requests": 123,
    "total_cost": "<string>",
    "total_input_tokens": 123,
    "total_output_tokens": 123
  },
  "daily_stats": [
    {
      "date": "<string>",
      "total_requests": 123,
      "total_cost": "<string>",
      "total_input_tokens": 123,
      "total_output_tokens": 123
    }
  ],
  "top_models": [
    {
      "model_name": "<string>",
      "request_count": 123,
      "total_cost": "<string>",
      "total_input_tokens": 123,
      "total_output_tokens": 123
    }
  ],
  "api_key_usage": [
    {
      "api_key_id": 123,
      "api_key_name": "<string>",
      "request_count": 123,
      "total_cost": "<string>",
      "total_input_tokens": 123,
      "total_output_tokens": 123
    }
  ]
}
Provisioning Key Required This endpoint requires authentication with a provisioning key, not a regular API key.
Returns detailed usage statistics for your account, including:
  • Total aggregated stats for the specified period
  • Daily breakdown of requests and costs
  • Top models used
  • Usage statistics per API key
Performance Optimization Results are cached for 5 minutes to optimize performance. Repeated requests within this window will return cached data.

Query Parameters

days
integer
default:"30"
Number of days to look back for statistics (1-30).

Example Request

import requests

# Get activity for the last 7 days
response = requests.get(
    "https://api.naga.ac/v1/account/activity",
    headers={"Authorization": "Bearer YOUR_PROVISIONING_KEY"},
    params={"days": 7},
)

activity = response.json()
print(f"Total requests: {activity['total_stats']['total_requests']}")
print(f"Total cost: ${activity['total_stats']['total_cost']}")

Response

{
  "period_days": 7,
  "total_stats": {
    "total_requests": 1523,
    "total_cost": "45.67",
    "total_input_tokens": 125430,
    "total_output_tokens": 89210
  },
  "daily_stats": [
    {
      "date": "2025-01-20",
      "total_requests": 245,
      "total_cost": "7.82",
      "total_input_tokens": 20150,
      "total_output_tokens": 15230
    }
  ],
  "top_models": [
    {
      "model_name": "gpt-4o-mini",
      "request_count": 892,
      "total_cost": "28.34",
      "total_input_tokens": 78450,
      "total_output_tokens": 52310
    }
  ],
  "api_key_usage": [
    {
      "api_key_id": 1,
      "api_key_name": "Production API Key",
      "request_count": 1204,
      "total_cost": "38.92",
      "total_input_tokens": 98230,
      "total_output_tokens": 71450
    }
  ]
}

Response Fields

period_days
integer
Number of days included in the statistics
total_stats
object
Aggregated statistics for the entire period
daily_stats
array
Day-by-day breakdown of usage
top_models
array
Models sorted by usage
api_key_usage
array
Usage statistics per API key