Give your AI agent a wallet. It pays for APIs automatically.
--- **Ag402** is the payment layer for the [Coinbase x402](https://github.com/coinbase/x402) protocol. It makes AI agents pay for API calls automatically — on Solana, in USDC, with zero code changes. ``` Agent calls API → 402 Payment Required → Ag402 auto-pays USDC on Solana → 200 OK ``` > **Non-custodial. Zero telemetry. Already in production.** --- ## Why Ag402 ### Zero friction - Zero code changes for buyers, sellers, and MCP developers - One command to start paying: `ag402 run -- python my_agent.py` - One command to start selling: `ag402 serve --target ... --price ... --address ...` - One command to install MCP tools: `ag402 install claude-code` - No config files, no API keys, no accounts, no signup - [Colab one-click demo](https://colab.research.google.com/github/AetherCore-Dev/ag402/blob/main/examples/ag402_quickstart.ipynb) — try it in your browser, zero install ### Open standard - Implements [Coinbase x402](https://github.com/coinbase/x402) — the emerging HTTP payment standard - MIT licensed, fully open source, extensible protocol layer (`open402`) with zero dependencies - **AI-native docs** — ships with [`llms.txt`](llms.txt) so LLM agents can read the full CLI reference natively ### Battle-tested - [Token RugCheck](https://github.com/AetherCore-Dev/token-rugcheck) — **live on Solana mainnet** with real USDC payments - 775+ tests, 90%+ coverage, 4 rounds of internal security review (24/24 issues fixed) - Multi-endpoint RPC failover + circuit breaker + async delivery retry ### Blazing fast - **~0.5s** standard payment (`confirmed` finality, not 13s `finalized`) - **~1ms** prepaid payment (local HMAC, no on-chain call) - Zero overhead on non-402 requests — no body read, no allocation - Connection pooling, lazy imports, SQLite WAL mode ### Security-first - 6-layer budget protection — per-tx / per-minute / daily / circuit breaker / rollback / key redaction - Non-custodial — private keys never leave your machine - Seller-No-Key — sellers only need a public address, zero private key risk - Zero telemetry — no tracking, no IP logging, no analytics - Wallet encryption: PBKDF2 (480K iter) + AES - CI: CodeQL + Trivy + pip-audit + Semgrep + OpenSSF Scorecard ### Universal compatibility - Claude Code, Cursor, Claude Desktop — MCP auto-config - OpenClaw — **native Skill** (SKILL.md + TOOLS.md + skill.py), not just MCP - LangChain, AutoGen, CrewAI, Semantic Kernel — works automatically - Any Python agent using `httpx` or `requests` — zero changes - **TypeScript/Node.js agents** — `@ag402/fetch` npm package, zero dependencies --- ## Zero Code Changes. For Everyone. | You are... | What you do | Code changes | |:-----------|:------------|:-------------| | **Agent user** (LangChain, CrewAI, AutoGen, any Python agent) | `pip install ag402-core && ag402 run -- python my_agent.py` | **Zero** — your agent code is untouched | | **TypeScript/Node.js agent developer** | `npm install @ag402/fetch` — wrap `fetch()` with `createX402Fetch()` | **~2 lines** — replace `fetch` with `createX402Fetch(...)` | | **Claude Code / Cursor user** | `ag402 install claude-code` (or `cursor`) | **Zero** — MCP tools appear automatically | | **OpenClaw user** | `ag402 install openclaw` | **Zero** — native Skill + MCP, auto-configured | | **API seller** (monetize your API) | `ag402 serve --target http://your-api:8000 --price 0.05 --address| ### [Token RugCheck](https://github.com/AetherCore-Dev/token-rugcheck) **Live on Solana mainnet.** AI agents pay **$0.02 USDC** per audit to detect rug pulls before purchasing tokens. - Three-layer audit: machine verdict → LLM analysis → raw on-chain evidence - **Seller**: `ag402 serve` — zero code changes to the audit API - **Buyer**: `ag402_core.enable()` — agents auto-pay, zero code changes - **Try it now**: `curl -I https://rugcheck.aethercore.dev/v1/audit/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263` | ``` Agent → GET /v1/audit/{token} ← 402 Payment Required ($0.02) → Ag402 pays USDC on Solana → Retries with tx_hash proof ← 200 OK + full audit report ``` |
| ### [DeepBlue API](https://deepblue.fyi/) — Featured Example **Real-time BTC/ETH/SOL trading signals** for AI agents at **$0.001 USDC per call** — perfect for demonstrating x402 micropayments. - Ultra-low cost: $0.001 per API call — ideal for testing and demonstrations - Real trading signals: BTC, ETH, SOL market analysis and predictions - **Seller**: DeepBlue uses x402 protocol for instant micropayments - **Buyer**: Agents auto-pay via ag402 — zero code changes needed - **Ecosystem integration**: Featured in ag402 documentation as a showcase example | ``` Agent → GET /api/signals/BTC ← 402 Payment Required ($0.001) → Ag402 pays USDC on Solana → Retries with payment proof ← 200 OK + trading signals ``` |