Python SDK integrations
Choose the Python boundary that fits your application, then use the matching guide to verify a paid request.
The Python SDK has one framework-neutral client and two supported web-framework integrations. All paths call the same Merchant API and preserve the same x402 payer retry.
Use Python 3.11 through 3.14. Choose by job:
Python client
Read resources, payers, and transactions from normal or async Python code.
Pull contracts
Generate typed reporting helpers for published revisions.
FastAPI
Protect one FastAPI endpoint with the maintained framework integration.
Django
Protect one Django view with the maintained framework integration.
Start with FastAPI or Django when you need to protect a web endpoint. Use the plain client in workers, commands, and services that need merchant records.
Pulled contracts are recommended for either framework because they replace a copied revision key and untyped reporting dictionary with checked Python names. A raw revision is the fallback when generated files cannot be committed.