# Account Balance

## \[legacy] Get account balance info

{% hint style="warning" %}
This endpoint is considered legacy and is scheduled for future deprecation.\
Please plan to migrate to the new `/v2/billing` and `/v2/billing/detail` endpoints documented below.
{% endhint %}

You can query your account balance and other billing details through this API.\
To make a request, you only need your AIMLAPI key obtained from your [account dashboard](https://aimlapi.com/app/keys).

## GET /v1/billing/balance

>

```json
{"openapi":"3.0.0","info":{"title":"AIML API","version":"1.0.0"},"servers":[{"url":"https://api.aimlapi.com"}],"paths":{"/v1/billing/balance":{"get":{"operationId":"_v1_billing_balance","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"–","title":"–"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"number","description":"The total credits associated with the provided API key."},"lowBalance":{"type":"boolean","description":"True if the balance is below the threshold."},"lowBalanceThreshold":{"type":"number","description":"Threshold for switching to low balance status."},"lastUpdated":{"type":"string","format":"date-time","description":"The date of the request — i.e., the current date."},"autoDebitStatus":{"type":"string","description":"Indicates whether auto top-up is enabled for the plan."},"status":{"type":"string","description":"The status of the plan associated with the provided API key."},"statusExplanation":{"type":"string","description":"A more detailed explanation of the plan status."}},"required":["balance","lowBalance","lowBalanceThreshold","lastUpdated","autoDebitStatus","status","statusExplanation"]}}}}}}}}}
```

## Get balance info

Returns a user's balance.

## GET /v2/billing

>

```json
{"openapi":"3.0.0","info":{"title":"AIML API","version":"1.0.0"},"servers":[{"url":"https://api.aimlapi.com"}],"paths":{"/v2/billing":{"get":{"operationId":"_v2_billing","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"–","title":"–"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"current_balance":{"type":"number","description":"current user balance in USD."},"currency":{"type":"string","description":"balance currency (always USD)"}},"required":["current_balance","currency"]}}}}}}}}}
```

## Get detailed billing info

Returns detailed billing information, balance and auto top-up settings.

## GET /v2/billing/detail

>

```json
{"openapi":"3.0.0","info":{"title":"AIML API","version":"1.0.0"},"servers":[{"url":"https://api.aimlapi.com"}],"paths":{"/v2/billing/detail":{"get":{"operationId":"_v2_billing_detail","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"–","title":"–"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"number","description":"User ID."},"email":{"type":"string","description":"User email."},"current_balance":{"type":"number","description":"Current balance in USD."},"currency":{"type":"string","description":"Currency (always USD)."},"autotopup_settings":{"type":"object","description":"Auto top-up settings.","properties":{"is_enabled":{"type":"boolean","description":"Whether auto top-up is enabled."},"threshold":{"type":"number","description":"Balance threshold that triggers auto top-up (USD)."},"amount":{"type":"number","description":"Auto top-up amount (USD)."},"currency":{"type":"string","description":"Auto top-up currency (always USD)."}},"required":["user_id","email","current_balance","currency","autotopup_settings"]}}}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aimlapi.com/api-references/service-endpoints/account-balance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
