Nickel docs
Quick start
Install @nickel/node, add the middleware with mode set to test, and list the routes you want to charge for. Start your server and call a priced route without a payment header. You should get a 402 with the price and your wallet address.
Install @nickel/client in your agent, wrap fetch, and call the route again. The SDK signs with a fake balance and retries. The dashboard shows the call as paid in test mode.
How payments and receipts work
Each priced route returns a 402 that names the amount, the token (SOL, USDC or another SPL token) and the provider wallet. The agent signs a Solana transfer and sends the transaction signature as proof on the retry.
Nickel checks the transfer, serves the response and attaches a signed receipt. Funds go directly to the provider wallet and are never held by Nickel. Look up any transaction on Solscan.
Moving from test to live
In test mode all balances are fake and nothing touches the chain. When you are ready, set payTo to a wallet you control and change mode to live. Phantom, Solflare and Backpack all work for receiving and approving payments.
We suggest sending a 0.001 USDC check from your own wallet first and matching the receipt to the transaction on Solscan.