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

# Query User Balance

> Query the credit balance of your user account

# Query User Balance

Query the current credit balance of your user account in real-time.

## Use Cases

<CardGroup cols={2}>
  <Card title="Dashboard Display" icon="chart-line">
    Show real-time account balance in your application dashboard
  </Card>

  <Card title="Balance Alerts" icon="bell">
    Set up notifications when credits fall below a threshold
  </Card>

  <Card title="Recharge Reminders" icon="wallet">
    Prompt users to top up credits before running out
  </Card>

  <Card title="Usage Tracking" icon="chart-bar">
    Monitor credit consumption and track spending patterns
  </Card>
</CardGroup>

## Important Notes

<Info>
  **Real-time Balance**: The balance returned reflects your current credit amount at the time of the request.
</Info>

<Tip>
  **Rate Limiting**: Avoid excessive polling. Cache the balance and refresh only when necessary (e.g., after completing a generation task).
</Tip>

<Warning>
  **Credit Deduction**: Credits are deducted only when generation tasks complete successfully. Failed tasks do not consume credits.
</Warning>


## OpenAPI

````yaml /api-manual/account-management/user-balance.json GET /api/user/balance
openapi: 3.0.0
info:
  title: Vidgo API - User Balance API
  description: Query the credit balance of your user account in real-time
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/user/balance:
    get:
      tags:
        - Account Management
      summary: Query User Balance
      description: Query the current credit balance of your user account in real-time
      operationId: getUserBalance
      responses:
        '200':
          description: Balance retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceResponse'
              example:
                code: 200
                data:
                  email: goseasp@gmail.com
                  credits_amount: 17276
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 401
                error:
                  message: Invalid API key
                  type: authentication_error
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 429
                error:
                  message: Rate limit exceeded
                  type: rate_limit_error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 500
                error:
                  message: Internal server error
                  type: server_error
components:
  schemas:
    BalanceResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          description: HTTP status code
        data:
          type: object
          required:
            - email
            - credits_amount
          properties:
            email:
              type: string
              format: email
              example: goseasp@gmail.com
              description: Email address associated with the account
            credits_amount:
              type: integer
              example: 17276
              description: Current credit balance in the account
    ErrorResponse:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: integer
          example: 400
          description: HTTP status code
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid API key
              description: Error message describing what went wrong
            type:
              type: string
              example: authentication_error
              description: Error type identifier
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        All API endpoints require Bearer Token authentication


        Get your API Key:


        Visit the [API Key Management
        Page](https://vidgo.ai/apis/dashboard/api-key) to get your API Key


        Add it to the request header:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````