Buy anything behind an HTTP 402. No account, no API key.
Project description
pay402
Buy anything behind an HTTP 402. No account, no API key, no browser.
Alpha (
0.1.0a1). Base is proven — a real mainnet settlement, verified on chain: buyer −$0.02005, seller +$0.01, fee wallet +$0.01005, splitter kept nothing. Solana is implemented and adversarially tested but has never settled on chain, so treat that path as unreleased. The interface may still move before1.0.
pip install "pay402[evm]"
pay402 https://api.checkout402.com/c/chk_abc123 --quote
pay402 https://api.checkout402.com/c/chk_abc123 --key $PAY402_KEY --max-usd 1.00
from pay402 import pay
goods = pay(url, private_key=os.environ["AGENT_KEY"], max_usd="1.00")
Reads the 402 challenge, picks a chain it can sign for, signs, retries with
X-PAYMENT, and hands back the goods plus a receipt. Base (EIP-3009) and
Solana (SPL) today.
Guardrails
max_usd is required for a live payment. An agent looping on a paid
endpoint with no ceiling is the failure mode that matters, so the default is
refusal rather than a permissive setting someone forgets to override. Nothing is
signed until the quoted total has passed the cap.
On Solana the payee builds the transaction and you sign it, so pay402 decodes
it and refuses unless it does exactly what the 402 advertised: two transfers, to
the quoted wallets, for the quoted amounts, out of your token account and no
other, with no third program involved. Non-custodial should mean more than
"they cannot hold your funds".
If you paid and the goods did not arrive, the error carries the receipt id — the one thing you need to get it resolved.
Extras
pay402[evm] for Base, pay402[solana] for Solana, pay402[all] for both.
The base install is httpx only, so an agent sandbox will accept it.
MIT. Source: https://github.com/bitfent/checkout402
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pay402-0.1.0a1.tar.gz.
File metadata
- Download URL: pay402-0.1.0a1.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
320e0f0b06f8cfb7d0a0f0aae2715766d23dec8ab801ad7d7048635e174173f1
|
|
| MD5 |
f0b4595389e2dc1d77cdb8ecce48456c
|
|
| BLAKE2b-256 |
14d8460adb1fa31b8f66016cf05d43dcb0149a9852e06470279a719ab4f7770d
|
File details
Details for the file pay402-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: pay402-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87115a100f3e61ea463d40f88f9225f29765b135c11fe5df523b3b3e0829cfa5
|
|
| MD5 |
c0a90462234db0b0b3a622cc22b40739
|
|
| BLAKE2b-256 |
34670e6536f14f017f537e72cf8b91a753c4c6deea747992c446a3582d57bbf9
|