Credits & Billing API
Check your credit balance, estimate job costs, browse model pricing, view transaction history, and purchase credit packs. 1 credit = $0.01 USD.
Credit Packs
Prepaid credit packs are the only way to add credits. Larger packs offer volume discounts up to 40%.
| Pack | Price | Credits | Per Credit | Savings |
|---|---|---|---|---|
Starterstarter | $10 | 200 | $0.050 | — |
Creatorcreator | $45 | 1,000 | $0.045 | 10% |
Studiostudio | $175 | 5,000 | $0.035 | 30% |
Enterpriseenterprise | $600 | 20,000 | $0.030 | 40% |
Credit Lifecycle
Get Credit Balance
Retrieve your current credit balance, reserved credits for in-flight jobs, and available credits.
/api/v1/credits/balance• available_credits = credit_balance − credit_reserved.
• Reserved credits are automatically released when a job completes, fails, or is cancelled.
• Check available_credits before creating a job to avoid 402 Insufficient Credits errors.
Request Example
curl -X GET https://api.u-gen.ai/api/v1/credits/balance \
-H "X-API-Key: YOUR_API_KEY"List Credit Transactions
Retrieve a paginated history of all credit movements: purchases, reservations, consumption, releases, refunds, and bonuses.
/api/v1/credits/transactions• Transaction types: purchase, reserve, consume, release, refund, bonus.
• Positive amounts are credits added (purchase, release, refund, bonus). Negative amounts are credits removed (reserve, consume).
• Each transaction records balance_before and balance_after for a full audit trail.
Parameters
| Parameter | Type |
|---|---|
page | integer Default: 1 |
page_size | integer Default: 20 |
job_id | string (UUID) |
Request Example
curl -X GET "https://api.u-gen.ai/api/v1/credits/transactions?page=1&page_size=10" \
-H "X-API-Key: YOUR_API_KEY"Estimate Job Credits
Calculate the total credits required for a job before creating it. Returns a detailed breakdown by cost component.
/api/v1/credits/estimate• The breakdown shows each cost component independently so you can see where credits go.
• Keyframe generation uses NanoBanana 2: 8 credits (1k), 12 credits (2k), or 18 credits (4k) per keyframe. N segments = N+1 keyframes.
• Kling models use per-second billing (credits × duration × segments). Veo and Sora use flat per-generation billing.
• QA retries are budgeted at 50% of the base cost per retry attempt.
• HITL rejections are budgeted at 100% of the base cost per rejection.
Body
| Parameter | Type |
|---|---|
segment_countREQ | integer |
model_id | string Default: veo3_fast |
variant | string Default: i2v |
duration_seconds | integer Default: 8 |
resolution | string Default: standard |
keyframe_resolution | string Default: 1k |
caption_style | string Default: tiktok_karaoke |
music_enabled | boolean Default: true |
voice_enabled | boolean Default: false |
custom_voice | boolean Default: false |
Body (QA)
| Parameter | Type |
|---|---|
qai_enabled | boolean Default: false |
max_kf_retries | integer Default: 0 |
max_video_retries | integer Default: 0 |
Body (HITL)
| Parameter | Type |
|---|---|
human_review_gate | boolean Default: false |
hitl_anchor_max_rejections | integer Default: 0 |
human_review_videos | boolean Default: false |
hitl_segments_max_rejections | integer Default: 0 |
Request Example
curl -X POST https://api.u-gen.ai/api/v1/credits/estimate \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"segment_count": 3,
"model_id": "veo3_fast",
"variant": "i2v",
"duration_seconds": 8,
"resolution": "standard",
"keyframe_resolution": "1k",
"music_enabled": true,
"voice_enabled": true
}'Pre-Flight Cost Check
List Model Pricing
Retrieve per-variant pricing for all active models. Use this to build pricing tables or calculators.
/api/v1/credits/pricing• Returns a bare array of all active model variant prices.
• billing_unit is either "per_generation" (flat cost) or "per_second" (cost × duration).
• kie_cost_usd is the upstream provider cost. price_usd is the marked-up price. credits = price_usd × 100.
Parameters
| Parameter | Type |
|---|---|
model_id | string |
Request Example
curl -X GET "https://api.u-gen.ai/api/v1/credits/pricing?model_id=veo3_fast" \
-H "X-API-Key: YOUR_API_KEY"List Credit Packs
Retrieve available credit packs with pricing. No authentication required.
/api/v1/billing/packs• Public endpoint — no API key required.
• savings_pct is the percentage discount compared to the Starter pack rate.
Request Example
curl -X GET https://api.u-gen.ai/api/v1/billing/packsCreate Checkout Session
Start a Stripe or PayPal checkout session to purchase a credit pack. Redirect the user to the returned URL to complete payment.
/api/v1/billing/checkout• Redirect the user to checkout_url to complete payment.
• For card payments, a Stripe Checkout session is created. For PayPal, a PayPal Order is created.
• Credits are added to the account automatically after payment is confirmed via webhook.
• session_id can be used to track the payment status.
Body
| Parameter | Type |
|---|---|
pack_idREQ | string |
payment_type | string Default: card |
Request Example
curl -X POST https://api.u-gen.ai/api/v1/billing/checkout \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"pack_id": "creator", "payment_type": "card"}'Additional Billing Endpoints
GET /billing/payment-methods, DELETE /billing/payment-methods/{id}), auto-topup configuration (GET/POST /billing/auto-topup), and low-balance email alerts (GET/POST /billing/credit-alert).Retry Credits
available_credits before retrying to avoid 402 Insufficient Credits errors.