Skip to main content

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whitemagic-pay 0.1.1
File Size Uploaded Provenance Actions
whitemagic_pay-0.1.1.tar.gz 9.0 kB Without provenance Details for whitemagic_pay-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whitemagic-pay 0.1.1
File Interpreter ABI Platform Actions
whitemagic_pay-0.1.1-py3-none-any.whl Python 3 none any Details for whitemagic_pay-0.1.1-py3-none-any.whl

Total release size: 17.8 kB

Release files / whitemagic_pay-0.1.1.tar.gz

Download URL whitemagic_pay-0.1.1.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7be5dc49a6ef96b63947e34727e39c5e016ceec49b08a6e4297d5e802aa1c27e
BLAKE2b-256 checksum
How to use checksums
46243a9d59d5dd84c5cb1cf16e70c5db9d905e2ebbdcaf6b3572f654b07e16c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / whitemagic_pay-0.1.1-py3-none-any.whl

Download URL whitemagic_pay-0.1.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee6173deeaf2670bd56c8296f6ed042f9a3756305356245095d7e3f7d9119d4e
BLAKE2b-256 checksum
How to use checksums
2f53918ecdedc6cc5915c867f56baf9203bc21271b1fab0fdb8a257560a30efa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for whitemagic-pay 0.1.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page