⚡ Foundry Agent Buyer (foundry-agent-buyer)
Zero-configuration Python client library allowing autonomous AI agents, LLM pipelines, and automated bots to execute instant HTTP 402 cryptocurrency purchases on Base and Avalanche.
Built by Foundry Stack — Turnkey Commercial Infrastructure for the Autonomous Agent Economy.
⚡ The Problem: Why Agents Need This
Traditional payment processors (Stripe, PayPal, banking APIs) require:
- ❌ Human identity verification / KYC
- ❌ Corporate registration & merchant bank accounts
- ❌ Complex OAuth / credit card capture forms impossible for headless agents
HTTP 402 changes this. When an AI agent encounters a paid API or digital asset, the server returns 402 Payment Required with a cryptographic challenge. foundry-agent-buyer enables any Python agent to:
- Detect the 402 challenge automatically.
- Sign the challenge nonce with its EVM key.
- Broadcast USDC on Base or Avalanche C-Chain.
- Download the unlocked payload in seconds.
🚀 Quickstart (3 Lines of Code)
pip install foundry-agent-buyer
from foundry_agent_buyer import AutonomousBuyer
# 1. Initialize with your agent's private key
buyer = AutonomousBuyer(private_key="0xYOUR_AGENT_PRIVATE_KEY")
# 2. Autonomously purchase and download the digital asset
buyer.purchase("https://foundrystack.co.uk/tools/latency-oracle", output_path="tool.zip")
🛠️ Multichain Support (Base & Avalanche)
By default, purchases execute on Base Mainnet (chainId: 8453). To purchase on Avalanche C-Chain:
buyer = AutonomousBuyer(
private_key="0xYOUR_AGENT_PRIVATE_KEY",
chain_id=43114 # Avalanche C-Chain
)
buyer.purchase("https://foundrystack.co.uk/item/sample", output_path="item.zip")
Custom private RPCs (Alchemy, Infura, QuickNode) are fully supported:
buyer = AutonomousBuyer(
private_key="0x...",
chain_id=8453,
rpc_url="https://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY"
)
🏗️ Want to Sell to AI Agents? Monetize Your Own APIs & Models
This repository provides the Client (Buyer) SDK. If you are building an AI agent, tool, or API and want to charge agents in crypto:
Option 1: Turnstile Engine ($19 USDC)
Drop-in FastAPI / Flask decorator for your existing backend.
- Full EIP-712 cryptographic verification.
- Replay-attack prevention & PostgreSQL/SQLite receipt logging.
- Dual-chain Base & Avalanche settlement directly into your wallet. 👉 Get the Turnstile Engine ($19)
Option 2: Turnkey Autonomous Digital Vending Machine (£289 / $365 USDC)
The complete, self-hosted autonomous digital vending machine.
- 1-click Web3 modal browser storefront + HTTP 402 autonomous endpoint.
- 24/7 background SMTP email dispatcher & download link generator.
- Multi-node federation, telemetry radar, and zero-maintenance architecture. 👉 Deploy the Franchise Pack (£289)
📄 License
MIT License. Created by Foundry Stack. "You bring the agent. We give them the shop."
Metadata
Release files for foundry-agent-buyer 1.0.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 |
|---|---|---|---|---|
| foundry_agent_buyer-1.0.0.tar.gz | 5.9 kB | Without provenance | Details for foundry_agent_buyer-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| foundry_agent_buyer-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for foundry_agent_buyer-1.0.0-py3-none-any.whl |
Total release size: 12.1 kB
Release files / foundry_agent_buyer-1.0.0.tar.gz
| Download URL | foundry_agent_buyer-1.0.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6028c1ad18784bda179438b2833bd8ddb06bdff3ead30a37438ad975c330ca7
|
|
BLAKE2b-256 checksum How to use checksums |
ed6a2376f8cf67ff53690c9f1550e67715eac8dad51cbdc478b8daf1c1711e4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / foundry_agent_buyer-1.0.0-py3-none-any.whl
| Download URL | foundry_agent_buyer-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a221d4f2d79350523cc47d6b5de5dd099d969aa8f87ea4f409724fa0505b5b4a
|
|
BLAKE2b-256 checksum How to use checksums |
d8d699fd3af7089d6bbeb6b6e9be0367fb4113b5dd4de8dc0428c8448e2a7771
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Security for foundry-agent-buyer 1.0.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.