Quickstart
1. Connect a wallet
Open the app and click Connect wallet (Phantom or Solflare). The wallet needs the USDC you want to give and about 0.0021 SOL per arm for its rent and the fee. The rent comes back when the arm closes.
2. Give an agent an arm
Pick an empty arm, name it, press Generate key (or paste the address of a key your agent already holds), set the budget and the daily cap, and paste the x402 endpoints it may pay. An endpoint URL is resolved to its payTo address by reading its 402 challenge. Sign the rules (a message), then the transaction. A generated key is shown once: copy it into the agent's environment.
3. Run the agent
mkdir agent && cd agent && npm init -y && npm i @solana/web3.js
curl -O https://www.allowanceengine.com/sdk/agent.mjs
cat > run.mjs <<'JS'
import { createAgent } from "./agent.mjs";
const agent = createAgent({
owner: process.env.OWNER, arm: Number(process.env.ARM), secretKey: process.env.AGENT_KEY,
facilitator: "https://www.allowanceengine.com/api/x402",
});
console.log(await agent.status());
const r = await agent.paidFetch("https://www.allowanceengine.com/api/x402/quote?symbol=SOL");
console.log(r.status, await r.json());
JS
OWNER=<your wallet> ARM=0 AGENT_KEY=<session key secret> node run.mjsThe quote endpoint costs 0.01 USDC and returns a live Jupiter price. For the call to go through, its payTo must be on the arm's allow-list: the app fills https://www.allowanceengine.com/api/x402/quote in by default and resolves it.
4. Watch, then ink
The app shows each arm's spend for the UTC day and every payment as it lands. Ink closes every arm and returns everything in one transaction.