APIMODELSAPIMODELS
Документация API

apimodels.app

Free · API key only

Account Balance API

A single GET request returns the credit balance (in USD) of the account that owns the API key. Read-only, never charges — perfect for your own dashboard, billing widget, or low-balance alerts.

At a glance

Endpoint
GET /api/v1/balance
Auth
Authorization: Bearer <API_KEY>
Pricing
Free (no credits charged)
Currency
USD

Request

GET /api/v1/balance
Authorization: Bearer <API_KEY>

Example

cURL

curl https://api.apimodels.app/v1/balance \
  -H "Authorization: Bearer $API_KEY"

Python

import requests, os

r = requests.get(
    "https://api.apimodels.app/v1/balance",
    headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
)
data = r.json()["data"]
print(f"Available: ${data['balance']} {data['currency']}")
print(f"Total: ${data['total']}  Frozen: ${data['frozen']}")

Node.js

const r = await fetch("https://api.apimodels.app/v1/balance", {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
const { data } = await r.json();
console.log(`Available: $${data.balance} ${data.currency}`);

Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "balance": 12.5,
    "total": 12.5,
    "frozen": 0,
    "currency": "USD"
  }
}
FieldRequiredTypeDescription
data.balance—numberAvailable balance = total − frozen (what you can spend)
data.total—numberTotal credits on the account
data.frozen—numberTemporarily frozen credits (e.g. abnormal invite activity), not usable
data.currency—stringCurrency, always "USD"

Errors

  • 401 — Missing or invalid API key
  • 500 — Internal server error