Get Api Key Usage Stats
Get usage statistics for a specific API key.
Args: api_key_id: The local API key ID
Returns: Usage statistics for the specified API key
Path parameters
Response
Successful Response
Local API key ID
API key name
External API key ID
Whether API key is active
Expiration timestamp from API
Formatted expiration time for display
Current window tokens used
Current window requests made
Current daily cost
Formatted current daily cost
Current rate limit window tokens
Current rate limit window requests
Current rate limit window cost
Total tokens used
Total requests made
Total cost
Formatted total cost
Daily cost limit
Token limit
Whether this key has daily limits
Rate limit window in minutes
Rate limit requests per window
Rate limit cost per window
Opus model cost this week
Opus model weekly limit
Opus weekly usage percentage
Whether this key has a monthly/lifetime cost cap
Monthly cost limit in USD (CRS totalCostLimit)
Amount of monthly cost used
Percentage of monthly cost limit used
Seconds until window reset
Human readable time until reset
Percentage of daily cost limit used
Percentage of token limit used
Percentage of window requests used
Percentage of window cost used
Whether near daily cost limit
Whether near token limit
Whether near window limit
Whether near Opus weekly limit
Whether there was an error fetching stats
Error message if any
Error type for better handling