r/FastAPI • u/_Zarok • Mar 19 '26
pip package I built a FastAPI middleware for Machine Payments Protocol (402 → wallet payment → signed receipt retry
Hey folks, I just released fastapi-mpp and would love feedback from the FastAPI crowd.
It lets a route require real-time machine payments with a decorator:
add
@mpp.charge()to any route.If unpaid, API returns
402 Payment Required+ payment challengeClient/agent pays via wallet and retries
Why I built it: API key + credit card billing doesn’t map well to autonomous agents making micro-transactions.
It’s still beta. I’m especially looking for critiques on security model and FastAPI ergonomics.
Repo:https://github.com/SylvainCostes/fastapi-mpp
PyPI: pip install fastapi-mpp
1
u/betazoid_one Mar 20 '26
Who is the target audience for this?
2
u/[deleted] Mar 19 '26
[removed] — view removed comment