AI agents that provide services โ data analysis, trading signals, domain research โ can now charge other agents and humans in USDC. Purple Flea's payment processor handles invoicing, confirmation, and settlement end to end.
Three steps from service request to settled payment. No intermediaries, no bank accounts, no waiting periods.
Your agent creates a USDC invoice with a unique payment address, amount, description, and expiry time via the API.
The paying agent or human sends the exact USDC amount to the invoice address. Payment can come from any wallet on any supported chain.
Within seconds of on-chain confirmation, a webhook fires to your endpoint. The service is unlocked and funds are settled to your wallet.
Generate a payment invoice with one API call. The response includes everything needed to display a payment UI or send payment instructions to the buying agent.
import purpleflea
payments = purpleflea.PaymentProcessorClient(api_key="YOUR_KEY")
# Create a payment invoice
invoice = payments.create_invoice(
agent_id="agent_data_service",
amount_usdc=2.50,
description="30-day market data subscription",
customer_agent_id="agent_buyer_001", # optional
expires_in_minutes=60,
webhook_url="https://myagent.example.com/payment-confirmed"
)
print(f"Invoice ID: {invoice['invoice_id']}")
print(f"Pay to: {invoice['payment_address']}")
print(f"Amount: ${invoice['amount_usdc']} USDC")
print(f"Expires: {invoice['expires_at']}")
print(f"QR code: {invoice['qr_code_url']}")
# Check payment status
status = payments.get_invoice_status(invoice["invoice_id"])
print(f"Status: {status['status']}") # pending | paid | expired
Generate invoices on Ethereum, Polygon, Arbitrum, Solana, and more. The payer picks their preferred chain and the payment is bridged automatically.
A minimal Flask server that receives payment confirmations and unlocks services automatically โ no polling required.
from flask import Flask, request
import purpleflea
app = Flask(__name__)
@app.route("/payment-confirmed", methods=["POST"])
def handle_payment():
event = request.json
if event["type"] == "payment.confirmed":
invoice_id = event["data"]["invoice_id"]
amount = event["data"]["amount_usdc"]
from_agent = event["data"]["from_agent_id"]
print(f"Payment received: ${amount} USDC from {from_agent}")
# Unlock the purchased service
unlock_service(invoice_id)
return {"status": "ok"}
Webhooks fire within 1-2 seconds of blockchain confirmation โ faster than any polling interval.
If your endpoint returns a non-200 response, Purple Flea retries with exponential backoff for up to 24 hours.
Every webhook is signed with your secret key. Verify the signature header to confirm authenticity before processing.
Any AI agent that produces value can monetize it with the payment processor. Here are the three most common patterns.
Charge per API call or per time period for any service your agent provides. Create an invoice automatically each time a client requests access, and gate the response behind payment confirmation via webhook.
Sell curated market data subscriptions, sentiment analysis feeds, or on-chain analytics to other agents. The payment processor handles subscription renewal invoices automatically at configurable intervals.
Agents specializing in trading strategy, risk analysis, or domain valuation can charge for recommendations on a per-report basis. Generate an invoice, deliver the report on payment confirmation, fully automated.
Your agent built something valuable. Now charge for it. USDC invoices, webhooks, and automatic settlement in one API.