> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get organization active credit balances

> **Disclaimer:** This beta endpoint is evolving; the API contract may change. <br /><br /> Returns the active credit balances for the organization, each with its own balance ID, type and remaining credits, along with the total remaining credits across all of them. A balance is active when it has started, has not expired, and has credits remaining. Balances are ordered by expiration date, soonest first. The list is always present and is empty when the organization has no active balances.

<span data-endpoint-badge="Beta"><Badge color="blue">Beta</Badge></span>

**Disclaimer:** This beta endpoint is evolving; the API contract may change. <br /><br /> Returns the active credit balances for the organization, each with its own balance ID, type and remaining credits, along with the total remaining credits across all of them. A balance is active when it has started, has not expired, and has credits remaining. Balances are ordered by expiration date, soonest first. The list is always present and is empty when the organization has no active balances.

<div data-permissions class="api-section">
  <div class="api-section-heading flex flex-col gap-y-4 w-full">
    <div class="flex items-baseline border-b pb-2.5 border-gray-100 dark:border-gray-800 w-full">
      <h4 class="api-section-heading-title flex-1 mb-0">Permission</h4>
    </div>
  </div>

  <div class="py-6">
    The API key must have the `control-plane:organization:view-billing` permission.
  </div>
</div>


## OpenAPI

````yaml _specs/cloud-openapi.json GET /v1/organizations/{organizationId}/creditBalances
openapi: 3.1.1
info:
  title: OpenAPI spec for ClickHouse Cloud
  version: '1.0'
  contact:
    name: ClickHouse Support
    url: >-
      https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-1222280
    email: support@clickhouse.com
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: Notifications
  - name: User management
  - name: Billing
  - name: Role Management
  - name: Service
  - name: Backup
  - name: Snapshot
  - name: API keys
  - name: Prometheus
  - name: ClickPipes
  - name: ClickStack
  - name: Postgres
  - name: UDF
  - name: Query API endpoints
  - name: Saved queries
paths:
  /v1/organizations/{organizationId}/creditBalances:
    get:
      tags:
        - Billing
      summary: Get organization active credit balances
      description: >-
        **Disclaimer:** This beta endpoint is evolving; the API contract may
        change. <br /><br /> Returns the active credit balances for the
        organization, each with its own balance ID, type and remaining credits,
        along with the total remaining credits across all of them. A balance is
        active when it has started, has not expired, and has credits remaining.
        Balances are ordered by expiration date, soonest first. The list is
        always present and is empty when the organization has no active
        balances.
      operationId: creditBalancesGet
      parameters:
        - in: path
          name: organizationId
          description: ID of the requested organization.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 200
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
                  result:
                    $ref: '#/components/schemas/CreditBalances'
        '400':
          description: >-
            The request cannot be processed due to a client error. Please verify
            your request parameters and try again.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 400
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
        '500':
          description: >-
            An internal server error has occurred. If this issue persists,
            please contact ClickHouse Cloud support for assistance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 500
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
components:
  schemas:
    CreditBalances:
      properties:
        totalRemainingCredits:
          description: >-
            Total remaining credits across all active balances, in ClickHouse
            Credits (CHCs).
          type: number
        balances:
          type: array
          description: >-
            List of active balances for the organization. Empty when the
            organization has none.
          items:
            $ref: '#/components/schemas/CreditBalance'
    CreditBalance:
      properties:
        id:
          description: Unique ID of the balance.
          type: string
          format: uuid
        type:
          description: Type of the balance.
          type: string
          enum:
            - prepaid
            - trial
        remainingCredits:
          description: >-
            Remaining credits available on this balance, in ClickHouse Credits
            (CHCs).
          type: number
        totalAmount:
          description: Total credits granted on this balance, in ClickHouse Credits (CHCs).
          type: number
        amountSpent:
          description: Credits spent from this balance, in ClickHouse Credits (CHCs).
          type: number
        startDate:
          description: Date the balance became active. ISO-8601, based on the UTC timezone.
          type: string
          format: date-time
        expirationDate:
          description: Date the balance expires. ISO-8601, based on the UTC timezone.
          type: string
          format: date-time
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Use key ID and key secret obtained in ClickHouse Cloud console:
        https://clickhouse.com/docs/cloud/manage/openapi
      x-permission-scopes: >-
        The scope list of a `security` requirement holds ClickHouse Cloud API
        key permission ids (for example `control-plane:organization:view`), not
        OAuth scopes. OpenAPI has no field for API key permissions, so this is
        the closest available place. A key must hold every permission listed on
        an operation to call it; an operation with no scopes needs none beyond a
        valid key. Every operation declares at most one requirement object,
        always for this scheme, so the list is only ever conjunctive —
        alternative sets of permissions are never expressed.

````