Skip to main content
Version: Next

ChargeOptions

Index

Properties

optionalcount

count?: number = 1

The number of events to charge for.

eventName

eventName: string

The name of the event type to charge for. This should match one of the event names defined in the Actor's pricing configuration.

optionalidempotencyKey

idempotencyKey?: string

A unique key preventing a retried operation from being charged for twice - e.g. a request handler rerun by a retry. A repeat under the same key within three minutes is not sent to the API and reports the chargedCount of the original call, or zero if it names a different event. Like the platform, the key is forgotten afterwards. In a multi-tenant Server Actor run, every call is sent and the platform deduplicates it.

optionalrequestId

requestId?: string

ID of the Server Actor request being charged, taken from the X-Actor-Request-ID header of the incoming request. Required for multi-tenant Server Actor runs, where it maps the charge to the caller's account instead of the account that started the run. Ignored elsewhere.