Skip to main content
Get account balance for proxy mode. Retrieves the current balance and usage information for the API key account. Only available in proxy mode.

Signature

client.get_balance(api_key: Optional = None)

Parameters

  • api_key: Override the default API key. Uses instance api_key if not provided.

Returns

Dict containing balance information (USDC amount, usage stats, etc.).

Raises

  • RuntimeError: If called in relay mode (balance endpoint is proxy-only).

Examples

>>> client = HTTPayerClient(api_key="your-key")
>>> balance = client.get_balance()
>>> print(f"Balance: {balance['balance']} Credits")