Open AgentPay (open-agentpay)
The Open-Source Payment Infrastructure & Financial Firewall for Autonomous AI Agents.
AgentPay equips autonomous AI agents with gasless micro-payments (Circle USDC on Arbitrum Sepolia & Base) governed by an in-process, non-custodial Financial Firewall.
⚡ Quickstart
Installation
pip install open-agentpay
Basic Usage: Transparent 402 Negotiation & Policy Guard
from agentpay.client import AgentPayClient, LocalSigner
from agentpay.policy import SQLitePolicyEngine, PolicyConfig
# 1. Initialize local signer (non-custodial private key)
signer = LocalSigner("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80")
# 2. Configure local financial firewall
policy = SQLitePolicyEngine.create_in_memory(
PolicyConfig(
id="agent_firewall",
wallet_address=signer.address,
max_per_tx_base_units=100_000, # Max $0.10 per call
rolling_budget_24h_base_units=1_000_000, # Daily limit $1.00
circuit_max_rpm=5, # Tripped if > 5 requests/min
)
)
# 3. Create client with automatic x402 challenge negotiation
client = AgentPayClient(signer=signer, policy=policy)
# 4. Transparent call (auto-pays 402 challenge via EIP-712 off-chain signature)
response = client.get("https://api.seller.com/v1/market-data?ticker=NVDA")
print(response.json())
LangChain Paid Tool Integration
from agentpay.integrations.langchain import PaidTool
market_tool = PaidTool(
name="get_stock_quote",
description="Fetch real-time stock price (costs $0.05 USDC per query)",
endpoint="https://api.seller.com/v1/market-data",
method="GET",
client=client,
)
🔒 Security Guarantees
- Non-Custodial: Private keys never leave the agent's local trust domain.
- Fail-Closed: Any policy violation, budget exhaustion, or circuit trip aborts immediately with zero funds spent.
- Gasless for Agents: AI Agents hold only USDC; execution gas is sponsored via EIP-3009 by the seller or facilitator.
For complete documentation, visit AgentPay GitHub.
Metadata
Release files for open-agentpay 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 | |
|---|---|---|---|---|
| open_agentpay-0.1.0.tar.gz | 57.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| open_agentpay-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 135.1 kB
Release files / open_agentpay-0.1.0.tar.gz
| Download URL | open_agentpay-0.1.0.tar.gz |
|---|---|
| Size | 57.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ed98d30f938a49d34343c866053648ddd8179dd3c4acde857a3d3ed70e2e02c
|
|
BLAKE2b-256 checksum How to use checksums |
6f44fa9e82c578fc734ae46e23581b0e04be3b09311782981d4fc2c051e50e61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / open_agentpay-0.1.0-py3-none-any.whl
| Download URL | open_agentpay-0.1.0-py3-none-any.whl |
|---|---|
| Size | 77.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6643e84f19571f768e5dc7d792ccd4ce39d028e6ffde1d7dd7d29c3bbff79156
|
|
BLAKE2b-256 checksum How to use checksums |
b3bb6416fd118ed4e67cc88c3722a543b8aa78f67d337f4cb03ba436c5a538fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Security for open-agentpay 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.