> ## 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.

# credits.get_balance

> Return the current credit balance and per-bucket breakdown for your wallet.

```python theme={null}
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.

<ResponseField name="client_id" type="string">
  The client (organization) the wallet belongs to.
</ResponseField>

<ResponseField name="balance_credits" type="float">
  Total spendable credits across all buckets.
</ResponseField>

<ResponseField name="warning_low" type="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.
</ResponseField>

<ResponseField name="buckets" type="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.
</ResponseField>

### Example

```python theme={null}
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

* [credits.get\_ledger](/sdk-reference/credits/get-ledger)
* [credits.estimate](/sdk-reference/credits/estimate)
* [credits.redeem](/sdk-reference/credits/redeem)
