Account Balance
Get account balance info
GET https://billing.aimlapi.com/v1/billing/balance
Headers
Name
Value
Authorization
Bearer <token>
Content-Type
application/json
Body
-
Response Schema
Field
Description
balance
The total credits associated with the provided API key.
lowBalance
True if the balance is below the threshold.
lowBalanceThreshold
Threshold for switching to low balance status.
lastUpdated
The date of the request — i.e., the current date.
autoDebitStatus
Indicates whether auto top-up is enabled for the plan.
status
The status of the plan associated with the provided API key.
statusExplanation
A more detailed explanation of the plan status.
Example
curl https://billing.aimlapi.com/v1/billing/balance \
-H "Authorization: Bearer <YOUR_AIMLAPI_KEY>" \
-H "Content-Type: application/json"GET /v1/billing/balance HTTP/1.1
Host: billing.aimlapi.com
Authorization: Bearer <YOUR_AIMLAPI_KEY>
Content-Type: application/jsonimport requests
import json
def main():
response = requests.get(
"https://billing.aimlapi.com/v1/billing/balance",
headers={
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
"Content-Type": "application/json",
})
data = response.json()
print(json.dumps(data, indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()async function main() {
const response = await fetch("https://billing.aimlapi.com/v1/billing/balance", {
headers: {
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();Last updated
Was this helpful?