> ## 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 ja/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>はあなたの認証トークンです。

````