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 (Base, Arbitrum One & Polygon PoS)

Tier Price (USDC) Atomic Units Duration Best For
call $0.001 1,000 60s (1 min) Single tool invocation, health probe, micro-tolling
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.2

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.2
File Size Uploaded Provenance Actions
whitemagic_pay-0.1.2.tar.gz 9.2 kB Without provenance Details for whitemagic_pay-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 18.3 kB

Release files / whitemagic_pay-0.1.2.tar.gz

Download URL whitemagic_pay-0.1.2.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ce1e079612d8af3767a9a5ab9ed4671c6e328cf7d394304d8e471ea5e1ce7eab
BLAKE2b-256 checksum
How to use checksums
3828f5da4584964ef6144996aedeb7121940d9eebd0c588474288debd3f194c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

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

Download URL whitemagic_pay-0.1.2-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84966177a612ec9a90b0c22a5c91204b8e66328855abf2824ce1eee4edeb46dd
BLAKE2b-256 checksum
How to use checksums
c4fd3a4f811b71f7583e80f384b392b088ff36013ee2842743ec818658713aeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for whitemagic-pay 0.1.2

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