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

# 获取信用信息

> 返回已认证团队的信用余额、每批次明细、活跃订阅以及是否允许使用。

如需指导概览，请参阅[余额和账单](/balance-billing/balance-and-billing)。


## OpenAPI

````yaml zh/openapi/billing.json GET /user/credits/info
openapi: 3.0.3
info:
  title: 余额与账单 API
  version: 1.0.0
  description: 读取已认证团队的信用余额并购买充值。
servers:
  - url: https://api.olostep.com
security: []
tags:
  - name: Balance & Billing
    description: 信用余额和充值购买端点。
paths:
  /user/credits/info:
    get:
      tags:
        - Balance & Billing
      summary: 获取信用信息
      description: 返回已认证团队的信用余额、每批次的详细信息、活跃订阅以及是否允许使用。适用于计费小部件、使用仪表板和大型任务前的预检。
      responses:
        '200':
          description: 已认证团队的信用余额和计费上下文。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsInfoResponse'
              example:
                credits: 12500
                breakdown:
                  - purchase_kind: Subscription
                    allocated_units: 10000
                    remaining_units: 8500
                    expiry_date: 1735689600
                  - purchase_kind: Top-up
                    allocated_units: 5000
                    remaining_units: 4000
                    expiry_date: 1743465600
                active_subscription:
                  id: SUB_PRO
                  display_name: Pro
                  credits: 10000
                  created_at: 1704067200
                allow_usage: true
        '402':
          description: 无效的 API 密钥。
        '500':
          description: 内部服务器错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Internal Server Error
      security:
        - Authorization: []
components:
  schemas:
    CreditsInfoResponse:
      type: object
      properties:
        credits:
          type: integer
          description: 所有未过期批次中的剩余信用总数。
        breakdown:
          type: array
          items:
            $ref: '#/components/schemas/CreditsBreakdownItem'
          description: 每个批次的信用详情。
        active_subscription:
          $ref: '#/components/schemas/ActiveSubscription'
        allow_usage:
          type: boolean
          description: 团队是否仍然可以使用信用。
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: 机器可读的错误代码。
        retry_after:
          type: integer
          description: 允许再次尝试购买的秒数（仅限冷却响应）。
        cooldown_seconds:
          type: integer
          description: 冷却窗口（仅限冷却响应）以秒为单位。
    CreditsBreakdownItem:
      type: object
      properties:
        purchase_kind:
          type: string
          enum:
            - Subscription
            - Top-up
            - Manual
            - Setup
            - Pending
          description: 信用批次的发行方式。
        allocated_units:
          type: integer
          description: 最初分配给此批次的信用。
        remaining_units:
          type: integer
          description: 此批次中仍可用的信用。
        expiry_date:
          type: integer
          description: 此批次过期的 Unix 时间戳。
    ActiveSubscription:
      type: object
      properties:
        id:
          type: string
          description: 订阅产品 id（例如 `SUB_PRO`）。当没有活跃订阅时，回退到 `SUB_BASE`。
        display_name:
          type: string
          description: 人类可读的计划名称。
        credits:
          type: integer
          description: 活跃计划中包含的信用。
        created_at:
          type: integer
          description: 订阅创建时的 Unix 时间戳。
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: Bearer认证头格式为Bearer <token>，其中<token>是你的认证令牌。

````