whitemagic-pay
Autonomous machine payment client, session lease caching, and cryptographic Proof-of-Context notarization for AI agents.
Zero mandatory dependencies (uses standard library urllib, json, hmac). Optional eth-account dependency enables autonomous EIP-3009 gasless permit signing on Base mainnet.
🚀 Quickstart
1. Free Onboarding (No Wallet, No API Key)
Ephemeral agents can claim an instant 10-minute trial session pass (10,000 RPM) via the faucet:
from whitemagic_pay import X402Client
client = X402Client()
# Dispenses a 10-minute pass (1/day per IP/address)
faucet_data = client.claim_faucet("https://mcp.whitemagic.dev")
print("Session pass acquired:", client.cached_pass)
# Subsequent calls automatically reuse the pass with zero latency
status, data, headers = client.request(
"POST",
"https://mcp.whitemagic.dev/mcp",
data={"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "memory.search", "arguments": {"query": "context continuity"}}}
)
2. Autonomous Multi-Tier Micro-Leases (x402 / Base)
When operating autonomously with a funded wallet, X402Client automatically negotiates HTTP 402 challenges, signs EIP-3009 gasless permits on Base, and caches the returned lease:
client = X402Client(
private_key="0x...",
preferred_tier="call" # Options: "call" ($0.002), "task" ($0.01), "swarm" ($0.05), "day" ($0.50)
)
# Negotiates 402, settles on Base, acquires session lease, and executes tool call
status, result, headers = client.request("POST", "https://mcp.whitemagic.dev/mcp", data={...})
Multi-Tier Pricing Menu
| Tier | Price (USDC) | Atomic Units | Duration | Best For |
|---|---|---|---|---|
call |
$0.002 | 2,000 | 60s (1 min) | Single tool invocation, health probe, sanity check |
task |
$0.010 | 10,000 | 300s (5 min) | Standard multi-step reasoning task |
swarm |
$0.050 | 50,000 | 900s (15 min) | Multi-agent swarm coordination, deep research |
day |
$0.500 | 500,000 | 86,400s (24h) | Continuous production agent worker |
3. Cryptographic Proof-of-Context Notarization
Attest to an agent's reasoning trace, prompt, and action at a tamper-proof UTC timestamp signed with Ed25519:
receipt = client.notarize_context(
base_url="https://api.whitemagic.dev",
context_digest="sha256:b10b001a2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7",
action="agent.decision",
model="gemini-2.5-flash",
metadata={"epoch": 1, "converged": True}
)
print("Notarized digest:", receipt["digest"])
print("Lookup URL:", receipt["lookup_url"])
Anyone can verify the attestation completely offline using the issuer's public key (did:key:...).
🛠️ CLI Usage
# Claim trial session pass
python -m whitemagic_pay.cli faucet --url https://mcp.whitemagic.dev
# Notarize context
python -m whitemagic_pay.cli notarize --digest 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef --action "agent.step"
# Probe live endpoint
python -m whitemagic_pay.cli probe https://mcp.whitemagic.dev/mcp --tier call --query "continuity"
Metadata
Release files for whitemagic-pay 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| whitemagic_pay-0.1.0.tar.gz | 3.1 kB | Without provenance | Details for whitemagic_pay-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| whitemagic_pay-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for whitemagic_pay-0.1.0-py3-none-any.whl |
Total release size: 6.1 kB
Release files / whitemagic_pay-0.1.0.tar.gz
| Download URL | whitemagic_pay-0.1.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
410f28abbdeb4f4d0eb55573f314b3f8969f93f20926658caf7b64e6629eadf7
|
|
BLAKE2b-256 checksum How to use checksums |
de473fc5ef74a0130dd0d1499186ecd9f8875302b144450b72f285a23fa777fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Release files / whitemagic_pay-0.1.0-py3-none-any.whl
| Download URL | whitemagic_pay-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
688e2745d18d357a420cdac44e3f655d446f6c3a02969a2c63968e0922845207
|
|
BLAKE2b-256 checksum How to use checksums |
858ad6c564c137a5c23fe0c98333f8adcd0e92da89abf1fbc85936f20dd7fd53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Security for whitemagic-pay 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.