﻿> ## Documentation Index
>
> Fetch the complete documentation index at: https://kling.ai/document-api/llms.txt
> Use this file to discover all available pages before exploring further.

# Account Usage

> Source: https://kling.ai/document-api/api/assets/account-usage
> Locale: en
> Current Tab: Account Usage
> This content is optimized for LLMs. In-page tabs are expanded and UI-only controls are omitted.

---

## Query Resource Package List and Remaining Quantity under the Account

### API Overview

- Method: `GET`
- Path: `/account/costs`
- Auth: `Authorization: Bearer <API_KEY>`
- Content-Type: `application/json`

### Description

> Note: This API is free to call and allows you to query the list and balance of resource packages under your account. Please note to control the request rate (QPS<=1)

### Headers

| Field | Type | Required | Default | Enum | Description |
|---|---|---:|---|---|---|
| `Content-Type` | string | Yes | `application/json` | - | Data Exchange Format |
| `Authorization` | string | Yes | - | - | Authentication information, refer to API authentication |

### Query Params

| Field | Type | Required | Default | Enum | Description |
|---|---|---:|---|---|---|
| `start_time` | int | Yes | - | - | Query start time, Unix timestamp, unit: ms |
| `end_time` | int | Yes | - | - | Query end time, Unix timestamp, unit: ms |
| `resource_pack_name` | string | No | - | - | Resource package name, used to precisely specify a resource package to query |

### Request Example

```bash
curl --request GET \
  --url 'https://api-singapore.klingai.com/account/costs?start_time=1726124664368&end_time=1727366400000' \
  --header "Authorization: Bearer ${KLING_API_KEY}" \
  --header 'Content-Type: application/json'
```

### Response Example

```json
{
  "code": 0, // Error codes; specific definitions see Error codes
  "message": "string", // Error information
  "request_id": "string", // Request ID, generated by the system, for tracking and troubleshooting
  "data": {
    "code": 0, // Error codes; specific definitions see Error codes
    "msg": "string", // Error information
    "resource_pack_subscribe_infos": [ // Resource package list
      {
        "resource_pack_name": "Video Generation - 10,000 entries", // Resource package name
        "resource_pack_id": "509f3fd3d4ab4a3f9eec5db27aa44f27", // Resource package ID
        "resource_pack_type": "decreasing_total", // Resource package type; "decreasing_total" = decreasing total, "constant_period" = constant periodicity
        "resource_pack_tier": "flagship", // Resource package tier. Enum values: "flagship" = Flagship, "general" = General, "professional" = Professional, "basic" = Basic
        "resource_pack_applicable_models": "Available only for Kling 4.0 and Kling 4.0 Flash", // Models applicable to the resource package
        "total_quantity": 200.0, // Total quantity
        "remaining_quantity": 118.0, // Remaining quantity (Please note: remaining quantity statistics have a 12h delay)
        "purchase_time": 1726124664368, // Purchase time, Unix timestamp in ms
        "effective_time": 1726124664368, // Effective time, Unix timestamp in ms
        "invalid_time": 1727366400000, // Expiration time, Unix timestamp in ms
        "status": "expired" // Resource package status: "toBeOnline" = Pending effectiveness, "online" = In effect, "expired" = Expired, "runOut" = Used up
      }
    ]
  }
}
```
