Testnet demoRunning on Arc Testnet · x402 payments in live modeno real funds beyond testnet USDC move
AuraGate
Documentation

How AuraGate works

Open marketplace where AI agents pay for APIs with USDC — per request, no subscriptions, no API keys. Covers: buying, selling, and withdrawing.

🔄 The x402 payment flow

What happens on every purchase — four steps.

  1. 1. Ask

    Agent calls the service URL. Server replies 402 Payment Required with price, recipient, and network.

  2. 2. Pay

    Agent signs a USDC authorization (EIP-3009) for the exact amount and retries with X-PAYMENT header.

  3. 3. Settle

    AuraGate verifies and settles USDC through Circle Gateway in under a second — no gas fees.

  4. 4. Receive

    Agent gets the data plus an on-chain receipt (x-receipt-id, x-result-hash, x-settlement-tx).

🤖 Buy an API (agents & developers)

Three ways, from quickest to production-ready.

Option A — Try in browser (no code)

Open any service in the Marketplace, click "Try it now", and watch the full 402 → pay → data flow. Demo wallet — free, no login. Registry →

Option B — Raw HTTP (curl)

Any HTTP-speaking language can buy. Pattern: call → 402 → pay → retry.

curl
# Step 1 — Hit the endpoint, receive 402
curl -i https://auragate.app/api/premium/oracle-check -H "x-payer: 0xYourWalletAddress"

# Step 2 — Sign USDC authorization and retry
curl -X GET https://auragate.app/api/premium/oracle-check \
  -H "X-PAYMENT: <signed-eip3009-authorization>" \
  -H "X-PAYER: 0xYourWalletAddress"
# → 200 OK + JSON data + x-receipt-id

Option C — Node.js + Circle Gateway

Circle Gateway client signs USDC payment and retries automatically. Set BUYER_PRIVATE_KEY (testnet wallet with USDC).

my-agent.mjs
// my-agent.mjs — buy from AuraGate (Node 18+)
const endpoint = "https://auragate.app/api/premium/oracle-check";

// Step 1: first call → 402
const first = await fetch(endpoint);
console.log("Status:", first.status); // 402

// Step 2: pay via Circle Gateway, auto-retry
const { GatewayClient } = await import("@circle-fin/x402-batching/client");
const gw = new GatewayClient({ chain: "arcTestnet", privateKey: process.env.BUYER_PRIVATE_KEY });
await gw.deposit("0.10");             // fund gateway once
const { data } = await gw.pay(endpoint);
console.log("Data:", data);

Discover all services and buy within a budget

Machine-readable catalog at /api/agent. An agent reads it, then pays for what it needs under a spending cap.

budget loop
const catalog = await fetch("https://auragate.app/api/agent").then(r => r.json());
let spent = 0, budget = 0.10;
for (const svc of catalog.services) {
  if (spent + Number(svc.price.amount) > budget) continue;
  const { data } = await gw.pay(svc.url);
  console.log(svc.name, "→", data);
  spent += Number(svc.price.amount);
}

Ready-made scripts: npm run agent (full catalog) and npm run demo:crypto (one service).

🏷️ List an API (sellers)

Anyone can list — no application, no waitlist, no KYC.

1. Host an x402 endpoint

Your URL returns 402 + payment challenge without payment, then data once paid. Or list a free demo hosted on AuraGate.

2. Register it

Submit via dashboard form or POST to /api/services. AuraGate health-checks your 402 response.

3. Get paid

USDC lands in your wallet the moment an agent calls your endpoint. Reputation score grows from real usage.

What makes a valid x402 endpoint?

Without payment: return 402 with a JSON body containing an accepts array. Each entry needs: scheme, network, asset (USDC contract address), amount (atomic USDC, 6 decimals), and payTo (your wallet). Once paid: return 200 + your data.

x402 endpoint
// x402 endpoint — Next.js / Express / any HTTP server
export async function GET(req) {
  if (!req.headers.get("x-payment")) {
    return Response.json({
      x402Version: 2,
      accepts: [{
        scheme: "exact",
        network: "eip155:5042002",       // Arc Testnet
        asset: "0x<USDC-on-Arc>",
        amount: "2000",                   // $0.002 (6 decimals)
        payTo: "0xYourSellerWallet",
        maxTimeoutSeconds: 60
      }],
      error: "Payment required"
    }, { status: 402 });
  }
  return Response.json({ result: "your data here" });
}

Test before you list

Use "Test endpoint" on the dashboard or POST to /api/services/probe. Returns a checklist of what passes and what to fix.

probe
curl -X POST https://auragate.app/api/services/probe \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://my-api.com/endpoint", "method": "GET", "price": "0.002" }'
# → { "ok": true, "checks": [ ... ] }

Option A — Dashboard form (easiest)

Go to Seller dashboard, fill the form, click Test endpoint to verify, then submit. Leave URL blank for a free AuraGate-hosted demo endpoint. Dashboard →

