Python SDK for AI Agents to autonomously handle HTTP 402 errors and execute micro-payments.
paynode-sdk-python is an early-stage Python project in the AI payments / x402 ecosystem, focused on ai-agents, base-chain, http-402, micro-payments. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like sardis, awesome-x402-on-base, gold-402, fastapi-mpp, MPP-Inspector, x402-sdk.
The official Python SDK for the PayNode Protocol (v2.2.1). PayNode allows autonomous AI Agents to seamlessly pay for APIs and computational resources using USDC on Base L2, utilizing the standardized HTTP 402 protocol with support for both on-chain receipts and off-chain signatures (EIP-3009).
For complete installation guides, advanced usage, API references, and architecture details, please visit our official documentation: 👉 docs.paynode.dev
pip install paynode-sdk-python web3
from paynode_sdk import PayNodeAgentClient
agent = PayNodeAgentClient(
private_key="YOUR_AGENT_PRIVATE_KEY",
rpc_urls=["https://mainnet.base.org", "https://rpc.ankr.com/base"]
)
# Automatically handles the 402 challenge, executes the Base L2 transaction, and gets the data.
response = agent.request_gate("https://api.merchant.com/premium-data", method="POST", json={"agent": "PythonAgent"})
print(response.json())
TransferWithAuthorization, allowing for gasless or relayer-mediated settlement.The SDK includes a complete Merchant/Agent demo in the examples/ directory.
Copy the example environment file and fill in your keys:
cp .env.example .env
# Edit .env with your private key and RPC URLs
If you're testing on Sepolia, run the helper script to mint 1,000 mock USDC:
python examples/mint_test_tokens.py
python examples/fastapi_server.py
In another terminal:
python examples/agent_client.py
The demo will perform a full loop: 402 Handshake -> On-chain Payment -> 200 Verification.
To publish a new version of the SDK:
pip install build twine
python -m build
python -m twine upload dist/*
Built for the Autonomous AI Economy by PayNodeLabs.
The open authority layer + SDKs for AI-agent payments. Thin Python/TS clients, an MCP server, framework adapters (LangChain/CrewAI/Hermes/OpenClaw/…), and @sardis/reference — a pure policy simulator + AP2/TAP/x402 verifiers showing exactly how Sardis decides if an agent may spend. The hosted engine that moves money is private.
Korean resources and tutorials for x402 payment protocol on Base chain
⚡ The gold standard for x402 resources. 300+ projects, SDKs, tools, facilitators, and ecosystem data for the HTTP 402 Payment Required protocol. Curated by 24K Labs.
FastAPI middleware for Machine Payments Protocol (MPP). Add 402 Payment Required challenges, secure sessions, and receipt validation to your APIs for AI agents.
A CLI tool and web dashboard for inspecting, testing, and debugging Machine Payments Protocol flows. Think "Postman for HTTP 402" — it visualizes the full challenge-response-receipt cycle, simulates payment failures, validates receipt signatures, benchmarks session channels, and generates test reports.
x402 Payment Protocol SDKs - Dead simple micropayments for APIs and AI agents
Client SDK, Claude plugin and skill framework for the Pinion protocol. x402 micropayments on Base.
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Turn any API or MCP server into a paid service with x402
Public adapters and discovery catalog for Triptych OS (Agent OS): agent frameworks, MCP/A2A/x402 protocols, workflows, wallets, SDKs, and examples for execute-first routing, governed handoffs, and receipt-aware agent commerce.
A wallet for agents. Make payments via x402, use stablecoins, swap assets, earn yield with defi and buy tokenized stocks across the most popular chains.