streamable-httpMITupdated 1mo ago
Working examples for calling x402-gated HTTP APIs: your agent pays USDC per request on Base โ no signup, no API keys, no subscription.
What can you do with scrape402?
x402 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: x402@opklaar.com
MIT licensed.
Install
Add scrape402 to your client. Pick the one you use.
claude mcp add --transport http scrape402 https://x402.shizu.me/mcp/rpccodex mcp add scrape402 --url https://x402.shizu.me/mcp/rpc{
"mcpServers": {
"scrape402": {
"url": "https://x402.shizu.me/mcp/rpc"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"scrape402": {
"type": "http",
"url": "https://x402.shizu.me/mcp/rpc"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"scrape402": {
"url": "https://x402.shizu.me/mcp/rpc"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"scrape402": {
"serverUrl": "https://x402.shizu.me/mcp/rpc"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
39 / 100
Incomplete
- Documentation17/25
- Maintenance19/25
- Trust16/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 28 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint โ no local install
Version history
| Versions | Published |
|---|---|
| 1.0.0Latest | Aug 4, 2026 |