C
Chatty

Usage Stats

GET/api/v1/usage

Returns per-day message and API call counts for the API key. Useful for building usage dashboards or tracking against quotas.

Required scope: read

Stats are scoped to the API key — multiple keys sharing the same bot each have independent usage counters.

Query parameters

daysintegerquerydefault: 30
Number of days to look back. Min 1, max 90.

Response

key_idstring
The API key identifier these stats belong to.
daysinteger
Number of days covered.
totalsobject

Aggregated across all days.

dailyarray

Per-day breakdown, newest first.

Example

cURL
curl "https://api.personaliai.com/api/v1/usage?days=7" \
  -H "Authorization: Bearer chatty_sk_your_key"

200 OK:

{
  "key_id": "key-uuid-001",
  "days": 7,
  "totals": { "messages": 512, "api_calls": 89 },
  "daily": [
    { "date": "2026-07-07", "messages": 98, "api_calls": 14 },
    { "date": "2026-07-06", "messages": 103, "api_calls": 17 },
    { "date": "2026-07-05", "messages": 67,  "api_calls": 11 }
  ]
}