The mem.account namespace manages the account; the top-level client exposes usage, billing, and analytics reads.

account.get

account.get() -> dict[str, Any]
The full account view: plan, profile, api_keys, billing contact, payment method, invoices, and the current invoice.
acc = mem.account.get()
assert "plan" in acc and "api_keys" in acc

account.update

account.update(patch: dict[str, Any]) -> dict[str, Any]
Patch any of profile, notifications, billing_contact, payment_method, plan. Returns the updated view.
upd = mem.account.update({"profile": {"agent_name": "Ada"}})
assert upd["profile"]["agent_name"] == "Ada"

API keys

account.create_api_key(name: str = "default") -> dict[str, Any]
account.revoke_api_key(key_id: str) -> dict[str, Any]
key = mem.account.create_api_key("ci")
mem.account.revoke_api_key(key["id"])

Checkout

account.checkout(plan: str) -> dict[str, Any]
account.confirm_checkout(checkout_id: str,
                         payment_id: str | None = None,
                         signature: str | None = None) -> dict[str, Any]
Free plans activate immediately (checkout returns {"free": True, ...}); paid plans return a payment-provider session you confirm with confirm_checkout.
co = mem.account.checkout("Starter Tier")
assert co["free"] is True

Usage, billing & analytics

The top-level client reads counters and computed cost:
mem.usage()       # {"org_id", "counters": {...}}
mem.billing()     # {"total", "currency", "line_items", ...}
mem.analytics()   # memory size, cache efficiency, top domains
mem.users()       # {"users": [...], "count": N, "current": "..."}

Billing API

Checkout, invoices, and usage endpoints.