CCSub
API Reference

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

  1. Acquisition: Credits are added to your account through subscriptions, one-time purchases, or new-user gifts.
  2. Freeze: When you start a video generation, the estimated credits are frozen (reserved).
  3. Settle: On successful generation, frozen credits are consumed (settled).
  4. 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

FieldDescription
AvailableCredits available for use (not frozen, not expired)
FrozenCredits currently reserved for in-progress generations
UsedTotal credits consumed across all time
TotalSum of all credits ever received

Credit History

Retrieve the credit transaction history for the authenticated user.

GET /api/v1/credit/history

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
pageSizenumber20Items 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

TypeDescription
NEW_USERFree credits given to new users on registration
ORDER_PAYCredits from a one-time credit pack purchase
SUBSCRIPTIONCredits from a subscription plan (monthly/yearly)
VIDEO_CONSUMECredits consumed for video generation
REFUNDCredits refunded due to failed generation
EXPIREDCredits that expired (from an expired package)
SYSTEM_ADJUSTManual admin adjustment

Credit Pricing by Model

Different AI models consume different amounts of credits per generation.

ModelPricing ModelExample
Sora 2Per-second6 credits/s — 10s = 60 credits, 15s = 90 credits
Veo 3.1Fixed per clip13 credits (720p/1080p), 37 credits (4K)
Kling 3Per-second6 credits/s (720p), higher for 1080p
Seedance 1.5 ProPer-second4 credits/s (720p), 8 credits/s (1080p)
Wan 2.6Currently 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"
}
FieldTypeRequiredDescription
creditsnumberYesAmount of credits to add (must be > 0)
userIdstringNoTarget user ID (defaults to the current admin)
expiryDaysnumberNoCredit validity period in days (default: 365)
remarkstringNoTransaction note for audit trail

Response

{
  "success": true,
  "data": {
    "credits": 100,
    "userId": "user_abc123",
    "expiryDate": "2027-03-13T00:00:00.000Z"
  }
}
Credits API | CCSub