Credits API
API reference for querying credit balances and transaction history in Kensa.
Credits API
Kensa uses a credit-based system for video generation. Credits are consumed when videos are generated, and can be purchased through subscriptions or one-time credit packs.
Credit System Overview
How Credits Work
- Acquisition: Credits are added to your account through subscriptions, one-time purchases, or new-user gifts.
- Freeze: When you start a video generation, the estimated credits are frozen (reserved).
- Settle: On successful generation, frozen credits are consumed (settled).
- Release: On failure, frozen credits are returned to your balance (released).
FIFO Consumption
Credits are consumed using a First-In, First-Out (FIFO) approach across credit packages. The oldest credits (closest to expiration) are consumed first, ensuring fair expiration handling.
Credit Packages
Each credit addition creates a credit package with:
- An initial credit amount
- A remaining credit balance
- An expiration date
- A transaction type (subscription, purchase, gift, etc.)
Get Credit Balance
Retrieve the current credit balance for the authenticated user. This is available through the user session data.
Balance Fields
| Field | Description |
|---|---|
| Available | Credits available for use (not frozen, not expired) |
| Frozen | Credits currently reserved for in-progress generations |
| Used | Total credits consumed across all time |
| Total | Sum of all credits ever received |
Credit History
Retrieve the credit transaction history for the authenticated user.
GET /api/v1/credit/history
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
pageSize | number | 20 | Items per page |
Response
{
"success": true,
"data": {
"transactions": [
{
"id": "txn_abc123",
"transNo": "TXN-20260313-001",
"transType": "VIDEO_CONSUME",
"credits": -60,
"balanceAfter": 220,
"videoUuid": "550e8400-e29b-41d4-a716-446655440000",
"remark": "Sora 2 - 10s video generation",
"createdAt": "2026-03-13T10:03:00.000Z"
},
{
"id": "txn_def456",
"transNo": "TXN-20260313-002",
"transType": "ORDER_PAY",
"credits": 280,
"balanceAfter": 50,
"orderNo": "ord_xyz789",
"remark": "Starter Pack purchase",
"createdAt": "2026-03-13T09:00:00.000Z"
}
],
"total": 15,
"page": 1,
"pageSize": 20
}
}
Transaction Types
| Type | Description |
|---|---|
NEW_USER | Free credits given to new users on registration |
ORDER_PAY | Credits from a one-time credit pack purchase |
SUBSCRIPTION | Credits from a subscription plan (monthly/yearly) |
VIDEO_CONSUME | Credits consumed for video generation |
REFUND | Credits refunded due to failed generation |
EXPIRED | Credits that expired (from an expired package) |
SYSTEM_ADJUST | Manual admin adjustment |
Credit Pricing by Model
Different AI models consume different amounts of credits per generation.
| Model | Pricing Model | Example |
|---|---|---|
| Sora 2 | Per-second | 6 credits/s — 10s = 60 credits, 15s = 90 credits |
| Veo 3.1 | Fixed per clip | 13 credits (720p/1080p), 37 credits (4K) |
| Kling 3 | Per-second | 6 credits/s (720p), higher for 1080p |
| Seedance 1.5 Pro | Per-second | 4 credits/s (720p), 8 credits/s (1080p) |
| — | Currently unavailable |
For detailed pricing, see the individual model documentation:
Admin: Add Credits
Administrators can manually add credits to any user account.
POST /api/v1/admin/credits/add
Requires admin role.
Request Body
{
"credits": 100,
"userId": "optional-user-id",
"expiryDays": 365,
"remark": "Promotional credits"
}
| Field | Type | Required | Description |
|---|---|---|---|
credits | number | Yes | Amount of credits to add (must be > 0) |
userId | string | No | Target user ID (defaults to the current admin) |
expiryDays | number | No | Credit validity period in days (default: 365) |
remark | string | No | Transaction note for audit trail |
Response
{
"success": true,
"data": {
"credits": 100,
"userId": "user_abc123",
"expiryDate": "2027-03-13T00:00:00.000Z"
}
}