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

# Get Account Balance

> Check account balance and credits

## Overview

Check your account balance, available credits, points, and low balance alert settings.

## Request

### Headers

| Header      | Type   | Required | Description                     |
| ----------- | ------ | -------- | ------------------------------- |
| `x-api-key` | string | Yes      | Your API key for authentication |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://api.legnext.ai/api/account/balance' \
    --header 'x-api-key: YOUR_API_KEY'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.legnext.ai/api/account/balance"
  headers = {
      "x-api-key": "YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  result = response.json()
  print(result)
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.legnext.ai/api/account/balance', {
    method: 'GET',
    headers: {
      'x-api-key': 'YOUR_API_KEY'
    }
  });

  const result = await response.json();
  console.log(result);
  ```
</CodeGroup>

## Response

### Response Fields

| Field                    | Type    | Description                             |
| ------------------------ | ------- | --------------------------------------- |
| `code`                   | integer | Response status code (200 for success)  |
| `message`                | string  | Response message                        |
| `data`                   | object  | Account balance data                    |
| `data.account_id`        | integer | Your account identifier                 |
| `data.balance_usd`       | float   | Current balance in USD                  |
| `data.available_credits` | integer | Available credits for API usage         |
| `data.available_points`  | integer | Available points                        |
| `data.alert_threshold`   | integer | Low balance alert threshold in USD      |
| `data.low_balance_alert` | boolean | Whether low balance alert is triggered  |
| `data.updated_at`        | string  | Last update timestamp (ISO 8601 format) |

### Example Response

```json theme={null}
{
  "code": 200,
  "data": {
    "account_id": 1,
    "balance_usd": 72.048,
    "available_credits": 71000,
    "available_points": 1048,
    "alert_threshold": 10,
    "low_balance_alert": false,
    "updated_at": "2025-11-05T08:22:37.784663288Z"
  },
  "message": "success"
}
```

## Understanding Your Balance

* **balance\_usd**: Your current account balance in US dollars
* **available\_credits**: Credits that can be used for API operations
* **available\_points**: Bonus points or promotional credits
* **alert\_threshold**: You'll receive alerts when balance falls below this amount
* **low\_balance\_alert**: Indicates if your balance is currently below the threshold

## Notes

* Check your balance regularly to ensure uninterrupted service
* Set up webhook notifications for low balance alerts
* Credits are deducted based on the API operations you perform


## OpenAPI

````yaml GET /account/balance
openapi: 3.0.3
info:
  title: Legnext AI API
  description: >
    Comprehensive API for professional image and video generation and
    manipulation using Midjourney AI models.


    ## Authentication

    All API requests require an API key passed in the `x-api-key` header.


    ## Base URL

    `https://api.legnext.ai/api`


    ## Rate Limiting

    API requests are rate limited based on your subscription plan.


    ## Webhook Support

    Most endpoints support optional callbacks. When a callback URL is provided,
    the API will POST the completed job result to that URL.
  version: 1.0.0
  contact:
    name: Legnext Support
    email: support@legnext.ai
    url: https://legnext.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.legnext.ai/api
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Image Generation
    description: Text to image, image editing, and manipulation endpoints
  - name: Video Generation
    description: Video creation and enhancement endpoints
  - name: Image Enhancement
    description: AI-powered image upscaling and enhancement using Topaz Labs
  - name: Task Management
    description: Job status tracking and retrieval
  - name: Account
    description: Account information and active tasks management
paths:
  /account/balance:
    get:
      tags:
        - Account
      summary: Get Account Balance
      description: Retrieve your account balance, available credits, and points
      operationId: getAccountBalance
      responses:
        '200':
          description: Balance retrieved successfully
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````