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

# Get an organization's balance

> Returns total spend, the spend limit, the remaining credit and the credit available from each credit source for an organization the signed-in user belongs to. Amounts are integers in nano-USD (10^-9 USD).



## OpenAPI

````yaml /api-reference/cloud-platform-openapi.json get /v1/organizations/{org_id}/usage/balance
openapi: 3.1.0
info:
  description: Account, organization, workspace and billing routes of NEAR AI Cloud.
  title: NEAR AI Cloud Platform API
  version: '5'
servers:
  - url: https://cloud-platform.near.ai
    description: NEAR AI Cloud Platform
security: []
paths:
  /v1/organizations/{org_id}/usage/balance:
    get:
      tags:
        - Usage
      summary: Get an organization's balance
      description: >-
        Returns total spend, the spend limit, the remaining credit and the
        credit available from each credit source for an organization the
        signed-in user belongs to. Amounts are integers in nano-USD (10^-9 USD).
      operationId: get_organization_balance
      parameters:
        - description: The organization id (a UUID).
          in: path
          name: org_id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationBalanceResponse'
          description: The organization's balance.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The organization id is not valid.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing or invalid credential.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The user is not a member of this organization.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: The organization does not exist or has no usage or limit yet.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal error.
      security:
        - session: []
components:
  schemas:
    OrganizationBalanceResponse:
      description: >-
        An organization's spend, limit and remaining credit. Amounts are
        integers in nano-USD (10^-9 USD).
      properties:
        credit_limits:
          items:
            $ref: '#/components/schemas/CreditLimitBreakdownResponse'
          type: array
        last_usage_at:
          format: date-time
          type:
            - string
            - 'null'
        legacy_unattributed_amount:
          description: >-
            Historical consumption not yet assigned to a credit type, in
            nano-USD.
          format: int64
          type: integer
        organization_id:
          type: string
        remaining:
          format: int64
          type:
            - integer
            - 'null'
        remaining_display:
          type:
            - string
            - 'null'
        spend_limit:
          format: int64
          type:
            - integer
            - 'null'
        spend_limit_display:
          type:
            - string
            - 'null'
        total_requests:
          format: int64
          type: integer
        total_spent:
          format: int64
          type: integer
        total_spent_display:
          type: string
        total_tokens:
          format: int64
          type: integer
        unfunded_amount:
          description: Unresolved cost from completed requests that exceeded all capacity.
          format: int64
          type: integer
        updated_at:
          format: date-time
          type: string
      required:
        - organization_id
        - legacy_unattributed_amount
        - total_spent
        - total_spent_display
        - total_requests
        - total_tokens
        - updated_at
        - credit_limits
        - unfunded_amount
      type: object
    ErrorResponse:
      description: The body of every error answer on the user routes.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      type: object
    CreditLimitBreakdownResponse:
      properties:
        amount:
          description: Gross allocated amount before transfers.
          format: int64
          type: integer
        available:
          description: >-
            Remaining spendable capacity: `max(effective_capacity - consumed,
            0)`.
          format: int64
          type: integer
        consumed:
          format: int64
          type: integer
        currency:
          type: string
        effective_capacity:
          description: 'Net capacity for this source: `max(amount - transferred_out, 0)`.'
          format: int64
          type: integer
        source:
          type:
            - string
            - 'null'
        transferred_out:
          description: Nonnegative capacity transferred out to other organizations.
          format: int64
          type: integer
        type:
          type: string
      required:
        - type
        - amount
        - transferred_out
        - effective_capacity
        - consumed
        - available
        - currency
      type: object
    ErrorDetail:
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type: string
      required:
        - message
        - type
      type: object
  securitySchemes:
    session:
      bearerFormat: Session token
      description: 'Session token from signing in, sent as `Authorization: Bearer <token>`.'
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.