Avalanche Fuji · USDC

Avalanche Tabs

Pay-per-call APIs in USDC on Avalanche. An agent signs one deposit and the API opens a tab for it. Each call then carries a signed voucher. The agent never holds AVAX and sends no transaction per call.

Try it

  1. Get demo dollars

    dUSD is a test token that works like Circle USDC: 6 decimals and signed transfers (EIP-3009).

  2. Open a tab

    You sign a transfer of 0.05 dUSD into a tab for one hour. The API sends it on-chain and pays the gas.

  3. Call the paid API

    Each call costs 0.001 dUSD. Your wallet signs a voucher for the new total, off-chain.

    No calls yet.

How it works

  1. The agent calls the API. The API answers 402 with its price, token and Tabs contract.
  2. The agent signs a USDC transfer authorization (EIP-3009) to the Tabs contract. The signed nonce fixes the payee, the voucher key and the expiry, so the API can open only that exact tab.
  3. The API submits it with openWithAuthorization and pays the gas. The agent needs no AVAX.
  4. Each call carries a voucher: the running total, signed by the agent. The API checks it and serves the call. A failed call is not charged.
  5. The API settles the latest voucher with one charge transaction for any number of calls. After expiry, anyone can send the rest back to the agent.

Use it from code

Agent side:

const agent = createTabPayer({
  client, wallet, signer: sessionKey,
  fundWith: "authorization",
  maxPrice: parseUsdc("0.01"),
  deposit: parseUsdc("0.05"),
  lifetimeSeconds: 3600,
});
const response = await agent.fetch("https://api.example/v1/data");

API side:

const gate = createTabGate({ client, offer, store });
const sponsor = createTabSponsor({ client, wallet, offer, minDeposit });

if (url.pathname === "/v1/tabs") return sponsor.serve(request);
return gate.serve(request, async () => Response.json(await lookup()));

Live numbers

Paid calls
-
dUSD charged
-
Tabs
-

Tabs contract: -

dUSD token: -