Try it
Ask for the article and decode the challenge. Any user agent gets the 402.
curl -s -D - -o /dev/null https://gateway.preproduction.tollbit.com/dev/v1/content/perfectstrategy.fyi/strategy/nim \
| awk 'tolower($1)=="payment-required:"{print $2}' | tr -d '\r' | base64 -d | jq .
The four steps
- Ask.
GETthe article. The gateway answers402with a base64 JSONPAYMENT-REQUIREDheader listing what it accepts. - Sign. Pick an entry and sign an EIP-3009 transfer authorization for the amount of the asset to the pay-to address, valid for the timeout shown.
- Ask again. Repeat the
GETwith the signed payload, base64 encoded, in aPAYMENT-SIGNATUREheader. - Read. TollBit verifies the payment, settles it on chain through the
facilitator, and answers
200with the article and aPAYMENT-RESPONSEheader that carries the transaction hash.
Today the preproduction gateway advertises the price but does not yet accept payment, so
steps 3 and 4 return the same 402 until x402 acceptance is switched on. In production,
agents fetch through tollbit.perfectstrategy.fyi with a TollBit token.