Quickstart: pay from an agent
Create an agent, give it its key, and make its first paid call.
You need a Solana wallet in your browser with some SOL and USDC, and Node 22 where the agent runs.
Make a private wallet and deposit
Open /app, connect your wallet, press Make a private wallet and sign. Then press Deposit and move some USDC into your private balance.
Create the agent
Go to /app/agents, press New agent, name it, pick USDC and set an allowance. Sign the two transactions. Copy
AYO_AGENT_KEYfrom the done screen: it's shown once.Install the SDK
Install npm install @ayo/sdkSet the environment
.env AYO_AGENT_KEY=<the key from the done screen> AYO_PROGRAM_ID=<Ayo program ID> AYO_RPC_URL=<Solana RPC URL> AYO_API_URL=<Ayo API URL>The SDK reference lists every variable.
Make a paid call
agent.ts import { agent } from '@ayo/sdk' const payments = agent(process.env.AYO_AGENT_KEY!) const res = await payments.fetch('https://search.example/v1/search?q=solana') console.log(res.status, await res.json()) await payments.shutdown()Use any listed service's endpoint from /app/services. The first call gets the service's hello, opens a tab and is repeated with a voucher.
shutdown()settles the tab before the process exits.Watch it
Open the agent's page in the app. The call is in its live feed with its amount, the tab shows
open, thensettledaftershutdown(). Switch to the chain view to see what anyone else sees: a tab opened and closed between two addresses, with no amount.
Next
- Pay from an agent: settlement timing, retries and a durable journal
- Tabs and vouchers: what happens on each call