Python SDK

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:

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.