Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt

Use this file to discover all available pages before exploring further.

await sdk.credits.get_balance()
Fetches a snapshot of your client’s credit wallet, including the total balance, a low-balance warning flag, and the individual buckets that make up the balance. Buckets are grouped by their funding source (e.g. paid top-up, promotional grant, redeem code) and may carry their own expiry dates. Use this before kicking off a large ingestion or query workload, or to drive an in-product “credits remaining” indicator.

Parameters

This method takes no parameters.

Returns

CreditBalance dataclass with the wallet snapshot.
client_id
string
The client (organization) the wallet belongs to.
balance_credits
float
Total spendable credits across all buckets.
warning_low
bool
True when the balance has fallen below the configured low-balance threshold. A good signal to surface a “top up” prompt to your operators.
buckets
List[CreditBucket]
Per-source breakdown of the balance. Each CreditBucket has:
  • source_type (string) — origin of the credits (e.g. "paid", "promo", "redeem").
  • balance (float) — credits remaining in this bucket.
  • expires_at (datetime | None) — when this bucket expires, if applicable. None means the bucket does not expire.

Example

from maximem_synap import MaximemSynapSDK

sdk = MaximemSynapSDK(api_key="synap_your_key_here")
await sdk.initialize()

balance = await sdk.credits.get_balance()
print(f"You have {balance.balance_credits} credits")

if balance.warning_low:
    print("Balance is low — consider topping up or redeeming a code.")

for bucket in balance.buckets:
    expiry = bucket.expires_at.isoformat() if bucket.expires_at else "never"
    print(f"  {bucket.source_type}: {bucket.balance} (expires: {expiry})")

Raises

  • SynapAuthError — when the API key is missing or invalid.

See also