XonaXona Docs
OverviewResourcesxPayInference

Quickstart

Make your first paid Xona request — from the browser, a server, an agent, or the xPay CLI.

Every Xona resource lives under one base URL and is paid per request in USDC. There are no accounts or API keys — you bring a wallet.

https://api.xona-agent.com

Pick a path

  • xPay CLI / SDK — the fastest way. xPay handles the x402 payment flow for you. Start here if you want one command.
  • Browser / Node with @dexterai/x402 — wrap fetch and let the library settle payments automatically.
  • MCP — connect Claude, Cursor, or your own agent and call resources as tools. See MCP server.

Install and create a wallet

npm install -g @xona-labs/xpay
xpay init

init prints a 24-word recovery phrase once and encrypts your keys with a passphrase. Back it up — there is no way to recover it if you lose it.

Fund it

Send a little USDC to the printed Solana (or Base) address.

Discover and pay

xpay discover "short video"
xpay pay api.xona-agent.com/video/short-generation \
  --body '{"prompt":"a cat astronaut"}'

See the full xPay guide for the SDK, MCP server, guardrails, and more.

From the browser or a server

Use @dexterai/x402 to handle the 402 flow automatically with a connected wallet.

npm install @dexterai/x402
import { wrapFetch } from "@dexterai/x402/client";

const x402Fetch = wrapFetch(fetch, {
  walletPrivateKey: process.env.SOLANA_PRIVATE_KEY,
});

// Hit any Xona resource — payment is handled automatically
const res = await x402Fetch("https://api.xona-agent.com/image/designer", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ prompt: "A cyberpunk cityscape at sunset" }),
});

const { image_url } = await res.json();

What's next

On this page