Your first 10 minutes.
From a downloaded ZIP to your first paid request on Solana devnet. You will make two test wallets, get free test money and watch your agent pay for data. Nothing here costs real money.
- 01 · DOWNLOAD YOUR STARTER1 MIN
The button below opens Build with the Paid API Example already ticked. It adds Payments and Spending Controls for you. Press Generate Project, then Download ZIP. Unzip it and open the folder in your editor and a terminal.
Open Build, ready to download ▸You should see: A folder named my-first-paid-agent with a README.md inside. - 02 · INSTALL IT2 MIN
This downloads the project's libraries and makes your private settings file. .env.local stays on your laptop and is never committed to git.
# Install the libraries $ npm install# Make your private settings file $ cp .env.example .env.local
You should see: npm install finishes without a red error. - 03 · MAKE TWO TEST WALLETS1 MIN
A payment needs someone who pays and someone who gets paid. These commands make both and write them into .env.local. They are throwaway devnet wallets: no app, no sign-up, no seed phrase to write down.
# Where payments arrive (the seller) $ npm run keygen -- --pay-to# Who pays (your agent) $ npm run keygen
You should see: Each command prints an address: a long string of letters and numbers. Keep both handy. - 04 · GET FREE TEST MONEY3 MIN
Open faucet.circle.com, choose Solana Devnet and USDC, paste the first address and request. Then do the same for the second. Both need it: the agent so it can pay, the seller so it has an account to receive into. The faucet has a robot check, so this part is by hand.
Open faucet.circle.com ↗You should see: Two faucet requests done, one per address. - 05 · START THE APP1 MIN
First check both wallets have test USDC, then start the app and open http://localhost:3000.
# Both lines should show ✓ $ npm run wallets# Start the app $ npm run dev
You should see: The home page says your app is running and lists the Paid API. - 06 · MAKE YOUR FIRST PAID REQUEST1 MIN
Open http://localhost:3000/premium and press the two buttons in order: the first shows the 402 Payment Required answer and its price, the second lets your agent pay $0.01 of test USDC. Or do it from a second terminal:
# The price, without paying $ curl -i http://localhost:3000/api/premium# Pay once and get the data $ npm run pay
You should see: A receipt with a transaction id. Paste it into the Solana Explorer on devnet to see your payment on chain. Solana Explorer (devnet) ↗ - DONE YOU PAID FOR DATA
That was a real payment on a real network, made by code you own. Now make it yours: change what the paid endpoint returns, set your own price, or let a visitor pay from their own wallet with the Wallet Connection module (Web Application only).