Documentation
API Reference
GET
Get Usage Statistics
/v1/usage
Retrieve detailed usage statistics for your A4F API key. This endpoint provides insights into your account information, subscription status, rate limits, token consumption, and model-specific usage.
Authentication Required
This endpoint requires authentication using your A4F API key. Include your API key in the
Authorization
header as a Bearer token.Headers
Authorization
stringRequired
Bearer token for authentication. Your A4F API key. Example:
Bearer ddc-a4f-xxxxxxxx
. See Authentication.Query Parameters
section
stringOptional. A comma-separated list of sections to include in the response. If omitted, all sections are returned. Valid sections are:
account_information
, subscription_details
, billing_information
, rate_limits_and_restrictions
, usage_statistics
, model_specific_usage
.Response Body (200 OK)
The response is a JSON object containing various statistics, broken down into sections.
account_information
objectDetails about your account.
username
stringYour username or display name.
current_plan
stringYour current subscription plan (e.g., 'free', 'basic', 'pro').
is_enabled
booleanWhether your API key is currently active.
api_key
stringYour full API key.
node_id
stringYour GitHub node ID or equivalent identifier.
model_specific_usage
objectAn object where keys are model IDs and values are usage statistics for that model.
subscription_details
objectInformation about your current subscription.
creation_date
string (ISO 8601)Date your API key was created.
total_validity_days
integerTotal validity period of your current plan in days (-999999 for unlimited).
effective_days_remaining
integerRemaining days in your current plan's validity.
plan_activation_history
array of objectsHistory of plan activations.
billing_information
objectSummary of billing.
payment_transactions
arrayA list of payment amounts.
total_amount_paid_usd
numberTotal amount paid in USD.
cumulative_cost_usd
numberEstimated cumulative cost of all usage in USD.
rate_limits_and_restrictions
objectYour current API rate limits.
requests_per_minute_limit
integerRequests Per Minute (RPM) limit.
requests_per_minute_remaining
integer | stringRemaining requests for the current minute.
requests_per_day_limit
integerRequests Per Day (RPD) limit.
requests_per_day_remaining
integer | stringRemaining requests for the current day.
model_whitelist
object | stringYour specific model whitelist, if configured.
model_blacklist
object | stringYour specific model blacklist, if configured.
usage_statistics
objectAggregated usage statistics.
overall_request_counts
objectBreakdown of request counts by type.
token_consumption
objectBreakdown of token counts by type (chat, embedding, etc.).
image_consumption
objectStatistics on generated images.
Interactive Example
Request & Response Example
Was this page helpful?