Working x402 examples: pay-per-call APIs for AI agents — OpenAI-compatible LLM gateway, embeddings, web search, market data. USDC on Base, no API keys.
git clone https://github.com/scrape402/x402-examples && cp x402-examples/*.md ~/.claude/agents/Resumen de Subagents
# x402 examples — pay-per-call APIs for AI agents Working examples for calling [x402](https://x402.org)-gated HTTP APIs: your agent pays **USDC per request on Base** — no signup, no API keys, no subscription. All examples run against **[x402.shizu.me](https://x402.shizu.me)** (77 live endpoints, prices from $0.001/call): an **OpenAI-compatible LLM gateway** (`/v1/chat/completions`, `/v1/embeddings`, `/v1/models`), web search, a code sandbox, web scraping, live crypto/market data, verifiable randomness, and a **prepaid off-chain metering rail** for high-frequency loops (100+ calls/min, no per-call gas). ## How x402 works 1. **Call** any endpoint → the `HTTP 402` response carries signed USDC payment requirements (price, asset, recipient). 2. **Pay** — your x402 client signs the payment locally and retries automatically. 3. **Served** — settlement is on-chain; you are only charged when the call succeeds. Errors and 4xx never settle. Fund a wallet with a few dollars of USDC on Base, export its private key, and every example here just works. ## JavaScript ```bash npm install x402-fetch viem export X402_PRIVATE_KEY=0x... # wallet holding USDC on Base node js/chat.mjs ``` ## Python ```bash pip install x402 eth-account httpx export X402_PRIVATE_KEY=0x... python python/chat.py ``` ## Examples | File | What it shows | |---|---| | [`js/chat.mjs`](js/chat.mjs) | OpenAI-compatible chat completion, paid per call | | [`js/search.mjs`](js/search.mjs) | Live web search without a search-API account | | [`python/chat.py`](python/chat.py) | Chat completion via the Python x402 client | | [`python/embeddings.py`](python/embeddings.py) | OpenAI-shape embeddings for RAG loops | | [`python/metered_loop.py`](python/metered_loop.py) | Prepay once, then 100+ calls/min off-chain | ## Just looking? Every route quotes its price on a free unpaid request: ```bash curl -i https://x402.shizu.me/crypto # → 402 + payment requirements curl https://x402.shizu.me/llms.txt # full catalog, agent-readable ``` ## Links Live service: https://x402.shizu.me · OpenAPI: https://x402.shizu.me/openapi.json · MCP tools: https://x402.shizu.me/.well-known/mcp-tools · Contact: x402@opklaar.com MIT licensed.
Lo que la gente pregunta sobre x402-examples
¿Qué es scrape402/x402-examples?
+
scrape402/x402-examples es subagents para el ecosistema de Claude AI. Working x402 examples: pay-per-call APIs for AI agents — OpenAI-compatible LLM gateway, embeddings, web search, market data. USDC on Base, no API keys. Tiene 0 estrellas en GitHub y se actualizó por última vez yesterday.
¿Cómo se instala x402-examples?
+
Puedes instalar x402-examples clonando el repositorio (https://github.com/scrape402/x402-examples) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.
¿Es seguro usar scrape402/x402-examples?
+
scrape402/x402-examples aún no ha sido auditado por nuestro agente de seguridad. Revisa el repositorio original en GitHub antes de usarlo en producción.
¿Quién mantiene scrape402/x402-examples?
+
scrape402/x402-examples es mantenido por scrape402. La última actividad registrada en GitHub es de yesterday, con 0 issues abiertos.
¿Hay alternativas a x402-examples?
+
Sí. En ClaudeWave puedes explorar subagents similares en /categories/agents, ordenados por popularidad o actividad reciente.
Despliega x402-examples en tu cloud
Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.
¿Mantienes este repo? Añade un badge a tu README
Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.
[](https://claudewave.com/repo/scrape402-x402-examples)<a href="https://claudewave.com/repo/scrape402-x402-examples"><img src="https://claudewave.com/api/badge/scrape402-x402-examples" alt="Featured on ClaudeWave: scrape402/x402-examples" width="320" height="64" /></a>Más Subagents
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
The agent that grows with you
Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
The agent engineering platform.
Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.