Credit System
The API Gateway uses a rolling quota system. Each key gets a credit allocation that refreshes automatically.
Default Settings
| Setting | Default |
|---|---|
| Credits per period | 5000 |
| Period length | 3 days |
Credit Costs
| Operation | Credits |
|---|---|
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 / models | 0 |
How It Works
- 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
402with 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