Spaces:
Configuration error
Configuration error
x402 Python Examples
Examples for the x402 Python SDK.
Quick Start
cd clients/httpx
cp .env-local .env
# Edit .env with your EVM_PRIVATE_KEY and/or SVM_PRIVATE_KEY
uv sync
uv run python main.py
V2 SDK (Recommended)
Clients
- clients/httpx/ - Async HTTP client with httpx
- clients/requests/ - Sync HTTP client with requests
- clients/custom/ - Manual payment handling
- clients/advanced/ - Hooks, selectors, and builder patterns
Servers
- servers/fastapi/ - FastAPI server with payment middleware
- servers/flask/ - Flask server with payment middleware
- servers/custom/ - Manual payment handling
- servers/advanced/ - Dynamic pricing, hooks, and more
Facilitator
- facilitator/ - Payment facilitator service
Legacy SDK
- legacy/ - V1 SDK examples (for backward compatibility)