Know the Exact Credit Cost of Every reportUsage Call
The reportUsage response now includes a consumed field, showing exactly how many credits were deducted by each individual usage report.
✨ What’s New
Previously, the reportUsage response returned the customer’s updated credit usage, but it did not clearly indicate how many credits were consumed by that specific request.
With this update, the credit object returned by reportUsage now includes:
consumed— The number of credits deducted by this specificreportUsagecallcurrentUsage— The customer’s total credit usage across the wallet
Idempotency handling: For duplicate/retry requests with the same idempotency key, consumed returns 0. This makes it effortless to verify that a retried request did not trigger a duplicate credit deduction.
⭐️ Why It Matters
While tracking the total balance is necessary for access control, backend applications often need to log or display the direct impact of individual operations—especially when credit costs are dynamic (e.g., variable LLM token consumption).
The consumed field enables you to:
- Display per-action costs: Show end users instant feedback on how many credits a specific task, AI prompt, or API request consumed.
- Audit idempotency instantly: Safely confirm whether a network retry resulted in a fresh deduction or was recognized as a duplicate (
consumed: 0). - Simplify logging & reconciliation: Debug usage calculations and keep your internal database or audit logs perfectly in sync without manually diffing previous balance states.
📦 Availability
The consumed field is available now in the reportUsage response across Stigg’s REST, GraphQL APIs, and server SDKs:
REST-based SDKs
- TypeScript: v0.1.0-beta.49
- Python: v0.1.0-beta.43
- Go: v0.1.0-beta.44
- Java: v0.1.0-beta.41
- Ruby: v0.1.0-beta.46
GraphQL-based SDKs
- Node.js: v4.50.0
- Python / Go / .NET: v6.18.0
- Java: v6.19.0
- Ruby: v6.16.0