usage-stats

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

get/api/v1/usage-stats/api-key/{api_key_id}

Path parameters

api_key_idinteger required

Response

Successful Response

api_key_idinteger required

Local API key ID

api_key_namestring required

API key name

external_idstring nullable required

External API key ID

is_activeboolean required

Whether API key is active

expires_atstring nullable

Expiration timestamp from API

expires_at_displaystring

Formatted expiration time for display

current_tokensinteger

Current window tokens used

current_requestsinteger

Current window requests made

current_daily_costnumber

Current daily cost

formatted_current_coststring

Formatted current daily cost

current_window_tokensinteger

Current rate limit window tokens

current_window_requestsinteger

Current rate limit window requests

current_window_costnumber

Current rate limit window cost

total_tokensinteger

Total tokens used

total_requestsinteger

Total requests made

total_costnumber

Total cost

formatted_coststring

Formatted total cost

daily_cost_limitnumber

Daily cost limit

token_limitinteger

Token limit

has_daily_limitboolean

Whether this key has daily limits

rate_limit_windowinteger

Rate limit window in minutes

rate_limit_requestsinteger

Rate limit requests per window

rate_limit_costnumber

Rate limit cost per window

opus_weekly_costnumber

Opus model cost this week

opus_weekly_limitnumber

Opus model weekly limit

opus_weekly_percentagenumber

Opus weekly usage percentage

has_monthly_quotaboolean

Whether this key has a monthly/lifetime cost cap

monthly_cost_limitnumber

Monthly cost limit in USD (CRS totalCostLimit)

monthly_cost_usednumber

Amount of monthly cost used

monthly_cost_percentagenumber

Percentage of monthly cost limit used

window_remaining_secondsinteger

Seconds until window reset

window_remaining_textstring

Human readable time until reset

daily_cost_percentagenumber

Percentage of daily cost limit used

token_percentagenumber

Percentage of token limit used

window_requests_percentagenumber

Percentage of window requests used

window_cost_percentagenumber

Percentage of window cost used

is_near_cost_limitboolean

Whether near daily cost limit

is_near_token_limitboolean

Whether near token limit

is_near_window_limitboolean

Whether near window limit

is_near_opus_limitboolean

Whether near Opus weekly limit

has_errorboolean

Whether there was an error fetching stats

error_messagestring nullable

Error message if any

error_typestring nullable

Error type for better handling

Changes

No recorded changes to this endpoint across all 1 revision of this API.