> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sigrunai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get API key quota balance

> 返回当前 API Key 的调用额度（与账户积分独立）。

Returns the **call quota** for the current API key (independent of account points). If you set `total_quota` in the console, the key is capped; `0` means unlimited.

### Response fields

| Field | Type | Description |
| :- | :- | :- |
| `name` | string | Key name |
| `total_quota` | number | Total quota; `0` means unlimited |
| `used_quota` | number | Used quota (see below) |
| `available_quota` | number | Remaining = `total_quota` - `used_quota`; `0` when unlimited |
| `unlimited` | boolean | Whether the key has no quota cap |

### About `used_quota`

`used_quota` is the **current key’s** cumulative charged usage in the same unit as `total_quota` (points).

* **Scope**: only jobs charged through **this** key.
* **When it increases**: after a job is submitted and charged (`cost` added to `used_quota`).
* **Enforcement**: if `total_quota > 0` and `used_quota >= total_quota`, new billable requests with this key are rejected.
* **Vs account `used_coin`**: [`/user/balance`](/en/api-reference/common/user-balance) is account-wide net spend; `used_quota` is per-key.

<Note>
  Charges still debit the user points balance. `total_quota` / `used_quota` only cap how much one key may spend.
</Note>

### Example

```bash theme={null}
curl -X GET 'https://sigrunai.com/v1/key/balance' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

```json theme={null}
{
  "code": 20000,
  "msg": "ok",
  "data": {
    "name": "production-key",
    "total_quota": 1000,
    "used_quota": 120.5,
    "available_quota": 879.5,
    "unlimited": false
  }
}
```


## OpenAPI

````yaml GET /v1/key/balance
openapi: 3.1.0
info:
  title: AI Platform OpenAPI
  description: 异步图片与视频生成。创建后轮询 task_id；结果 URL 约保留 3 天。
  version: 1.0.0
servers:
  - url: https://sigrunai.com
    description: AI Platform 生产环境
security:
  - bearerAuth: []
paths:
  /v1/key/balance:
    get:
      tags:
        - Account
      summary: Get API key quota balance
      description: >-
        Returns call quota for the current API key (independent of account
        points).
      operationId: getKeyBalance
      responses:
        '200':
          description: Key quota
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyBalanceResponse'
components:
  schemas:
    KeyBalanceResponse:
      type: object
      properties:
        code:
          type: integer
          example: 20000
        msg:
          type: string
        data:
          type: object
          properties:
            name:
              type: string
            total_quota:
              type: number
            used_quota:
              type: number
            available_quota:
              type: number
            unlimited:
              type: boolean
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 控制台创建的 API Key，格式：Bearer sk_xxx

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.