Skip to main content
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.
string
The client (organization) the wallet belongs to.
float
Total spendable credits across all buckets.
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.
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

Raises

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

See also