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.

Headers

Authorization

string
Required
Bearer token for authentication. Your A4F API key. Example: Bearer ddc-a4f-xxxxxxxx. See Authentication.

Query Parameters

section

string
Optional. 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

object
Details about your account.

username

string
Your username or display name.

current_plan

string
Your current subscription plan (e.g., 'free', 'basic', 'pro').

is_enabled

boolean
Whether your API key is currently active.

api_key

string
Your full API key.

node_id

string
Your GitHub node ID or equivalent identifier.

model_specific_usage

object
An object where keys are model IDs and values are usage statistics for that model.

subscription_details

object
Information about your current subscription.

creation_date

string (ISO 8601)
Date your API key was created.

total_validity_days

integer
Total validity period of your current plan in days (-999999 for unlimited).

effective_days_remaining

integer
Remaining days in your current plan's validity.

plan_activation_history

array of objects
History of plan activations.

billing_information

object
Summary of billing.

payment_transactions

array
A list of payment amounts.

total_amount_paid_usd

number
Total amount paid in USD.

cumulative_cost_usd

number
Estimated cumulative cost of all usage in USD.

rate_limits_and_restrictions

object
Your current API rate limits.

requests_per_minute_limit

integer
Requests Per Minute (RPM) limit.

requests_per_minute_remaining

integer | string
Remaining requests for the current minute.

requests_per_day_limit

integer
Requests Per Day (RPD) limit.

requests_per_day_remaining

integer | string
Remaining requests for the current day.

model_whitelist

object | string
Your specific model whitelist, if configured.

model_blacklist

object | string
Your specific model blacklist, if configured.

usage_statistics

object
Aggregated usage statistics.

overall_request_counts

object
Breakdown of request counts by type.

token_consumption

object
Breakdown of token counts by type (chat, embedding, etc.).

image_consumption

object
Statistics on generated images.

Interactive Example

Request & Response Example

curl "https://api.a4f.co/v1/usage?section=account_information,rate_limits_and_restrictions" \
-H "Authorization: Bearer YOUR_A4F_API_KEY"

Was this page helpful?