Skip to main content
POST
Buy credits with x402

Authorizations

x-api-key
string
header
required

An API key (chance_sk_live_…) from https://harness.chance.cc/keys.

Query Parameters

credits
integer
required

Credits to buy. Integer, 20 to 10,000 by default. 1 credit = $0.05.

Required range: 20 <= x <= 10000
account
string

Public top-up code (chance_topup_…). Use it instead of an API key to pay for another account. Ignored when an API key is sent.

Response

Settled and credited. PAYMENT-RESPONSE carries the settlement.

credited
integer
Example:

200

usd
string
Example:

"10.00"

creditsRemaining
integer

New balance. Only returned when the request authenticated with an API key.

Example:

203

txHash
string | null

Base settlement transaction.

payer
string

Address that signed the payment.

replayed
boolean

True when this payment was already credited and the original result is returned.