x402 examples from AR.IO Network
ar-io-x402 is an early-stage Shell project in the AI payments / x402 ecosystem, focused on arweave, permaweb, x402. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like clawhalla-skill, studiomcphub, nofx, ClawRouter, bitterbot-desktop, internet-court-skill.
A practical implementation and testing environment for AR.IO Gateway integration with the x402 payment protocol for monetized data access.
This monorepo provides:
:latest Docker image) running in delegated modeClone and Install
git clone <your-repo-url> ar-io-x402
cd ar-io-x402
pnpm install
Configure Gateway
pnpm gateway:setup
The setup wizard will:
.env from templateConfigure Wallets
Edit services/ar-io-gateway/.env:
# Required: Arweave wallets (43-character base64 addresses)
AR_IO_WALLET=your-ar-io-wallet-address
OBSERVER_WALLET=your-observer-wallet-address
# Optional: For x402 payments (42-character hex address with 0x prefix)
X_402_USDC_WALLET_ADDRESS=0xYourEVMWalletAddress
Add observer wallet keyfile:
cp your-wallet.json services/ar-io-gateway/wallets/<observer-address>.json
The setup script will validate all formats automatically.
Start Gateway
pnpm gateway:up
Verify Installation
pnpm gateway:health
pnpm gateway:up # Start gateway
pnpm gateway:down # Stop gateway
pnpm gateway:logs # View logs
pnpm gateway:restart # Restart gateway
pnpm gateway:setup # Initial setup wizard
pnpm gateway:health # Health check
pnpm dev # Start all services (via Turborepo)
pnpm build # Build all packages
pnpm test # Run tests
pnpm lint # Lint all packages
This project uses delegated mode for the AR.IO Gateway:
Client Request
↓
Local Gateway (localhost:4000)
├─ Rate Limiting
├─ x402 Payment Validation
└─ Token Consumption
↓
Trusted Gateway (arweave.net)
└─ Data Fetching
↓
Arweave Network
Benefits:
ar-io-x402/
├── services/
│ └── ar-io-gateway/ # Gateway with x402 support
├── examples/
│ └── arstream/ # x402 stream - Video streaming with payments
├── packages/ # Shared libraries (coming soon)
└── scripts/ # Automation scripts
# Fetch transaction data
curl http://localhost:4000/:txid
# Fetch chunk data (x402 enabled)
curl http://localhost:4000/chunk/:offset
# Fetch raw transaction
curl http://localhost:4000/raw/:txid
# Gateway info (includes x402 config)
curl http://localhost:4000/ar-io/info
# Health check
curl http://localhost:4000/ar-io/healthcheck
# GraphQL queries (proxied to arweave.net)
curl -X POST http://localhost:4000/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ transactions { edges { node { id } } } }"}'
A production-ready Next.js application demonstrating decentralized video streaming with x402 micropayments.
# Start the gateway first
pnpm gateway:up
# Install and run x402 stream
cd examples/arstream
pnpm install
pnpm dev
# Open http://localhost:3000
See examples/arstream/README.md for complete setup, testing instructions, and architecture details.
x402 enables monetized data access using USDC payment tokens:
1. Client requests data with x402 header
2. Gateway validates payment token
3. Rate limiter checks token availability
4. Data fetched from trusted gateway
5. Token consumption recorded
6. Response sent to client
Rate limiting is required for x402:
ENABLE_RATE_LIMITER=true
ENABLE_X_402_USDC_DATA_EGRESS=true
# Known transaction ID
curl http://localhost:4000/4jBV3ofWh41KhuTs2pFvj-KBZWUkbrbCYlJH0vLA6LM
# Check rate limiter config
curl http://localhost:4000/ar-io/info | jq '.rateLimiter'
# HEAD request (no token consumption)
curl -I http://localhost:4000/chunk/0
Create workspace in examples/:
mkdir examples/my-example
cd examples/my-example
pnpm init
Add to pnpm-workspace.yaml:
packages:
- "examples/my-example"
Update turbo.json if needed
Add convenience script to root package.json
# Check Docker
docker ps
# View logs
pnpm gateway:logs
# Check .env configuration
cat services/ar-io-gateway/.env
ENABLE_RATE_LIMITER=true in .env/ar-io/info endpointls services/ar-io-gateway/wallets/.env files with real wallet addresseswallets/ and data/ in .gitignore[Your License Here]
Contributions welcome! Please read CONTRIBUTING.md first.
OpenClaw/Claude Code skill for using Clawhalla - permanent AI soul storage on Arweave
Creative AI MCP server — 32 tools (18 free): image generation, upscaling, bg removal, mockups, CMYK, print-ready PDF, vectorization, watermarking, enrichment, provenance. Pay per call via x402/Stripe/GCX.
Your AI trading terminal assistant for US stocks, commodities, forex, and crypto.
The agent-native LLM router for autonomous agents. 55+ models (8 free), <1ms local routing, USDC payments on Base & Solana via x402.
A local-first AI agent with persistent memory, emotional intelligence, and a peer-to-peer skills economy.
The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all Agent Skill / Claude Code plugin.
A payments protocol for the internet. Built on HTTP.
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.
Daydreams is a set of tools for building agents for commerce
Agent behavior that compiles
The A2A x402 Extension brings cryptocurrency payments to the Agent-to-Agent (A2A) protocol, enabling agents to monetize their services through on-chain payments. This extension revives the spirit of HTTP 402 "Payment Required" for the decentralized agent ecosystem.
Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes instantly, manages risk while you sleep. Agent commerce protocol for machine-to-machine payments. Self-hosted. Built on Claude.