Send an unpaid POST and base64-decode its PAYMENT-REQUIRED header as JSON, then choose the exact Solana USDC offer in accepts and check its asset, payTo and amount against your spending limit. USDC has six decimal places, so an amount of 1000000 base units pays exactly 1 USDC. The example uses an offline transaction and sample credentials, so always request fresh terms and create a new order for a wallet transfer.
You can also read the guide as JSON.
The unpaid POST
{
"method": "POST",
"url": "https://loopholetape.com/fees/pack",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json"
},
"body": {}
}The decoded 402 reply
{
"status": 402,
"decoded_headers": {
"PAYMENT-REQUIRED": {
"x402Version": 2,
"error": "Payment required",
"resource": {
"url": "https://loopholetape.com/fees/pack",
"description": "One thousand usable fee checks cost 1 USDC.",
"mimeType": "application/json"
},
"accepts": [
{
"scheme": "exact",
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000",
"payTo": "9HkwyUhDMyjbpSpnyu5xuZ9vRaFQeajnJsavhie7XcsT",
"maxTimeoutSeconds": 90,
"extra": {
"feePayer": "11157t3sqMV725NVRLrVQbAu98Jjfk1uCKehJnXXQs"
}
}
]
}
},
"body": {
"message": "One thousand usable fee checks cost 1 USDC.",
"how_to_pay": "/pay",
"price_usdc": 1,
"terms_header": "PAYMENT-REQUIRED",
"payment_header": "PAYMENT-SIGNATURE"
}
}The signed POST
Fetch a recent blockhash from your Solana RPC node and sign one USDC transferChecked for the exact amount from your associated token account to the payee’s associated token account. Use extra.feePayer as the transaction’s fee payer and leave its signature for the payment service, so the buyer needs no SOL.
Send the same POST body and content type again with PAYMENT-SIGNATURE set to the base64 encoding of the payment JSON, which carries the serialized transaction in base64. Decode PAYMENT-RESPONSE from base64 to read the settlement and keep the private reply. An x402 request that returns a 4xx or 5xx is never charged. If the service reports an uncertain settlement, use the supplied check_url before submitting another transfer.
{
"method": "POST",
"url": "https://loopholetape.com/fees/pack",
"headers": {
"Content-Type": "application/json",
"Accept": "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GTzJES01RenZCMEZEcHBZODM4b2xod0dZKzE5OUREcFJYL0p3OGd0RmpNWjBHQjhZVGpxZ3NZWnBTU1ZYUVVkZ1VKWXdNR1JtL2xJUmN5Lyt5dHVuTERtK2U4ak9XN3hmY1NheXhEbXpwQUFBQUFCVXBUV3BrcElRWk5KT2h4WU5vNGZIdzF0ZDI4a3J1QjVCK29RRUVGUkkwRzNmYmgxMldoazluTDRVYk82M21zSExTRjdWOWJONUU2alBXRmZ2OEFxY2I2ZXZPKzI2MDZQV1h6YXF2SmRER3h1K1RDMHZiZzVIeW1BZ05GTDExaEFRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFFQkFBRkFpQk9BQUFFQUFrREFRQUFBQUFBQUFBR0JBSUhBd0VLREVCQ0R3QUFBQUFBQmdVQUlHSTNPRGs0TmpNd05qUmxPVGhtWW1JeU5EbGxOMlk0WlRKaE9EQmtaRFl3QUE9PSJ9fQ=="
},
"body": {}
}The decoded payment payload
{
"x402Version": 2,
"resource": {
"url": "https://loopholetape.com/fees/pack",
"description": "One thousand usable fee checks cost 1 USDC.",
"mimeType": "application/json"
},
"accepted": {
"scheme": "exact",
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000",
"payTo": "9HkwyUhDMyjbpSpnyu5xuZ9vRaFQeajnJsavhie7XcsT",
"maxTimeoutSeconds": 90,
"extra": {
"feePayer": "11157t3sqMV725NVRLrVQbAu98Jjfk1uCKehJnXXQs"
}
},
"payload": {
"transaction": "AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsfTItjTrXVSsoENL2oDBZ03zsao0YrdWCTGBSmPfl3luMhvn5oAuUu6KVH44UJP3atTU678hkG1gWCE/ZNZQHgAIBBAgAAAABkHB7w+8lvcmO11y3DWHIsQbcJI2O9h4dHbHKQDV8p5A4Rb9lmbRASVqlgXQrIM4mS/0hbDtTP9GHLjQNl2NtUCcsk1vn1wvkBFO2DKMQzvB0FDppY838olhwGY+199DDpRX/Jw8gtFjMZ0GB8YTjqgsYZpSSVXQUdgUJYwMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAABUpTWpkpIQZNJOhxYNo4fHw1td28kruB5B+oQEEFRI0G3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8Aqcb6evO+2606PWXzaqvJdDGxu+TC0vbg5HymAgNFL11hAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAFAiBOAAAEAAkDAQAAAAAAAAAGBAIHAwEKDEBCDwAAAAAABgUAIGI3ODk4NjMwNjRlOThmYmIyNDllN2Y4ZTJhODBkZDYwAA=="
}
}The decoded settlement and paid reply
{
"status": 200,
"decoded_headers": {
"PAYMENT-RESPONSE": {
"success": true,
"transaction": "4MWGtpGvezWgXpV3H9oPvCrJwwyvHHaNdzrN9PrZTBeQmd1EYJtEJi7gLfP4nSeybcdHcev2oaJ3f2fjVvVLGQLg",
"network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"payer": "4bnrUoYh57tubbby4zPA3ibdCDwPDY1LgyDZ7gz3Rdjz"
}
},
"body": {
"access_key": "0000000000000000000000000000000000000000000000000000000000000000",
"check_url": "/fees/order/00000000000000000000000000000000/check",
"check_method": "POST",
"state": "paid",
"paid": true,
"fee_url": "/fees/MINT?venue=VENUE",
"balance_url": "/fees/balance"
}
}POST /wallet-report/full
POST the wallet to /wallet-report/prepare and repeat after Retry-After while it returns 202, then buy when ready is true and the coverage suits you. GET receipt_url to reopen the report for thirty days.
{
"method": "POST",
"path": "/wallet-report/full",
"price_usdc": 1,
"body": {
"wallet": "5oWPWVXKzPtDvi3iZUXaopQS9gCfv74Lm9V7czf6omLK"
},
"reply_fields": [
"report",
"receipt_url"
],
"memo_path": "/wallet-report/WALLET/prepare"
}POST /watch/subscribe
Send Authorization: Bearer ACCESS_KEY when reading the wallet feeds and when renewing the same watch.
{
"method": "POST",
"path": "/watch/subscribe",
"price_usdc": 2,
"body": {
"wallet": "5oWPWVXKzPtDvi3iZUXaopQS9gCfv74Lm9V7czf6omLK"
},
"reply_fields": [
"check_url",
"check_method",
"state",
"paid",
"access_key",
"wallet",
"watch_url",
"events_url",
"stream_url",
"hourly_url",
"subscribe_url",
"reading"
],
"memo_path": "/watch/memo"
}POST /alerts/subscribe
Use Authorization: Bearer ACCESS_KEY to read the feed or change deliveries and verify webhook signatures with signing_key. You may include a filter with lists named programs, instructions and errors.
{
"method": "POST",
"path": "/alerts/subscribe",
"price_usdc": 2,
"body": {
"webhook_url": "https://example.com/alerts"
},
"reply_fields": [
"check_url",
"check_method",
"state",
"paid",
"access_key",
"signing_key",
"manage_url",
"feed_url",
"stream_url"
],
"memo_path": "/alerts/memo"
}POST /fees/pack
Replace MINT with a coin address and VENUE with pump or pumpswap and send Authorization: Bearer ACCESS_KEY to fee_url to spend a usable reply or to balance_url to see how many remain.
{
"method": "POST",
"path": "/fees/pack",
"price_usdc": 1,
"body": {},
"reply_fields": [
"check_url",
"check_method",
"state",
"paid",
"access_key",
"fee_url",
"balance_url"
],
"memo_path": "/fees/memo"
}POST /feedcheck/full
Use the times and filters from the free count and put the signatures from your log in the signatures array, or send text/plain with the filters on the first line and one signature on each following line. The report contains slots, slot_count, coverage, totals, examples, method, privacy and reading, and GET receipt_url reopens the comparison for seven days.
{
"method": "POST",
"path": "/feedcheck/full",
"price_usdc": 2,
"body": {
"start_us": 1700000000000000,
"end_us": 1700000060000000,
"venues": [
"pump.fun"
],
"include_failed": true,
"signatures": [
"1111111111111111111111111111111111111111111111111111111111111111"
]
},
"reply_fields": [
"receipt_url",
"report"
],
"memo_path": "/feedcheck/memo"
}Pay from a wallet
For a watch, an alert or a fee pack, POST the same JSON body to the product’s memo route with Accept: application/json and save the private order_url. For a feed comparison, POST text/plain to /feedcheck/memo with the filters as JSON on the first line and one signature on each following line. Open solana_pay_url in the wallet and send the exact USDC amount with the supplied memo and reference before expires. POST to check_url with Accept: application/json and repeat after Retry-After seconds while the status is 202, then read the settled reply or its error. For a wallet report, first read the free day and POST to its prepare_url, then GET order_url until ready and use its pay_to, price_usdc and memo for the transfer, then POST to check_url to collect receipt_url.
{
"order_url": "/fees/order/SAMPLE",
"check_url": "/fees/order/SAMPLE/check",
"check_method": "POST",
"state": "ready",
"paid": false,
"price_usdc": 1,
"pay_to": "9HkwyUhDMyjbpSpnyu5xuZ9vRaFQeajnJsavhie7XcsT",
"memo": "00000000000000000000000000000000",
"reference": "9whbBTQFjBx8qWJf5ZFGHyBQeGRQxTg3UcCpG1yx1xtZ",
"expires": 1795754400,
"solana_pay_url": "solana:9HkwyUhDMyjbpSpnyu5xuZ9vRaFQeajnJsavhie7XcsT?amount=1&spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&memo=00000000000000000000000000000000&reference=9whbBTQFjBx8qWJf5ZFGHyBQeGRQxTg3UcCpG1yx1xtZ"
}Run the client
Download the client and inspect the terms with --quote, which reads no key and signs nothing. To pay, install solders and replace --quote with --keypair and your keypair filename, and set --max-usdc to the amount you allow. The default cap is 1 USDC and the default payee is the report service. You can set X402_ACCESS_KEY to your saved watch key when renewing, and use --body with --content-type text/plain to send a feed log.
You can save the Python client and run these commands.
curl -fsS https://loopholetape.com/pay/x402_buy.py -o x402_buy.py
python3 x402_buy.py https://loopholetape.com/fees/pack --json '{}' --quote
python3 -m pip install solders
python3 x402_buy.py https://loopholetape.com/fees/pack --json '{}' --max-usdc 1 --keypair BUYER.jsonYou can look up a failed trade or check a free day from your wallet to see what its trades and fees cost, and you can watch a bot wallet live for a free day, which shows each trade and failure within seconds beside what other wallets paid on the same coin. You can also see what the buyers of a coin just paid in fees, check whether buys are failing for everyone right now, check whether your bot’s data feed missed any transactions, see how a program pays, look up any pump.fun launch and replay a bot’s past picks with fees and delays.