Billing
client.billing is a read-only view of the organization wallet and the service price catalog: balances, usage, transactions, and plans.
Purchases, top-ups, coupons, credit allocations, payment methods, and invoices are managed in the web console — they are not available in the SDK.
Credits
balance = client.billing.credits.balance()
print(balance.balance, balance.held_credits)
overview = client.billing.credits.overview()
print(overview.org_kind, overview.account_state, overview.requires_topup)
costs = client.billing.credits.costs()
for cost in costs:
print(cost.service_type, cost.credits_per_unit, cost.unit_name)
txns = client.billing.credits.transactions(limit=50, type="consumption")
for txn in txns.transactions:
print(txn.type, txn.amount, txn.service_type)
usage = client.billing.credits.usage_by_project(
start="2026-07-01T00:00:00Z",
end="2026-08-01T00:00:00Z",
)
for entry in usage.projects:
print(entry.project_id, entry.credits_consumed)Project API keys are pinned to their project: transactions() returns
only that project's rows, and usage_by_project() returns only its own
entry. credits.project_transactions(project_id) is the project-scoped
ledger read for project admins, and credits.lots() lists the wallet's
credit batches with their expiry dates.
| Method | Return Type | Description |
|---|---|---|
credits.balance() | CreditBalance | Org wallet balance (exact decimals) |
credits.overview() | CreditOverview | Balance, buckets, org kind / account state, capabilities, shared overage |
credits.costs() | list[ServiceCost] | Active service price catalog |
credits.transactions(limit=...) | CreditTransactionList | Wallet ledger rows |
credits.project_transactions(project_id, ...) | CreditTransactionList | One project's ledger rows |
credits.usage_by_project(...) | ProjectUsageSummary | Per-project consumption rollup |
credits.lots(...) | CreditLotList | Credit batches and expiries |
Enterprise group
Access is enterprise-only: a primary organization holds the contract (Included credits per billing window, a shared overage allowance, the top-up price) and may create member sub-organizations and allocate credits to them. The group view is read-only in the SDK; allocations are made in the web console.
overview = client.billing.credits.overview()
print(overview.org_kind, overview.account_state) # primary enterprise
print(overview.capabilities.can_topup, overview.shared_overage)
group = client.billing.enterprise_group.get(overview.balance["organization_id"])
if group.contract:
print(group.contract.contract_ref, group.contract.current_window)
for sub in group.sub_organizations: # owner/admin only
print(sub.organization_id, sub.balance_decimal)
history = client.billing.enterprise_group.list_allocations(group.organization_id)| Method | Return Type | Description |
|---|---|---|
enterprise_group.get(org_id) | EnterpriseGroup | Contract, Included window, shared overage, sub-organization wallets |
enterprise_group.list_allocations(org_id) | CreditAllocationList | Allocate / reclaim history |
Wallet endpoints require the org owner or admin role; plain members get a 403 and should use credits.usage_by_project() for their per-project view.