feat: add x402 payment protocol example for pay-per-circuit quantum access#60
feat: add x402 payment protocol example for pay-per-circuit quantum access#60plagtech wants to merge 2 commits into
Conversation
|
Did a no-payment documentation pass on the notebook. I did not call IonQ, gateway.spraay.app, send payment headers, use an API key, sign a wallet request, or broadcast a transaction. This is a useful direction, but I would tighten a few protocol/documentation details before merging into official samples:
The safest structure is: public discovery check -> unpaid |
|
@TateLyman — really appreciate the thorough review. All points addressed in the updated notebook: P1 — Payment headers as pseudocode: P1 — Gateway trust boundary: P2 — Discovery paths: P2 — API key trust warning: P2 — Smoke test cell: Overall structure now follows: The Spraay gateway reference is now limited to one bullet in the client library table — the notebook is gateway-agnostic by default. |
|
Thanks for the detailed update. I re-read the current notebook head after Quick no-payment doc verification:
No further blocker from my earlier notes. I still did not call a gateway, use an IonQ key, send payment headers, sign, or broadcast a transaction. |
Summary
Adds a Jupyter notebook demonstrating the x402 HTTP payment protocol for quantum computing — showing how APIs like IonQ's can offer pay-per-circuit access via stablecoin micropayments, and how AI agents can consume quantum resources autonomously.
What is x402?
x402 is an open protocol (originated at Coinbase) that implements the HTTP
402 Payment Requiredstatus code with USDC stablecoin settlement. It allows any API to gate endpoints behind micropayments without requiring user accounts or subscription billing. The reference implementation is open source.Quantum computing is a natural fit — per-shot pricing maps directly to per-request micropayments, and the protocol enables AI agents to autonomously purchase compute without human billing management.
What's included
x402_quantum_payments.ipynb— Covers:How it fits
Follows the same structure as existing notebooks (
qiskit.ipynb,cirq.ipynb, etc.) — a self-contained, runnable example. The gateway URL is configurable via environment variable, so users can point to any x402-compatible gateway or self-host one.Testing
IONQ_API_KEYenvironment variablepytest tests/notebook runner