SDK
Wallet Client
Check token balance and transaction history with client.wallet.
The wallet client provides access to your token balance and transaction ledger.
Methods
balance()
Get your current token balance.
balance = await client.wallet.balance()
print(f"Balance: {balance} tokens")Returns: int
ledger()
Get your full transaction history.
ledger = await client.wallet.ledger()
print(f"Balance: {ledger.balance}")
for entry in ledger.transactions:
print(f" {entry.entry_type}: {entry.amount:+d} - {entry.description}")Returns: Ledger object with balance and transactions
Data Model
WalletEntry
@dataclass
class WalletEntry:
id: str
user_id: str
amount: int # Positive = credit, negative = debit
balance_after: int # Balance after this transaction
entry_type: str # e.g., "subscription", "query", "credit"
description: str | None
created_at: str | NoneEntry Types
| Type | Direction | Description |
|---|---|---|
subscription | Debit (buyer) / Credit (seller) | Artifact subscription payment |
query | Debit (buyer) / Credit (seller) | Per-query charge |
credit | Credit | Tokens added to account |
Next Steps
- Pricing & Tokens - token economy overview
- Token Wallet (Dashboard) - visual wallet management