About scrape402
scrape402 provides examples for agents that call x402-gated APIs and pay per successful request in USDC on Base. The examples cover chat, embeddings, web search, and prepaid metered loops without account signup or API keys.
Key features
- 01USDC payment per API call
- 02OpenAI-compatible chat examples
- 03Web search example
- 04Python embeddings example
- 05Prepaid high-frequency metering
Use cases
- 01Run paid LLM chat requests
- 02Search the web without a search account
- 03Create embeddings for RAG loops
- 04Make frequent calls using prepaid metering
MCP support
The README links to an MCP tools catalog at the x402 service endpoint, but does not describe an MCP server implementation.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://x402.shizu.me/mcp/rpcclaude mcp add --transport http scrape402-scrape402 https://x402.shizu.me/mcp/rpc{"mcpServers":{"scrape402-scrape402":{"type":"http","url":"https://x402.shizu.me/mcp/rpc"}}}Open in Cursor{"servers":{"scrape402-scrape402":{"type":"http","url":"https://x402.shizu.me/mcp/rpc"}}}Open in VS Code{"mcpServers":{"scrape402-scrape402":{"type":"http","url":"https://x402.shizu.me/mcp/rpc"}}}{"mcpServers":{"scrape402-scrape402":{"serverUrl":"https://x402.shizu.me/mcp/rpc"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
5| Parameter | Type | Required | Description |
|---|---|---|---|
| max | integer | No | |
| min | integer | No | |
| bytes | integer | No | 1-256, default 16 |
Details
From the project READMEx402 examples — pay-per-call APIs for AI agents
Working examples for calling x402-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 (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
- Call any endpoint → the
HTTP 402response carries signed USDC payment requirements (price, asset, recipient). - Pay — your x402 client signs the payment locally and retries automatically.
- 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
npm install x402-fetch viem
export X402_PRIVATE_KEY=0x... # wallet holding USDC on Base
node js/chat.mjs
Python
pip install x402 eth-account httpx
export X402_PRIVATE_KEY=0x...
python python/chat.py
Examples
| File | What it shows |
|---|---|
js/chat.mjs | OpenAI-compatible chat completion, paid per call |
js/search.mjs | Live web search without a search-API account |
python/chat.py | Chat completion via the Python x402 client |
python/embeddings.py | OpenAI-shape embeddings for RAG loops |
python/metered_loop.py | Prepay once, then 100+ calls/min off-chain |
Just looking?
Every route quotes its price on a free unpaid request:
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: [email protected]
MIT licensed.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.