Balance
http
GET https://modelgo-web-api.modelgo.ai/api/openapi/v1/user/balance
Authorization: Bearer mgpat_xxxxxxxx
X-Tenant-Id: <tenant_id> # optionalFields (single tenant)
| Field | Meaning |
|---|---|
tenant_id | Tenant actually read |
is_active | Whether the account can spend |
is_personal | Whether this is the account's personal tenant (single owner) rather than an enterprise tenant |
balance / available | Truly spendable = cash + grant + rebate; bucket values are already net of holds |
reserved | Preauthorization hold (do NOT subtract it from balance again) |
main / gift / reward | Available per bucket: cash / grant / rebate |
total | used + available + reserved; owner/admin only |
used | All-time consumption (sum of charge legs); owner/admin only |
currency | Settlement currency |
updated_at | Last ledger change of the cash balance row |
balance_status | ok / insufficient / arrears / partial / unavailable |
balanceincludes gift and reward and excludes holds;reservedis reported separately.
Without X-Tenant-Id
Returns every readable tenant:
json
{
"items": [
{ "tenant_id": "tnt_a", "balance": "10.00", "used": "2.00", "total": "12.00", "balance_status": "ok" },
{ "tenant_id": "tnt_b", "balance": "0", "balance_status": "insufficient" }
]
}Sorted by tenant_id; inaccessible tenants are omitted; a failed tenant reads balance_status=unavailable with no amounts.