Agents: pay for APIs in one call

NanoTab lets your agent pay for any paywalled API with USDC on Base mainnet. No ETH needed, no wallet UI — one function call handles the whole HTTP 402 flow. Fee: 0.1% self-host · 2% managed gateway.

1 · Install

npm i @nanotab/agent-sdk

Set your wallet key once: export NANOTAB_WALLET_KEY=0x…

2 · Pay

import { nanotabFetch } from '@nanotab/agent-sdk';
const data = await nanotabFetch('https://gateway.nanotab.dev/keyword/ai%20agents');

3 · The 402 flow, in words

  1. Your agent GETs a paid URL. The gateway answers 402 Payment Required with a machine-readable price (amount, merchant wallet, USDC-on-Base asset).
  2. The SDK signs a USDC payment intent (EIP-191) with your key and retries the request with an X-Payment header.
  3. The gateway verifies — amount ≥ price, correct merchant, USDC on Base, valid signature — then proxies to the origin and returns the data.
  4. Underpay, wrong asset, or bad signature → you get 402 again. Spend is logged to nanotab-spend.log.

Reference

FAQ

Do I need ETH for gas?
No. The Circle TokenPaymaster sponsors gas from your USDC. Your agent wallet holds only USDC — 0 ETH works.
What is the minimum payment?
1¢ (one USDC cent).
What does NanoTab charge?
0.1% self-host (10 bps) or 2% managed gateway, taken atomically inside the same payment — the merchant receives the net amount.
What if the payment is wrong?
The gateway returns 402 again with the reason (underpay, wrong asset, bad signature). Nothing is charged on-chain until verification passes.
Is my private key safe?
The key lives only in your NANOTAB_WALLET_KEY env var — it never touches a repo. For production, use a secret manager (Vault, KMS, 1Password Connect).