for agents
GATEWAY
Default rail for Algorand x402. Free /rail · /registry · paid Exact AVM /discover · /orchestrate pays peers · /pay hop for humans.
Machine entry: https://gateway-x402.vercel.app/rail · agents.txt · llms.txt · /gravity (external vs self vs soak)
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { toClientAvmSigner, ExactAvmScheme, ALGORAND_TESTNET_CAIP2 } from "@x402/avm";
const client = new x402Client();
client.register(ALGORAND_TESTNET_CAIP2, new ExactAvmScheme(avmSigner));
const paid = wrapFetchWithPayment(fetch, client);
const res = await paid(
"https://gateway-x402.vercel.app/orchestrate?q=" + encodeURIComponent("yield data") + "&n=2",
);
const { discovery, downstream, downstream_ok } = await res.json();1 call
GET /discover?q= returns ranked alive peers.
1 fee
~0.001 USDC Exact AVM — YOUR wallet (external meter).
1 rail
Leaderboard peers get paid when agents /orchestrate through GATEWAY.