Skip to main content
POST
Top up credits (x402, USDC on Base)

Authorizations

x-api-key
string
header
required

Your Chance API key (chance_sk_…), created in the dashboard.

Query Parameters

credits
integer
required

How many credits to buy (1 credit = $0.05). Default bounds: 20–10000.

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

Public account code (chance_topup_…) naming the account to credit. Use this instead of an x-api-key header when paying on someone else's behalf; the code can only add credits.

Response

Payment settled and credits granted. The PAYMENT-RESPONSE header carries the x402 settlement (tx hash, payer, network).

credited
integer

Credits added by this payment.

Example:

200

usd
string
Example:

"10.00"

creditsRemaining
integer

New balance.

Example:

203

txHash
string | null

Base settlement transaction hash.

payer
string

Wallet that paid (recovered from the signature).

replayed
boolean

True when this response replays an already-credited payment (idempotent retry).