Skip to main content
POST
JavaScript

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-ACCOUNT-ID
string

Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.

X-ENVIRONMENT-ID
string

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

application/json

Estimate the credit cost of a usage event before reporting it

eventName
string
required

The name of the usage event

Required string length: 1 - 255
customerId
string
required

Customer id

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$
resourceId
string | null

Resource id

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
dimensions
object

Dimensions associated with the usage event

Response

The credit cost estimation, including per-currency costs, balances, and warnings.

Response object

data
CreditCostEstimation · object
required

Estimated credit cost, current balance and balance after