Skip to main content

pixeloffice-x402

Python client & 1-line wrapper for Agent-Native x402 Micro-Payments on Solana.

Allow autonomous AI swarms (LangChain, CrewAI, AutoGPT, Claude Code) to pay per query directly from their Solana wallet with 0.24ms ed25519 cryptographic settlement and zero credit card friction.


📦 Installation

pip install pixeloffice-x402


⚡ Quickstart (Zero-Config with .env)

Put your agent's Solana key into your .env:

# .env
SOLANA_PRIVATE_KEY=5K2...your_phantom_or_solana_base58_private_key...

Then in your Python code:

from pixeloffice_x402 import PixelRouterX402

# Zero-config: Automatically picks up SOLANA_PRIVATE_KEY from .env / os.environ
client = PixelRouterX402()

# Autonomous LLM invocation with automatic 0.24ms Solana HTTP 402 micro-settlement
response = client.chat_completion(
    model="blun-auto", # Or "deepseek-chat", "claude-3.5-sonnet", "ox-alpha"
    messages=[
        {"role": "user", "content": "Execute autonomous codebase refactor."}
    ]
)

print(response["choices"][0]["message"]["content"])

🔌 1-Line Drop-in for Official OpenAI SDK

from openai import OpenAI
from pixeloffice_x402 import wrap_openai

# Wrap standard OpenAI client
client = wrap_openai(OpenAI(
    base_url="https://api.pixeloffice.eu/v1",
    api_key="x402"
), solana_private_key="YOUR_AGENT_SOLANA_KEYPAIR_BASE58")

completion = client.chat.completions.create(
    model="blun-auto",
    messages=[{"role": "user", "content": "Hello autonomous agent world!"}]
)

🧠 Stateful Memory Bridge Integration

Pass session_id to retain cross-model state and eliminate up to 85% of redundant context tokens:

response = client.chat_completion(
    model="blun-auto",
    session_id="customer_support_thread_42",
    messages=[{"role": "user", "content": "Summarize previous conversation."}]
)

🛡️ License

MIT © 2026 Pixel Office EU (https://pixeloffice.eu)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pixeloffice_x402-1.0.3.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file pixeloffice_x402-1.0.3.tar.gz.

File metadata

  • Download URL: pixeloffice_x402-1.0.3.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.8

File hashes

Hashes for pixeloffice_x402-1.0.3.tar.gz
Algorithm Hash digest
SHA256 d1dfb4c150401ec6f823409191f72a2d5b283cb53edd939a872cb0cc70f83acc
MD5 c15ab1fe04803812b7ac1bd764bd7f9a
BLAKE2b-256 cc63be3a8910d3ba80af3c8c89cda916d58b92d33eefbcf30c8ddf661dab2819

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 file

1.0.2

1 file

1.0.1

1 file

1.0.0

1 file

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