Axo

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

  1. Install the CLI:
npm install -g @axobot/cli
  1. Initialize the wallet:
axo init --key <your_api_key>
  1. Make a paid request:
axo fetch https://api.zbdpay.com/protected --max-sats 100

Example success output:

{"status":200,"body":{"ok":true},"payment_id":"pay_123","amount_paid_sats":21}
  1. Install the client:
npm install @axobot/fetch
  1. Set your API key:
export ZBD_API_KEY=<your_api_key>
  1. 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

On this page