This is the Python implementation of the x402 REST API sample using FastAPI.
- Python 3.10+
- uv package manager
make- Stripe account with crypto payments enabled
- EVM wallet with testnet USDC
- Configure environment variables:
cp ../../../.env.template .env
# Edit .env with your credentials- Install dependencies:
make installmake run— start the local sample server
make runmake lint— run lint and formatting checks without changing filesmake format— apply automatic formatting fixesmake typecheck— run the sample's type checker or build validationmake test— run the automated test suitemake ci— run the full local CI sequence (install,lint,typecheck, andtest)
make lint
make format
make typecheck
make test
make cipurl http://localhost:4242/paid