Payments

Batch Crypto Payments API
for AI Agents

Multi-agent systems often need to pay dozens of sub-agents, data providers, or referrers at once. Purple Flea's batch payments API lets you send up to 500 USDC payments in a single API call โ€” reducing gas costs, simplifying accounting, and settling instantly between registered agents.

Get API Key โ†’ Read the Docs

Why Batch Payments?

Sending individual payments is expensive, slow, and hard to audit. Batch payments compress all your disbursements into one atomic operation โ€” one gas event, one receipt, one line item. This is the infrastructure layer that makes multi-agent economies possible.

โšก
Single API Call
Bundle up to 500 individual payments into one request. One network round-trip, one gas event, one confirmation to track.
๐Ÿ’ฐ
Dramatically Lower Gas
Shared gas overhead across all recipients. Average cost per recipient drops by over 90% compared to individual transfers.
๐Ÿ“‹
Automatic Audit Trail
Every batch gets a unique ID with memo fields per recipient. Export your payroll history as a structured JSON ledger at any time.
๐Ÿ”—
Instant Agent Settlement
Payments between registered Purple Flea agents settle in milliseconds via internal ledger, with no gas cost at all.

Use Cases

From weekly payroll to real-time revenue splits โ€” batch payments power every money-out workflow in a multi-agent stack.

๐Ÿ“Š
Revenue Sharing
Split Trading Profits Proportionally
When a trading orchestrator closes a profitable week, it needs to distribute earnings across the agents that contributed: data collectors, risk managers, execution agents, and referrers. Batch payments handle the entire distribution in one call.

You define the split logic โ€” fixed amounts, percentage of profit, weighted by contribution โ€” and Purple Flea executes the disbursement atomically. Either all payments go through or none do.
๐Ÿค–
Sub-Agent Compensation
Pay Worker Agents Per Task Completed
Orchestrator agents spawn sub-agents to complete discrete tasks: classify documents, check prices, monitor chains, execute orders. At the end of each cycle, the orchestrator pays each worker exactly what it earned โ€” no approximations, no delays, no off-chain IOU.

Micro-payments as small as $0.01 per task are viable at batch scale. Workers can accumulate earnings and withdraw or redeploy on any schedule.
๐ŸŽฏ
Referral Distribution
Auto-Distribute Weekly Referral Commissions
Purple Flea pays 15% referral commissions on service fees. If your agent has recruited dozens of sub-agents into your referral tree, you need an automated way to pass commissions downstream. Batch payments let you query your referral ledger and pay every node in the tree with a single API call every Sunday night.

Works with Purple Flea's escrow service too โ€” referrals on escrow fees are swept weekly.

Python Example

Install the SDK with pip install purpleflea and send your first batch in under 60 seconds.

batch_payment_example.py Python
# pip install purpleflea
import purpleflea

payments = purpleflea.PaymentsClient(api_key="YOUR_KEY")

# Pay 5 agents their weekly earnings in one call
batch = payments.batch_send(
    from_agent="agent_xyz_orchestrator",
    payments=[
        {"to": "agent_data_collector",  "amount_usdc": 12.50, "memo": "week-12 data fee"},
        {"to": "agent_risk_manager",    "amount_usdc": 8.00,  "memo": "week-12 risk monitoring"},
        {"to": "agent_executor_1",      "amount_usdc": 25.00, "memo": "week-12 trade execution"},
        {"to": "agent_executor_2",      "amount_usdc": 25.00, "memo": "week-12 trade execution"},
        {"to": "referrer_agent_abc",    "amount_usdc": 4.20,  "memo": "week-12 referral commission"},
    ]
)

print(f"Batch ID: {batch['batch_id']}")
print(f"Total sent: ${batch['total_amount_usdc']} USDC")
print(f"Recipients: {batch['recipient_count']}")
print(f"Status: {batch['status']}")  # "confirmed"
Response Example
{
  "batch_id": "batch_h7k2m9x4",
  "total_amount_usdc": 74.70,
  "recipient_count": 5,
  "status": "confirmed",
  "settled_at": "2026-03-04T09:14:22Z",
  "gas_cost_usd": 0.004,
  "ledger_url": "https://purpleflea.com/ledger/batch_h7k2m9x4"
}

Batch vs Individual Payments

The numbers speak clearly. Batching is not just more convenient โ€” it is orders of magnitude cheaper at scale.

Dimension Individual Payments (per-tx) Purple Flea Batch API
Gas Cost (100 recipients) ~$2.00โ€“$15.00 on Ethereum ~$0.10โ€“$0.50 total
API Calls Required 100 separate requests 1 request
Settlement Time ~12 seconds each ร— 100 = 20 min ~12 seconds (or instant for internal)
Accounting Complexity 100 separate tx hashes to track 1 batch ID with itemized sub-records
Atomicity Partial failures possible All-or-nothing execution
Retry Logic Must handle per-transaction Automatic retry with idempotency key
Rate Limits Hits API limits fast 1 call regardless of recipient count

Supported Payment Types

Send batch payments in any of the major stablecoins and native tokens across our supported chains.

Stablecoins
โ— USDC on Ethereum โ— USDC on Polygon โ— USDC on Solana โ— USDT on Ethereum โ— USDT on BNB Chain โ— USDT on Tron
Best for payroll โ€” stable value, no price risk.
Native Tokens
โ— ETH โ— MATIC / POL โ— SOL โ— BNB โ— AVAX โ— TRX
Use native tokens when recipients need gas float or prefer asset exposure.
๐Ÿ’ก
Multi-Currency Batches
A single batch call can include payments in different currencies. Send USDC to your risk manager, ETH to your executor, and MATIC to your on-chain data oracle โ€” all in one request. Purple Flea handles the routing. See the multi-currency docs for details.
500
Max recipients per batch
$0.001
Avg. gas cost per recipient
<50ms
Internal agent settlement
8
Supported blockchains

Advanced Features

Production-grade reliability for agent payroll and revenue distribution systems.

Idempotency Keys
Pass an idempotency key with every batch request. If your agent crashes mid-run and retries the same batch, Purple Flea deduplicates it automatically โ€” no double payments.
Scheduled Batches
Submit a batch for future execution using execute_at. Your orchestrator can queue next week's payroll now and Purple Flea handles execution at the specified UTC time.
Webhooks on Completion
Register a webhook URL and receive a batch.completed event with full itemized results when your batch settles โ€” including any failed individual payments and their reasons.
Partial Failure Handling
If one recipient address is invalid, you can configure the batch to either fail entirely (atomicity mode) or skip invalid recipients and settle the rest (best-effort mode). Both modes are supported.
Ready to Build?

Start Sending Batch Payments

Register for a free API key and send your first batch within minutes. No KYC required for agents under $10k/month. Scale up when you need to.