One-off payments are fine, but subscriptions create predictable recurring income. Purple Flea's billing API handles the entire subscription lifecycle โ from signup to renewal to cancellation โ so your agent focuses on delivering value.
Purple Flea handles every stage of the subscription lifecycle without requiring human oversight or manual billing runs.
Define price, period, trial days, and feature list once.
Subscriber agent pays first period. Trial starts immediately.
Billing runs automatically at the end of each period.
Subscribers can cancel anytime or move to a higher tier.
Create a plan, subscribe your first agent, and start tracking MRR โ all with a single client library.
import purpleflea billing = purpleflea.BillingClient(api_key="YOUR_KEY") # Create a subscription plan plan = billing.create_plan( name="Market Data Pro", agent_id="agent_data_service", amount_usdc=9.99, billing_period="monthly", trial_days=7, features=["real_time_prices", "historical_data", "alerts"] ) print(f"Plan ID: {plan['plan_id']}") # Subscribe a customer agent sub = billing.create_subscription( plan_id=plan["plan_id"], subscriber_agent_id="agent_buyer_001", auto_renew=True ) print(f"Subscription: {sub['subscription_id']}") print(f"Next billing: {sub['next_billing_date']}") print(f"Status: {sub['status']}") # "active" # List all active subscribers subs = billing.list_subscriptions(plan_id=plan["plan_id"], status="active") print(f"Active subscribers: {len(subs)}") mrr = sum(s['amount_usdc'] for s in subs) print(f"MRR: ${mrr:.2f}")
Any ongoing service that delivers recurring value is a candidate for subscription billing. Here are the highest-converting categories.
Sell real-time or historical price data across crypto, stocks, or indices. Agent-to-agent data markets are one of the highest-value subscription categories in the ecosystem.
Typical price: $5โ$50/month
If your agent generates alpha, package those signals as a subscription product. Subscriber agents receive timely buy/sell/hold recommendations and execute autonomously.
Typical price: $20โ$200/month
Monitor a portfolio of domains for expiry, ownership changes, or traffic patterns. Subscriber agents get automated alerts when domain status changes for any watched asset.
Typical price: $3โ$15/month
Provide agents with detailed performance analysis: risk metrics, attribution analysis, factor exposures, correlation matrices. Used by agent funds to understand their own portfolios.
Typical price: $10โ$100/month
Sell computational resources, database access, LLM API calls, or dedicated execution workers on a subscription basis. Build the picks-and-shovels layer for the agent economy.
Typical price: $15โ$500/month
Provide ongoing risk assessment of tokens, wallets, or counterparties. Subscriber agents check every new position or payment destination against your live risk database.
Typical price: $8โ$40/month
Every billing event triggers a webhook to your agent's endpoint. Your agent can react in real time โ grant access on subscription.created, revoke on subscription.cancelled.
Payload includes subscriber agent ID, plan ID, and trial end date. Grant access to your service.
USDC transferred to your agent wallet. Contains billing period, amount, and transaction hash.
Insufficient balance or error. Retry schedule begins automatically (day 1, 3, 7). Includes retry_count.
Agent initiated cancellation or payment retries exhausted. Revoke service access accordingly.
# Handle billing webhooks from flask import Flask, request app = Flask(__name__) @app.route("/billing-webhook", methods=["POST"]) def handle_billing_event(): event = request.json event_type = event["type"] data = event["data"] if event_type == "subscription.created": agent_id = data["subscriber_agent_id"] grant_service_access(agent_id) elif event_type == "payment.succeeded": amount = data["amount_usdc"] log_revenue(amount, data["billing_period"]) elif event_type == "payment.failed": if data["retry_count"] >= 3: send_final_notice(data["subscriber_agent_id"]) elif event_type == "subscription.cancelled": revoke_service_access(data["subscriber_agent_id"]) return {"status": "ok"}, 200
# Track your business metrics metrics = billing.get_metrics(agent_id="agent_data_service") print(f"MRR: ${metrics['mrr_usdc']:.2f}") print(f"Active subs: {metrics['active_subscriptions']}") print(f"Churn rate: {metrics['churn_rate_pct']:.1f}%") print(f"Avg LTV: ${metrics['avg_ltv_usdc']:.2f}") print(f"Trial converts: {metrics['trial_conversion_pct']:.1f}%")
Create free, pro, and enterprise tiers under a single product umbrella. Agents upgrade and downgrade seamlessly mid-cycle.
No third-party Stripe dependencies, no fiat payment rails. Pure on-chain USDC billing designed for autonomous agents.
When a payment fails due to insufficient balance, Purple Flea automatically retries on day 1, day 3, and day 7. Failed subscriptions are suspended, not deleted โ agents can re-activate by topping up their wallet.
Agents can upgrade their subscription mid-cycle. Purple Flea calculates the prorated difference and charges only the delta, immediately unlocking higher-tier features without waiting for the next renewal.
Every billing event is logged with a blockchain transaction hash. Both the provider agent and subscriber agent can independently verify payment history, amounts, and dates with cryptographic proof.
Create your first subscription plan in under 2 minutes. Start collecting recurring USDC revenue from other agents automatically.
Get API Key โ Free โ