# 获取剩余积分

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/generate/credit:
    get:
      summary: 获取剩余积分
      deprecated: false
      description: |
        获取您账户当前可用的积分余额。

        ### 用法指南
        - 在生成音乐、歌词或使用其他处理功能时会消耗积分。
        - 此接口允许您在启动任务前检查当前积分余额。
        - 返回一个表示您可用积分的整数值。
        - 无需参数；通过API密钥进行身份验证即可。

        ### 开发者说明
        1. 定期监控您的积分余额以避免服务中断。
        2. 如果积分不足，生成任务将失败并返回错误代码 429。
        3. 考虑在开始成本较高的生成操作之前集成此检查。
        4. 此接口轻量级，可根据需要频繁调用。
      operationId: get-remaining-credits
      tags:
        - docs/zh-CN/Common API
      parameters: []
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      code:
                        type: integer
                        description: |-
                          # 状态码说明

                          - ✅ 200 - 请求成功
                          - ⚠️ 400 - 参数错误
                          - ⚠️ 401 - 没有访问权限
                          - ⚠️ 404 - 请求方式或者路径错误
                          - ⚠️ 405 - 调用超过限制
                          - ⚠️ 413 - 主题或者prompt过长
                          - ⚠️ 429 - 积分不足
                          - ⚠️ 430 - 您的调用频率过高。请稍后再试。
                          - ⚠️ 455 - 网站维护
                          - ❌ 500 - 服务器异常
                        enum:
                          - 200
                          - 400
                          - 401
                          - 404
                          - 405
                          - 413
                          - 429
                          - 430
                          - 455
                          - 500
                        examples:
                          - 200
                      msg:
                        type: string
                        description: 当 code != 200 时，展示错误信息
                        examples:
                          - success
                    x-apidog-orders:
                      - code
                      - msg
                  - type: object
                    properties:
                      data:
                        type: integer
                        description: |-
                          您账户中当前可用的积分数量。
                          - 每个API操作根据功能不同消耗特定数量的积分。
                          - 可在您的账户仪表板购买额外积分。
                        examples:
                          - 100
                    x-apidog-orders:
                      - data
          headers: {}
          x-apidog-name: 成功
        '500':
          description: 服务器异常
          headers: {}
          x-apidog-name: 服务器错误
      security: []
      x-apidog-folder: docs/zh-CN/Common API
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1412907/apis/api-46842395-run
components:
  schemas: {}
  securitySchemes:
    BearerAuth:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        # 🔑 API Authentication


        All endpoints require authentication using Bearer Token.


        ## Get API Key


        1. Visit the [API Key Management Page](https://sunoapi.org/api-key) to
        obtain your API Key


        ## Usage


        Add to request headers:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```


        > **⚠️ Note:**

        > - Keep your API Key secure and do not share it with others

        > - If you suspect your API Key has been compromised, reset it
        immediately from the management page
servers:
  - url: https://apibox.erweima.ai
    description: 正式环境
security: []

```
