Consume credits
Consumes a specified amount of credits directly from a customer wallet, with no feature mapping. Returns the optimistic balance.
Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Body
Request body for consuming credits directly from a wallet
The customer to consume credits from (required)
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$The credit currency to consume from (required)
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$The amount of credits to consume
x > 0A unique key used to deduplicate the consumption (required)
1 - 255Optional resource the consumption is attributed to
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$Optional dimensions describing the consumption
Optional timestamp the consumption is attributed to
Response
The result of the credit consumption, including the optimistic balance.
Response object
Result of a synchronous direct credit consumption
