Users API
Key Feature: The Users API provides real-time blockchain balance information through a reliable fallback strategy.
User and Wallet Model
Each user in the Mage platform includes:-
Identity:
- Unique user ID (UUID)
- Name
- Role
- Organization ID
-
Authentication:
- API key
- OAuth provider
-
Wallet:
- Wallet address
- Associated blockchain network
- Balance (retrieved in real-time from blockchain)
Available Endpoints
Get Wallet Balance
Retrieve the authenticated user’s wallet balance from the blockchain
Wallet Operations
Wallets in Mage have several key characteristics:- Associated with User: Each user has a primary wallet for funding agents
- Automatic Agent Wallets: Each agent also automatically gets a dedicated wallet upon creation
- Network Specific: Wallets operate on specific blockchain networks (mainnet or testnets)
- Balance Reporting: All balances are retrieved in real-time from the blockchain
- Fallback Strategy: Balance retrieval follows a priority system - first USDC, then ETH, and finally any other non-zero balance
Asset Support
Response Format: All balance values are returned as strings to preserve precision for financial calculations.
- USDC: Primary stablecoin for transactions (checked first)
- ETH: Secondary asset (checked if USDC is unavailable)
- Other Assets: Additional tokens may be reported if both USDC and ETH balances are zero
User Authentication
Required: All wallet balance requests must include your API key in the header to authenticate the user and access their wallet data.