Option B — Register via API

POST your service definition to /api/services:

register
curl -X POST https://auragate.app/api/services \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Weather API",
    "description": "Live weather, pay-per-call.",
    "category": "data",
    "price": "0.002",
    "method": "GET",
    "sellerName": "MyCompany",
    "sellerAddress": "0xYourWalletAddress",
    "externalUrl": "https://my-api.com/x402/weather",
    "docsUrl": "https://my-api.com/docs",
    "tags": ["weather", "realtime"],
    "sampleResponse": { "city": "Hanoi", "temp": 31 }
  }'

Field reference

  • priceUSDC per request as a decimal string (e.g. "0.002" = $0.002).
  • sellerAddressWallet address that receives USDC on every purchase.
  • externalUrlYour x402 endpoint URL. Omit to host a free demo on AuraGate.
  • methodGET or POST.
  • tags / docsUrl / sampleResponseOptional — shown on your service detail page.

💰 Withdraw funds (sellers)

USDC goes directly to your wallet on every purchase — AuraGate holds nothing.

How payment reaches you

When an agent buys your service, x402 transfers USDC directly from the buyer's wallet to the sellerAddress you registered. No escrow, no intermediary, no withdrawal step. Money is yours the moment the transaction settles on Arc (under 1 second).

If you use a Circle wallet

Connect via the top-right login button. Once connected, click your address to open the Wallet Panel — view USDC balance and send to any address on Arc Testnet.

  1. 1. Connect walletClick the top-right login → sign in with Google or Email → Circle wallet address appears.
  2. 2. Open Wallet PanelClick your wallet address (top-right) to see your USDC balance.
  3. 3. Send USDCEnter destination address and amount → click Send → approve the Circle SDK challenge.
Circle wallets are Arc Testnet only (no real funds). For production, use any EVM wallet address as sellerAddress and collect USDC directly there.

📚 All 31 services

Every service is live data from a real source. Click to view & try.

ServiceSellerMethodPrice
Auraon-Live marrket feed

/api/premium/auraon-live-marrket-feed

AuraOnGET$0.0050
Random Dev Joke

/api/premium/joke

JokeBotGET$0.0010
Inspirational Quote

/api/premium/quote

JokeBotGET$0.0010
GitHub Repo Stats

/api/premium/github-repo

DevFeedGET$0.0020
NPM Package Downloads

/api/premium/npm-stats

DevFeedGET$0.0020
Top Tech News

/api/premium/news-tech

DevFeedGET$0.0030
English Dictionary

/api/premium/dictionary

KnowledgeAPIGET$0.0010
Wikipedia Summary

/api/premium/wikipedia

KnowledgeAPIGET$0.0020
AI Document Summarizer

/api/premium/summarize

BriefBotPOST$0.02
Public Holidays by Country

/api/premium/holidays

CalendarAPIGET$0.0010
World Time & Timezone

/api/premium/timezone

GeoNetGET$0.0010
Place → Coordinates

/api/premium/geocode

GeoNetGET$0.0010
Country Facts & Stats

/api/premium/country-info

GeoNetGET$0.0020
IP Geolocation Lookup

/api/premium/ip-info

GeoNetGET$0.0020
Air Quality Index

/api/premium/air-quality

WeatherWorksGET$0.0020
7-Day Weather Forecast

/api/premium/forecast

WeatherWorksGET$0.0020
Global Weather Now

/api/premium/weather

WeatherWorksGET$0.0010
Currency Converter

/api/premium/fx-convert

FXFeedGET$0.0020
USD Foreign Exchange Rates

/api/premium/fx-rates

FXFeedGET$0.0020
Gold & Silver Spot

/api/premium/metals

WallStreetFeedGET$0.0050
Stock Quote (Equities)

/api/premium/stocks

WallStreetFeedGET$0.0060
Bitcoin Mempool & Fees

/api/premium/mempool

MempoolWatchGET$0.0030
Trending Coins Right Now

/api/premium/trending

TrendBotGET$0.0030
Fear & Greed 7-Day Dataset

/api/premium/dataset

ChainLabsGET$0.0010
Crypto Market Sentiment

/api/premium/sentiment

ChainLabsGET$0.0020
Stablecoin Market Caps

/api/premium/stablecoins

ChainLabsGET$0.0030
DeFi TVL Leaderboard

/api/premium/defi-tvl

ChainLabsGET$0.0040
Coin Deep-Dive

/api/premium/coin-detail

OracleWorksGET$0.0050
Global Crypto Market Stats

/api/premium/global-crypto

OracleWorksGET$0.0040
Multi-Exchange Price & Spread

/api/premium/price-multi-exchange

OracleWorksGET$0.0060
Crypto Price Oracle

/api/premium/oracle-check

OracleWorksGET$0.0050

Machine-readable catalog at /api/agent