Skip to Content
API GatewayCredit System

Credit System

The API Gateway uses a rolling quota system. Each key gets a credit allocation that refreshes automatically.

Default Settings

SettingDefault
Credits per period5000
Period length3 days

Credit Costs

OperationCredits
Text-to-image (/images/generate)5
Image-to-image (/images/transform)10
Text-to-video (/videos/generate)50
Image-to-video (/videos/generate-from-image)50
Video transition (/videos/generate-transition)60
Polling / asset retrieval / models0

How It Works

Window 1 - Day 1-3 Window 2 - Day 4-6 Auto reset 5000 credits Used: 2300 Remaining: 2700 5000 credits reset Used: 0 Remaining: 5000
Window 1 - Day 1-3 Window 2 - Day 4-6 Auto reset 5000 credits Used: 2300 Remaining: 2700 5000 credits reset Used: 0 Remaining: 5000
  • Credits are tracked per rolling window (default 3 days)
  • Window boundaries are epoch-aligned (every N days from Unix epoch)
  • When a window ends, usage resets automatically
  • If quota is exceeded, the API returns 402 with remaining balance and reset time
  • Only successful generation requests (HTTP 2xx) consume credits

Checking Usage

curl https://creative.hellyeahai.com/admin/keys/1/usage \ -H "Authorization: Bearer <admin-secret>"

Response includes quota.remaining, quota.used_this_period, and quota.current_window_end.

Last updated on