Dashboard

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%.

PackPriceCreditsPer CreditSavings
Starter
starter
$10200$0.050
Creator
creator
$451,000$0.04510%
Studio
studio
$1755,000$0.03530%
Enterprise
enterprise
$60020,000$0.03040%

Credit Lifecycle

When a job is created, credits are reserved from your available balance. When the job completes, credits are consumed (actual usage may differ from the estimate). If a job fails or is cancelled, reserved credits are released back to your balance.

Get Credit Balance

Retrieve your current credit balance, reserved credits for in-flight jobs, and available credits.

GET/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.

GET/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

ParameterType
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.

POST/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

ParameterType
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)

ParameterType
qai_enabled
boolean
Default: false
max_kf_retries
integer
Default: 0
max_video_retries
integer
Default: 0

Body (HITL)

ParameterType
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

Call the Estimate endpoint before creating a job to show the user an accurate credit cost. The same estimation logic is used internally when the job is actually created.

List Model Pricing

Retrieve per-variant pricing for all active models. Use this to build pricing tables or calculators.

GET/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

ParameterType
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.

GET/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/packs

Create Checkout Session

Start a Stripe or PayPal checkout session to purchase a credit pack. Redirect the user to the returned URL to complete payment.

POST/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

ParameterType
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

The Billing API also includes endpoints for managing saved payment methods (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

Retrying a failed job re-reserves credits from the restart stage onward. Check your available_credits before retrying to avoid 402 Insufficient Credits errors.