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

# クレジット使用量の取得

> 現在のユーザーとトークンのクレジット残高および使用状況を照会する



## OpenAPI

````yaml ja/api-manual/account-management/get-credits.json GET /v1/credits
openapi: 3.1.0
info:
  title: クレジット使用量取得 API
  description: 現在のユーザーとトークンのクレジット残高および使用状況を照会する
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 本番環境
security:
  - bearerAuth: []
tags:
  - name: アカウント管理
    description: クレジット照会などを含むアカウント関連API
paths:
  /v1/credits:
    get:
      tags:
        - アカウント管理
      summary: クレジット使用量の取得
      description: 現在のユーザーとトークンのクレジット残高および使用状況を照会する
      operationId: getCredits
      responses:
        '200':
          description: クレジット情報の取得に成功しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponse'
              example:
                data:
                  token:
                    remaining_credits: 99416.4429
                    unlimited_credits: false
                    used_credits: 583.5571
                  user:
                    remaining_credits: 1095.3996
                    used_credits: 135.9048
                message: ''
                success: true
        '400':
          description: 無効なリクエストパラメータ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 400
                  message: 無効なリクエスト
                  type: invalid_request_error
        '401':
          description: 認証失敗、無効または期限切れのトークン
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '403':
          description: アクセス拒否
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: アクセス拒否
                  type: permission_error
        '429':
          description: レート制限を超過しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: レート制限を超過しました
                  type: rate_limit_error
                  fallback_suggestion: retry after 60 seconds
        '500':
          description: 内部サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: 内部サーバーエラー
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: 上流サービスエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: 上流サービスエラー
                  type: upstream_error
                  fallback_suggestion: try again later
        '503':
          description: サービス一時利用不可
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: サービス一時利用不可
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    CreditsResponse:
      type: object
      required:
        - data
        - message
        - success
      properties:
        data:
          type: object
          required:
            - token
            - user
          properties:
            token:
              type: object
              description: トークンクレジット情報
              required:
                - remaining_credits
                - unlimited_credits
                - used_credits
              properties:
                remaining_credits:
                  type: number
                  format: double
                  description: トークンの残りクレジット
                  example: 99416.4429
                unlimited_credits:
                  type: boolean
                  description: トークンが無制限クレジットを持っているかどうか
                  example: false
                used_credits:
                  type: number
                  format: double
                  description: トークンで使用されたクレジット
                  example: 583.5571
            user:
              type: object
              description: ユーザークレジット情報
              required:
                - remaining_credits
                - used_credits
              properties:
                remaining_credits:
                  type: number
                  format: double
                  description: ユーザーの残りクレジット
                  example: 1095.3996
                used_credits:
                  type: number
                  format: double
                  description: ユーザーが使用したクレジット
                  example: 135.9048
        message:
          type: string
          description: レスポンスメッセージ
          example: ''
        success:
          type: boolean
          description: リクエストが成功したかどうか
          example: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP ステータスエラーコード
              example: 401
            message:
              type: string
              description: エラーの説明
              example: Invalid or expired token
            type:
              type: string
              description: エラータイプ
              example: authentication_error
            param:
              type: string
              description: 関連パラメータ名
              example: token
            fallback_suggestion:
              type: string
              description: エラー処理の提案
              example: retry after 60 seconds
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべてのAPIにBearer Token認証が必要です##

        **APIキーの取得：**

        [APIキー管理ページ](https://evolink.ai/dashboard/keys)にアクセスしてAPIキーを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````