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

# Get Plan Balance

> Checks the current usage balance for a given plan.

Checks the current usage balance for a given plan, scoped to the authenticated subscriber or a specific address.

## Example Usage

```ts theme={null}
const balance = await payments.getPlanBalance(planId)
// OR if you provide the address of a different user
const balance = await payments.getPlanBalance(planId, userAddress)
```

## Parameters

* **planId**: The ID of the payment plan to check balance for
* **userAddress** (optional): Check balance for a specific user address instead of the authenticated user

## Returns

```json theme={null}
{
  "isSubscriber": "boolean",
  "total": "number",
  "used": "number",
  "remaining": "number"
}
```

## Notes

* If isSubscriber is false, the user has no active credits
* Balance may be time-based or credit-based depending on plan type


## OpenAPI

````yaml GET /plan/{planId}/balance
openapi: 3.1.0
info:
  title: Nevermined API
  description: >-
    API for managing AI agents, payment plans, and subscriptions in the
    Nevermined ecosystem
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: http://sandbox.mintlify.com
security:
  - bearerAuth: []
paths:
  /plan/{planId}/balance:
    get:
      tags:
        - Plans
      summary: Get Plan Balance
      description: Checks the current usage balance for a given plan.
      operationId: getPlanBalance
      parameters:
        - name: planId
          in: path
          description: The unique identifier of the plan.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Balance information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Balance'
components:
  schemas:
    Balance:
      type: object
      properties:
        isSubscriber:
          type: boolean
        total:
          type: integer
        used:
          type: integer
        remaining:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````