Quickstart
Make a paid request with Axo in minutes, either from the CLI or from your own code.
This quickstart is optimized for one outcome: an agent pays for a protected endpoint and gets the response.
Requirements
Use Node.js 22+ and a valid Axo/ZBD API key.
Choose Your Track
- Install the CLI:
npm install -g @axobot/cli- Initialize the wallet:
axo init --key <your_api_key>- Make a paid request:
axo fetch https://api.zbdpay.com/protected --max-sats 100Example success output:
{"status":200,"body":{"ok":true},"payment_id":"pay_123","amount_paid_sats":21}- Install the client:
npm install @axobot/fetch- Set your API key:
export ZBD_API_KEY=<your_api_key>- Run a paid fetch:
import { agentFetch, FileTokenCache, zbdPayL402Invoice } from "@axobot/fetch";
const response = await agentFetch("https://api.zbdpay.com/protected", {
tokenCache: new FileTokenCache(`${process.env.HOME}/.zbd-wallet/token-cache.json`),
maxPaymentSats: 100,
pay: (challenge, context) =>
zbdPayL402Invoice(challenge, context, {
apiKey: process.env.ZBD_API_KEY!,
}),
});
console.log(response.status, await response.text());Give this to an agent that can run shell commands:
Install @axobot/cli, initialize Axo with this API key, then attempt one paid request.
1. Run: npm install -g @axobot/cli
2. Run: axo init --key <your_api_key>
3. Run: axo fetch https://api.zbdpay.com/protected --max-sats 100
4. Stop after the first successful paid response.
5. Return the exact JSON output and the amount paid in sats.
Do not spend more than 100 sats.What Just Happened
Axo identified the payment challenge
The protected endpoint returned a payment challenge instead of the premium response.
Axo paid on the agent's behalf
The CLI or SDK used your wallet credentials to pay the invoice, subject to your spend cap.
Axo retried with proof
After payment, the request was retried automatically with the authorization proof.
You got the protected response
That successful response is the core Axo activation moment.
What To Do Next
Make an Agent Pay
Use the shortest activation path and compare CLI versus SDK flows.
Give Axo to Your Agent
Copy-paste explicit instructions for agents.
Accept Payments
Protect your own routes with @axobot/pay.
Call Paid APIs
Go deeper on @axobot/fetch and axo fetch.
Run Sessions
Switch to MPP session flows for longer-lived access.