← 返回
未分类 Key 中文

Proxy Gateway X402

Proxy Gateway X402 enables unrestricted pay-per-use internet access via the x402 protocol with direct USDC payments on Base L2, requiring no custody or KYC.
Proxy Gateway X402 通过 x402 协议提供无限制的按需付费互联网访问,使用 Base L2 上的直接 USDC 支付,无需托管或 KYC。
kehongpeng kehongpeng 来源
未分类 clawhub v0.1.6 1 版本 100000 Key: 需要
★ 0
Stars
📥 389
下载
💾 1
安装
1
版本
#latest

概述

Proxy Gateway x402

> 🚀 Agent-to-Agent Commerce Proxy — Unrestricted internet access with pay-per-use via x402 protocol. No custody, no KYC, direct USDC payments.

![Version](https://github.com/yourname/proxy-gateway-x402)

![Protocol](https://x402.org)

![Network](https://base.org)

![License](LICENSE)

⚡ Key Features

FeatureBenefit
------------------
💰 Pay-Per-UseOnly pay when you use, no subscriptions
🔗 x402 ProtocolAgent-to-Agent commerce, automatic payments
🏦 No CustodyFunds go directly to developer, no middleman
🔓 No KYCCrypto-native, no identity verification
InstantSub-second confirmation on Base L2
🛡️ Self-HostFull source code, deploy your own

💰 Pricing

ItemDetails
---------------
Price0.001 USDC per request
TokenUSDC
NetworkBase (Ethereum L2)
Gas~$0.0001 per transaction

🚀 Quick Start

For Users

1. Install the Skill

clawhub install proxy-gateway-x402

2. Set Up Auto-Pay (Recommended)

# Set your private key for automatic payments
export USER_EVM_PRIVATE_KEY=0xYourPrivateKey

# ⚠️ Security: Use a dedicated wallet with limited funds

3. Use the Proxy

import requests
import json

# Method 1: Auto-pay (if USER_EVM_PRIVATE_KEY is set)
response = requests.post(
    "https://proxy-gateway-x402.easky.cn/api/v1/fetch",
    json={
        "url": "https://api.github.com/users/github",
        "method": "GET"
    }
)
print(response.json()["content"])

# Method 2: Manual payment
# First call returns 402 Payment Required
response = requests.post(
    "https://proxy-gateway-x402.easky.cn/api/v1/fetch",
    json={"url": "https://example.com/api", "method": "GET"}
)
# Response: {"error": "Payment Required", "x402": {...}}

# Pay 0.001 USDC to the specified address
# Then retry with payment proof
response = requests.post(
    "https://proxy-gateway-x402.easky.cn/api/v1/fetch",
    headers={"X-Payment-Response": json.dumps({"tx_hash": "0x..."})},
    json={"url": "https://example.com/api", "method": "GET"}
)

🔧 For Developers

Deploy Your Own Instance

1. Clone & Install

git clone https://github.com/yourname/proxy-gateway-x402.git
cd proxy-gateway-x402

python -m venv venv
source venv/bin/activate

pip install -r requirements.txt

2. Configure Environment

cp .env.example .env
# Edit .env with your settings:
# - DEVELOPER_WALLET: Your wallet to receive payments
# - PRICE_PER_REQUEST: Set your price (default: 0.001)
# - X402_CHAIN: base or base-sepolia (for testing)

3. Run

# Development
uvicorn app.main:app --reload --port 8080

# Production
uvicorn app.main:app --host 0.0.0.0 --port 8080

Docker Deployment

docker build -t proxy-gateway-x402 .

docker run -d \
  -p 8080:8080 \
  -e DEVELOPER_WALLET=0xYourWallet \
  -e PRICE_PER_REQUEST=0.001 \
  proxy-gateway-x402

📖 API Reference

POST /api/v1/fetch

Fetch any URL through the proxy.

Headers:

  • X-Payment-Response (optional): Payment proof JSON {"tx_hash": "0x..."}

Request Body:

{
  "url": "https://api.example.com/data",
  "method": "GET",
  "headers": {"Authorization": "Bearer token"},
  "body": null,
  "region": "us"
}

Response (Success):

{
  "success": true,
  "content": "...",
  "status_code": 200,
  "payment": {
    "verified": true,
    "tx_hash": "0x...",
    "amount": "0.001",
    "token": "USDC"
  }
}

Response (402 Payment Required):

{
  "success": false,
  "error": "Payment Required",
  "x402": {
    "version": "0.1.0",
    "scheme": "exact",
    "network": "base",
    "required": {
      "amount": "0.001",
      "token": "USDC",
      "recipient": "0x..."
    }
  }
}

GET /api/v1/price

Query current pricing.

Response:

{
  "price": "0.001",
  "token": "USDC",
  "network": "base",
  "recipient": "0x..."
}

🛡️ Security

For Users

⚠️ Private Key Safety

  • Use a hardware wallet or dedicated hot wallet
  • Never use your main wallet for auto-pay
  • Set daily spending limits on your wallet
  • Monitor transactions regularly

⚠️ Payment Verification

  • All payments are verified on-chain
  • Transactions cannot be forged or replayed
  • Payment proofs are cached for 5 minutes

For Developers

⚠️ Smart Contract Risks

  • USDC contract is standard ERC-20
  • No custom smart contracts in this implementation
  • All verification happens on-chain

⚠️ Disclaimer

This is experimental software. Use at your own risk.

  • No refunds for failed requests
  • Network fees are paid by the user
  • Developer receives payments directly, no escrow
  • This is NOT financial advice

🔗 Links


📄 License

MIT License - See LICENSE


Built with ❤️ for the Agent Commerce ecosystem.

版本历史

共 1 个版本

  • v0.1.6 当前
    2026-05-03 11:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

Free Ride - Unlimited free AI

shaivpidadi
管理OpenClaw的OpenRouter免费AI模型,自动按质量排名模型,配置速率限制备用方案,并更新opencla...
★ 471 📥 78,178
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomas-security
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装后可防止您和您的用户受到提示注入、数据泄露及恶意行为的侵害。
★ 116 📥 30,962
data-analysis

Wechat Articles Spider

kehongpeng
微信公众号文章爬虫,支持 x402微支付,首次使用需 Chrome 浏览器并交互式微信扫码登录,收集文章用于阅读。
★ 0 📥 407