/crypto-news response. Each starter pays 0.001 USDC and refuses a higher price.
Check the price for free
This needs Python 3 only. It needs no wallet and no packages:eip155:8453 is Base. solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp is Solana. To price another route, change the URL. The API reference lists every route with its price.
Pay with Python on Base
The payment wallet needs USDC on Base. It needs no ETH. LoadX402_PRIVATE_KEY through your local secret configuration. Never put a key in source code or an agent conversation.
base_request.py and run it with python base_request.py:
Pay with Python on Solana
Solana payment works on every route whose price quote lists Solana. The payment wallet needs USDC on Solana. It needs no SOL, because the network fee is paid for you. LoadSOLANA_PRIVATE_KEY, the wallet’s base58 secret key, through your local secret configuration.
solana_request.py and run it with python solana_request.py:
Pay with Node.js on Solana
The same Solana payment from Node.js 20.18 or later:solana-request.mjs and run it with node solana-request.mjs:
Read the result
Each starter savesotto-result.json. It holds the data and the PAYMENT-RESPONSE receipt, which is base64 JSON with the settlement transaction. Read the result explains each field.
If the payment is refused, the starter prints the reason from the 402 answer, for example insufficient_funds. A refused payment is not charged.
Each starter pays for one call. Give an automated loop its own total budget.