Usage Statistics API

Retrieve usage statistics for your account, including per-model breakdown, daily usage, and summary totals.

Note: Query time range cannot exceed 31 days.

API Information

ItemDescription
API Path/api/v3/user/usage_stats
HTTP MethodPOST
Content-Typeapplication/json
AuthenticationBearer Token via Authorization header

Request


curl -X POST "https://api.wavespeed.ai/api/v3/user/usage_stats" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "start_time": "2025-10-01T00:00:00Z",
  "end_time": "2025-10-12T23:59:59Z"
}'

Parameters

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesAccess Key in format: Bearer {access_key}

Body Parameters

ParameterTypeRequiredDescription
start_timestringYesStart time in ISO 8601 format, e.g., 2025-10-01T00:00:00Z
end_timestringYesEnd time in ISO 8601 format, e.g., 2025-10-12T23:59:59Z
model_uuidstringNoFilter by specific model

Response

{
  "code": 200,
  "message": "success",
  "data": {
    "per_model_usage": [...],
    "daily_usage": [...],
    "summary": {...}
  }
}
FieldTypeDescription
data.per_model_usagearrayUsage statistics grouped by model
data.daily_usagearrayUsage statistics grouped by day
data.summaryobjectOverall usage summary

per_model_usage

FieldTypeDescriptionExample
model_uuidstringModel UUID identifier"kwaivgi/kling-v2.0-i2v-master"
model_typestringModel type"text-to-video"
unit_pricefloat64Unit price in USD0.488
total_costfloat64Total cost in USD130.000
total_countint64Total number of invocations2660
last_used_datestringLast used date (YYYY-MM-DD)"2025-10-12"

daily_usage

FieldTypeDescriptionExample
datestringDate (YYYY-MM-DD)"2025-10-01"
amountfloat64Total cost for the day in USD242.300
countint64Total invocations for the day8095
modelsarrayPer-model breakdown for the daySee below

models (under daily_usage)

FieldTypeDescriptionExample
model_uuidstringModel UUID identifier"kwaivgi/kling-v2.0-i2v-master"
amountfloat64Cost for this model on the day in USD130.000
countint64Invocations for this model on the day2660

summary

FieldTypeDescriptionExample
total_costfloat64Total cost in USD2423.000
total_requestsint64Total number of requests98765
success_requestsint64Number of successful requests95432

Response Example

{
  "code": 200,
  "message": "success",
  "data": {
    "per_model_usage": [
      {
        "model_uuid": "kwaivgi/kling-v2.0-i2v-master",
        "model_type": "text-to-video",
        "unit_price": 0.488,
        "total_cost": 1300.000,
        "total_count": 2660,
        "last_used_date": "2025-10-12"
      },
      {
        "model_uuid": "kwaivgi/kling-v2.1-i2v-pro",
        "model_type": "text-to-video",
        "unit_price": 0.976,
        "total_cost": 450.000,
        "total_count": 461,
        "last_used_date": "2025-10-11"
      }
    ],
    "daily_usage": [
      {
        "date": "2025-10-01",
        "amount": 242.300,
        "count": 8095,
        "models": [
          {
            "model_uuid": "kwaivgi/kling-v2.0-i2v-master",
            "amount": 130.000,
            "count": 2660
          },
          {
            "model_uuid": "kwaivgi/kling-v2.1-i2v-pro",
            "amount": 45.000,
            "count": 450
          }
        ]
      },
      {
        "date": "2025-10-02",
        "amount": 198.500,
        "count": 6543,
        "models": [
          {
            "model_uuid": "kwaivgi/kling-v2.0-i2v-master",
            "amount": 98.500,
            "count": 2015
          }
        ]
      }
    ],
    "summary": {
      "total_cost": 2423.000,
      "total_requests": 98765,
      "success_requests": 95432
    }
  }
}

Error Responses

CodeMessageDescription
400invalid time range: end_time must be after start_timeInvalid time range
400time range cannot exceed 31 daysQuery exceeds 31-day limit
401access_key is requiredMissing or invalid API key
500failed to get model usage summaryServer error

Business Rules

Time Range Restrictions

  • Required Fields: Both start_time and end_time must be provided
  • Maximum Time Range: Cannot exceed 31 days
  • Time Validity: end_time must be later than start_time
  • Date Format: ISO 8601 standard format (e.g., 2025-10-01T00:00:00Z)

Data Statistics Rules

  • Statistics Dimension: Statistics are aggregated by day
  • Amount Precision: All amounts are rounded to 3 decimal places
  • Currency Unit: US Dollars (USD)
  • Sorting:
    • per_model_usage: Sorted by last used date (descending)
    • daily_usage: Sorted by date (ascending)
    • models: Sorted by amount (descending)

Filtering

  • model_uuid Filter: When provided, all statistics (including summary) will only include data for that specific model
  • Exact Match: model_uuid uses exact matching, fuzzy queries are not supported

Best Practices

  • Use appropriate time ranges (e.g., 7 days, 30 days) to avoid excessive data retrieval
  • Use model_uuid parameter when querying specific model data to reduce result set size
  • Consider implementing client-side caching for frequently accessed data

Use Cases

View Overall Usage

View usage statistics for all models within a specific time period.

curl -X POST "https://api.wavespeed.ai/api/v3/user/usage_stats" \
  -H "Authorization: Bearer your_access_key" \
  -H "Content-Type: application/json" \
  -d '{
    "start_time": "2025-10-01T00:00:00Z",
    "end_time": "2025-10-12T23:59:59Z"
  }'

View Specific Model Usage

View usage statistics for a specific model only.

curl -X POST "https://api.wavespeed.ai/api/v3/user/usage_stats" \
  -H "Authorization: Bearer your_access_key" \
  -H "Content-Type: application/json" \
  -d '{
    "start_time": "2025-10-01T00:00:00Z",
    "end_time": "2025-10-12T23:59:59Z",
    "model_uuid": "kwaivgi/kling-v2.0-i2v-master"
  }'

View Last 7 Days Usage

Quickly view recent usage trends.

curl -X POST "https://api.wavespeed.ai/api/v3/user/usage_stats" \
  -H "Authorization: Bearer your_access_key" \
  -H "Content-Type: application/json" \
  -d '{
    "start_time": "2025-10-06T00:00:00Z",
    "end_time": "2025-10-12T23:59:59Z"
  }'
© 2025 WaveSpeedAI. All rights reserved.