io.github.scrape402/scrape402

السجل الرسمي البحث والويب

Pay-per-call agent tools via x402 (USDC on Base): chat, prices, funding, RNG. No account or keys.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

Remote (streamable-http)
Claude Code
claude mcp add --transport http scrape402 'https://x402.shizu.me/mcp/rpc'
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "scrape402": {
            "type": "http",
            "url": "https://x402.shizu.me/mcp/rpc"
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. x402 examples — pay-per-call APIs for AI agents
  2. How x402 works
  3. JavaScript
  4. Python
  5. Examples
  6. Just looking?
  7. Links

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

  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

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

FileWhat it shows
js/chat.mjsOpenAI-compatible chat completion, paid per call
js/search.mjsLive web search without a search-API account
python/chat.pyChat completion via the Python x402 client
python/embeddings.pyOpenAI-shape embeddings for RAG loops
python/metered_loop.pyPrepay 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

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.

الأسئلة الشائعة

ما هو io.github.scrape402/scrape402؟

Pay-per-call agent tools via x402 (USDC on Base): chat, prices, funding, RNG. No account or keys.

كيف أثبّت io.github.scrape402/scrape402؟

يعمل كخادم بعيد. في Claude Code: claude mcp add --transport http scrape402 'https://x402.shizu.me/mcp/rpc'. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج io.github.scrape402/scrape402 إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل io.github.scrape402/scrape402 مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون io.github.scrape402/scrape402؟

ينشره scrape402. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.