Balance

http
GET https://modelgo-web-api.modelgo.ai/api/openapi/v1/user/balance
Authorization: Bearer mgpat_xxxxxxxx
X-Tenant-Id: <tenant_id>        # optional

Fields (single tenant)

FieldMeaning
tenant_idTenant actually read
is_activeWhether the account can spend
is_personalWhether this is the account's personal tenant (single owner) rather than an enterprise tenant
balance / availableTruly spendable = cash + grant + rebate; bucket values are already net of holds
reservedPreauthorization hold (do NOT subtract it from balance again)
main / gift / rewardAvailable per bucket: cash / grant / rebate
totalused + available + reserved; owner/admin only
usedAll-time consumption (sum of charge legs); owner/admin only
currencySettlement currency
updated_atLast ledger change of the cash balance row
balance_statusok / insufficient / arrears / partial / unavailable

balance includes gift and reward and excludes holds; reserved is 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.