The checkout layer for the agent economy.
AgentPay is the AI-to-AI payment system for OpenClaw: agents can discover paid tools, complete USDC payments, and continue work—without human intervention.
Your specialist agent did the task. Another agent pays instantly. Work continues. Everybody wins. 🤝
AI agents are moving from demos to real operations. The missing piece is simple:
How does one agent pay another agent for useful work over HTTP?
AgentPay answers that with a clean, developer-friendly flow built for OpenClaw-style systems.
- Monetize agent capabilities with per-endpoint pricing.
- Turn tools into revenue-generating services instead of internal-only utilities.
- Let agents transact autonomously (no manual invoices, no human-in-the-loop payment clicks).
- Keep orchestration smooth with automatic pay-and-retry.
- Get receipts and policy checks for auditability and control.
Stripe-like UX for agent-to-agent USDC payments over HTTP.
- A seller agent protects an endpoint with a price.
- A buyer agent calls it like normal.
- Seller returns HTTP
402+ payment requirements. - Buyer agent pays and retries automatically.
- Seller verifies, settles, and returns the result + receipt metadata.
Protocol headers:
PAYMENT-REQUIREDPAYMENT-SIGNATUREPAYMENT-RESPONSE
from fastapi import FastAPI
from agentpay_seller import for_fastapi
app = FastAPI()
agentpay = for_fastapi(
app,
merchant_id="mrc_demo",
api_key="ap_live_demo",
base_url="http://localhost:8000",
recipient="0xseller",
)
@app.post("/run-task")
@agentpay.protect(price="0.05")
async def run_task(payload: dict):
return {"ok": True, "task": payload.get("task")}
agentpay.mount()from agentpay_buyer import AgentPayClient
client = AgentPayClient.from_settings(settings)
response = await client.post("http://localhost:8001/run-task", json={"task": "summarize"})
print(response.json())
print(response.agentpay_receipt)AgentPay is purpose-built for OpenClaw workflows where agents call tools/services over HTTP.
Great fits:
- paid browser automations
- paid search/retrieval endpoints
- paid specialist sub-agent calls
- paid data prep/indexing/conversion jobs
A thin adapter is included at packages/integrations/openclaw/.
pip install -e .PYTHONPATH=packages/core alembic upgrade headPYTHONPATH=packages/core:apps/api python -m seed_demoPYTHONPATH=packages/core:apps/api uvicorn main:app --reload --port 8000AGENTPAY_API_BASE_URL=http://localhost:8000 PYTHONPATH=packages/core:packages/seller_sdk:apps/seller_demo uvicorn main:app --reload --port 8001PYTHONPATH=packages/core:packages/buyer_sdk:packages/seller_sdk:packages/integrations/openclaw:apps/api pytest -qRun examples/openclaw_paid_tool_demo.py for a minimal end-to-end flow: buyer agent calls paid tool → gets 402 → pays in USDC → retries → receives result + receipt.
See LICENSE.