# GateX402 — Full Documentation for LLMs > GateX402 is an API monetization platform enabling developers to accept USDC crypto micropayments for their APIs using the x402 HTTP payment protocol. Supports Base and Solana networks with instant setup, 1% platform fee, and daily automated payouts. ## What is GateX402? GateX402 is a gateway service for monetizing APIs with cryptocurrency micropayments. API providers register their endpoints on the platform, set per-route pricing in USDC, and GateX402 handles payment verification, collection, and daily payouts. The platform is purpose-built for the AI agent economy — where autonomous AI agents need to discover, evaluate, and pay for API services programmatically without human intervention. ## How the x402 Protocol Works The x402 protocol uses the HTTP 402 Payment Required status code for micropayments: 1. **Request**: An AI agent or consumer sends an HTTP request to a GateX402-proxied API endpoint. 2. **Challenge**: The gateway responds with HTTP 402 Payment Required, including payment details in headers: - `X-Payment-Required`: Amount in USDC - `X-Payment-Network`: Target blockchain (base or solana) - `X-Payment-Address`: Provider's wallet address - `X-Payment-Facilitator`: Facilitator URL for payment verification 3. **Payment**: The caller constructs and signs a USDC transfer transaction. 4. **Verification**: The facilitator verifies the payment on-chain. 5. **Forwarding**: Upon verification, the gateway forwards the original request to the provider's API. 6. **Response**: The API response is returned to the caller. ## Supported Networks ### Base (Ethereum L2) - Network: Base Mainnet - Currency: USDC (native) - Settlement: Near-instant (~2 seconds) - Gas costs: Very low (<$0.01) ### Solana - Network: Solana Mainnet - Currency: USDC (SPL Token) - Settlement: Near-instant (~0.4 seconds) - Gas costs: Minimal (~$0.001) ## Pricing Model - **Platform Fee**: 1% of each transaction - **Provider Revenue**: 99% of each transaction goes directly to the provider - **Minimum Price**: $0.001 per request - **Maximum Price**: No limit - **Payouts**: Daily automated payouts to provider wallet addresses - **No Monthly Fees**: No subscription or platform fees beyond the 1% transaction fee ## For API Providers ### Getting Started 1. Create an account at https://gatex402.dev/signup 2. Connect your wallet (Base or Solana) 3. Add your API domain 4. Configure per-route pricing 5. Point your DNS to the GateX402 gateway 6. Start earning USDC on every API call ### What You Can Monetize - REST APIs (GET, POST, PUT, DELETE) - AI/ML inference endpoints - Data feeds and market data - Content generation APIs - Any HTTP-based service ## For AI Agents (Consumers) ### Discovering APIs The Bazaar Discovery marketplace at https://gatex402.dev/discover provides a machine-readable catalog of all x402-enabled APIs. Each listing includes: - API name and description - Endpoint URL - Pricing (USDC per request) - HTTP method - Supported network(s) - Input schema (when available) - Output example (when available) - x402 protocol version ### Consuming a Paid API To consume an x402-enabled API programmatically: 1. Send a request to the API endpoint 2. Receive the 402 response with payment details 3. Construct a USDC payment transaction for the specified amount 4. Sign and submit the transaction 5. Include the transaction hash in the `X-Payment-Proof` header 6. Resend the original request with the proof header 7. Receive the API response ### Machine-Readable Discovery - **Bazaar API**: The `/discover` page serves structured API catalog data - **JSON-LD**: All API listings include Schema.org WebAPI structured data - **llms.txt**: This file and the summary version at `/llms.txt` - **ai-plugin.json**: OpenAI-compatible manifest at `/.well-known/ai-plugin.json` ## Agent API Reference (Programmatic Management) AI agents can autonomously provision, manage, and monetize their own APIs without the GateX402 dashboard. ### 1. Self-Provisioning Handshake 1. **Challenge**: `POST /agent/nonce` with `{ "wallet_address": "0x...", "action": "provision" }`. 2. **Sign**: Sign the returned `message` using your private key (EIP-191). 3. **Provision**: `POST /agent/provision` with the `signature`, `nonce`, and API config. 4. **Token**: Securely store the returned `management_token` (prefix: `gx4_mgmt_`). ### 2. Management Endpoints (Bearer Token Required) | Action | Method | Path | Description | |--------|--------|------|-------------| | List APIs | GET | `/agent/apis` | Returns array of provisioned APIs | | Balance | GET | `/agent/payout/balance` | Real-time USDC earnings balance | | Withdraw | POST | `/agent/payout/withdraw` | Instant payout to registered wallet | | Set Wallet | PATCH | `/agent/wallet` | Change the payout destination address | | Rotate Key | POST | `/agent/key/rotate` | Swap current token for a new one | ### 3. Implementation Example (Node.js) ```typescript const { nonce, message } = await fetch('https://api.gatex402.dev/agent/nonce', { method: 'POST', body: JSON.stringify({ wallet_address, action: 'provision' }) }).then(r => r.json()); const signature = await wallet.signMessage(message); const { management_token } = await fetch('https://api.gatex402.dev/agent/provision', { method: 'POST', body: JSON.stringify({ wallet_address, signature, nonce, api_name: "Agent API", routes: [...] }) }).then(r => r.json()); ``` For full specifications, refer to [AGENT_API_REFERENCE.md](https://gatex402.dev/AGENT_API_REFERENCE.md). ## Ecosystem Compatibility - **Coinbase Agentic Wallet**: Fully compatible. Use the `awal` CLI for gasless payments and session-level spending limits. - **x402 Protocol**: Native enforcement. Agents must handle 402 responses and include `payment-signature` on retry. - **skills.sh**: Ready for registration. Use `npx skills add gatex402` once published. ## Key URLs | Resource | URL | |----------|-----| | Homepage | https://gatex402.dev | | API Discovery | https://gatex402.dev/discover | | Sign Up | https://gatex402.dev/signup | | Login | https://gatex402.dev/login | | Contact | https://gatex402.dev/contact | | LLMs Summary | https://gatex402.dev/llms.txt | | AI Plugin Manifest | https://gatex402.dev/.well-known/ai-plugin.json | | Sitemap | https://gatex402.dev/sitemap.xml | | Robots | https://gatex402.dev/robots.txt | | X/Twitter | https://x.com/gatex402 | | LinkedIn | https://linkedin.com/company/gatex402 | ## FAQ **Q: What is x402?** A: x402 is an open HTTP payment protocol that uses the HTTP 402 Payment Required status code to enable per-request micropayments with USDC stablecoin. **Q: Which blockchains are supported?** A: GateX402 currently supports Base (Ethereum L2) and Solana. **Q: What currency is used for payments?** A: All payments are in USDC, a USD-pegged stablecoin. No price volatility. **Q: How much does GateX402 charge?** A: GateX402 charges a 1% fee per transaction. There are no subscription fees or monthly charges. **Q: How do I get paid?** A: Payouts are automated daily to your connected wallet address. **Q: Can AI agents use GateX402-powered APIs?** A: Yes. GateX402 is built specifically for AI agent consumption. The x402 protocol is designed for programmatic, machine-to-machine payments. **Q: How do I discover available APIs?** A: Visit https://gatex402.dev/discover to browse the Bazaar Discovery marketplace, or parse the machine-readable structured data on the page.