When to use this endpoint
CallGET /external/credits/balance before any workflow that can spend credits:
For user-facing integrations, show the balance before a paid action and refresh it after the action completes.
Endpoint
GET /external/credits/balance
Authentication
See AuthenticationSuccess status code
200 OK
Request example
Response example
Response fields
| Field | Description |
|---|---|
totalAmount | Total credits ever granted across active subscription and gift buckets. |
totalBalance | Total currently available credits. Use this for simple “can this user spend credits?” checks. |
subscriptionAmount | Subscription credits granted for the active credit period. |
subscriptionBalance | Remaining subscription credits. These are consumed before gift credits. |
giftAmount | Gift credits granted to the user. |
giftBalance | Remaining gift credits. |
resetAt | Earliest active subscription credit expiration timestamp in milliseconds, or null. |
Integration guidance
- Use
totalBalancefor high-level balance checks. - Use bucket-specific fields when your UI needs to explain subscription vs. gift credit usage.
- Refresh the balance after credit-consuming operations because
balanceAftermay differ from a previously cached value. - Treat
resetAtas nullable. Some accounts may only have gift credits or no active subscription credit expiration.
Error responses
401 Unauthorized429 Too Many Requests
Notes
resetAtis a timestamp in milliseconds for the earliest active subscription credit expiration, ornull.- Subscription credits are consumed before gift credits.
- See Credits and access for shared credit behavior.