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 the boundary that owns the work rather than combining all four APIs:
Python client
Read resources, payers, and transactions from normal or async Python code.
Generated contract types
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.
Generated contract types are recommended for either framework because they replace a copied revision ID and untyped reporting dictionary with checked Python names. The raw-revision tab is an escape hatch when generated files cannot be committed.