Motivation MoneyMotivation Money
API 参考Treasury

Get current CEX account balances

Returns real-time balance from the connected CEX account, broken down by stablecoin and account type (funding, trading, earn).

Requires treasury:read scope.

Note: Balance is fetched live from the CEX API. Response time depends on CEX API latency (typically 200-500ms).

GET
/treasury/balance
AuthorizationBearer <token>

API key: Authorization: Bearer mpk_live_<key>

In: header

Response Body

application/json

application/json

curl -X GET "https://motivation-money.vercel.app/api/v1/treasury/balance"
{
  "data": {
    "cex_provider": "OKX",
    "cex_connected": true,
    "balances": {
      "USDC": {
        "available_usd_cents": 5240000,
        "frozen_usd_cents": 0,
        "funding_usd_cents": 5240000,
        "trading_usd_cents": 0,
        "earn_usd_cents": 0
      },
      "USDT": {
        "available_usd_cents": 1800000,
        "frozen_usd_cents": 0,
        "funding_usd_cents": 1800000,
        "trading_usd_cents": 0,
        "earn_usd_cents": 0
      }
    },
    "fetched_at": "2026-03-12T14:30:00.000Z"
  }
}
{
  "error": {
    "code": "CEX_CONNECTION_FAILED",
    "message": "Could not reach OKX API.",
    "details": {
      "cex_provider": "OKX",
      "last_successful_fetch": "2026-03-12T14:00:00.000Z"
    },
    "recovery_hint": "Verify CEX credentials in Settings. Retry after 30 seconds."
  }
}