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 report before reporting it

value
number
required

The value to report for usage. Fractional values are accepted and rounded half away from zero to 5 decimal places. A value with a fractional part must have an absolute value below 34,359,738,368 (2^35); whole numbers are accepted up to ±9,007,199,254,740,991.

Required range: -9007199254740991 <= x <= 9007199254740991
featureId
string
required

Feature id

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

Customer id

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

The customer resource this usage applies to. Optional — only required if the customer has multiple resources (for example, one subscription per workspace or site) and usage needs to be tracked separately per resource; omit it to report usage at the customer level.

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
updateBehavior
enum<string>
default:DELTA

How the reported value is applied: DELTA (default) adds it to the feature's current usage; SET treats it as the new absolute usage total, and Stigg computes the delta internally.

Available options:
DELTA,
SET
dimensions
object

Additional dimensions for the usage report

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