create-python-x402-client
Installation
SKILL.md
Creating x402 HTTP Clients in Python
Build Python HTTP clients with httpx (async) or requests (sync) that automatically detect 402 Payment Required responses, create Algorand USDC payment transactions, and retry with payment headers.
Prerequisites
Before using this skill, ensure:
- Python 3.10+ is installed
- An Algorand private key -- Base64-encoded 64-byte key (set as
AVM_PRIVATE_KEYenv var) - USDC opt-in -- The paying address must have opted into the USDC ASA on the target network
- A payment-protected endpoint -- A server running x402 middleware to test against
Core Workflow: Automatic 402 Handling
The x402 HTTP client wraps your HTTP library's transport layer. When a 402 response is received, it automatically creates a payment and retries.