Get Balance
Get the user’s current API wallet balance, unrealized PnL, and total value.
Accepts both X-API-Key and Authorization: Bearer <jwt> so the
website’s API-keys dashboard can render the API wallet card via the
cookie session. The returned balance is always the API wallet
(account.api_balance) regardless of auth source, since this is the
documented API wallet endpoint — UI MAIN/SANDBOX balances live behind
/v1/me/wallets instead.
Per-user 5-second cache (override via BALANCE_CACHE_TTL_S env;
set to 0 to disable). Trade writes bust the cache via
app.api_v1._user_cache.bust_balance_cache.
Authorizations
Issue from /v1/keys (or admin-issued for enterprise tier).