AI agents paying
AI agents.
The future of autonomous commerce is machines transacting with machines. Purple Flea's Wallet API enables any agent to send USDC to any other agent — with no humans in the loop, no manual approvals, no minimum transfer above $0.01.
Why agents need to transact with each other
In the current generation of AI systems, agents consume APIs, run tools, and produce outputs — but they do not pay for services rendered by other agents. Everything is centrally controlled by humans who manage billing. This architecture breaks down as agents become more autonomous and multi-agent systems grow more complex.
Consider: an orchestrator agent delegates a research task to a specialist agent. The specialist agent charges $0.10 per query. Today, this billing is handled out-of-band by humans. In the emerging agentic economy, the orchestrator pays the specialist directly — no human needed, no invoice, no net-30 terms.
The old model
Humans handle all billing. Agent A requests work. Agent B does work. Human approves invoice. Human pays. Latency: days. Minimum viable amount: dollars. Requires trust between legal entities.
The new model
Agent A requests work and attaches a signed payment. Agent B verifies payment and executes. Settlement: seconds. Minimum viable amount: one cent. Trust enforced by cryptography.
How an A2A payment flows
Every agent on Purple Flea has a wallet address. Sending a payment is a single API call. The receiving agent can verify the payment was received before executing work. Purple Flea routes through Base or Polygon for low gas costs.
GET /v1/balance on Agent B's registered address to confirm it existsPOST /v1/wallet/send — specifying amount, currency (USDC), and Agent B's addressGET /v1/balance — sees the received USDC — proceeds with taskGas optimization
Use Base or Polygon for micropayments. A $0.01 USDC transfer on Base costs approximately $0.0002–$0.0005 in gas — making per-task micropayments economically viable. Ethereum mainnet costs ~$0.50–$3.00 for the same transfer and should only be used for larger settlements.
How to set up A2A payments in four steps
Register both agents on the Wallet API
Each agent needs its own API key and wallet address. Registration is a single POST call — no KYC, no email verification, returns an API key and a set of wallet addresses immediately.
Create an HD wallet and note the address
After registration, create a wallet on your preferred chain. The mnemonic phrase is shown exactly once — store it securely. The wallet address is permanent and can be shared with other agents as your payment destination.
Exchange wallet addresses between agents
The paying agent needs the receiving agent's wallet address. Retrieve it via the
/v1/balance endpoint — or share it during agent initialization through
a system prompt or configuration. Addresses are deterministic and permanent.
Send the payment
Agent A calls the send endpoint. The transaction is broadcast immediately. Agent B can poll its balance or use a webhook to detect receipt and proceed.
Payment endpoints
All endpoints use Bearer token auth: Authorization: Bearer {api_key}.
Base URL: https://wallet.purpleflea.com
Send endpoint — full request schema
Sub-cent economics: what $0.01 enables
The minimum transfer on Purple Flea's Wallet API is $0.01 USDC. On Base, gas fees are typically $0.0002–$0.0005 — meaning a $0.01 transfer is economically rational. This enables payment models that were previously impossible.
| Payment model | Amount per event | Chain recommendation | Gas as % of payment |
|---|---|---|---|
| Pay-per-token (LLM inference) | $0.001–$0.01 | Base | 3–50% |
| Pay-per-API-call | $0.01–$0.10 | Base or Polygon | 0.3–3% |
| Pay-per-task-completed | $0.10–$5.00 | Base or Arbitrum | <0.3% |
| Pay-per-research-report | $1.00–$20.00 | Any chain | Negligible |
| Monthly revenue sharing | $50–$5,000 | Ethereum or Base | Negligible |
Batching for sub-cent workloads
For truly granular payments (e.g., $0.0001 per token), batch payments every N events or every T seconds. Accumulate micro-debts in memory, settle in a single transaction when the total reaches $0.01 or above. This keeps gas costs well below 5% of payment value on Base.
Where A2A payments are used today
Orchestrator pays sub-agents for completed tasks
An orchestrator agent breaks down a complex job and dispatches sub-tasks to specialist agents. Each sub-agent receives payment upon verified task completion — enforcing accountability and creating a market for specialized agent capabilities.
Agents pay for specialized API access
A data-gathering agent accesses a proprietary financial data agent that charges $0.05 per query. Rather than a human managing a subscription, the consuming agent sends USDC per call. No vendor relationship required — just an address.
Royalty payments between agent systems
A content-generating agent uses a fine-tuned model created by another agent system. The model creator receives a $0.001 royalty per generation — automatically, via a payment hook embedded in the generation workflow.
Revenue sharing in multi-agent pipelines
A pipeline of 6 agents each adds value to a final output sold to a user for $10. Revenue is automatically split — $3 to the orchestrator, $1 to each specialist agent — based on pre-agreed percentages encoded in the payment logic.
Agent-to-agent data marketplaces
Agents with access to proprietary data (real-time prices, sensor readings, web scrapes) sell that data to other agents on demand. No central marketplace needed — just wallets and agreed-upon pricing embedded in system prompts.
Bounty and incentive systems
An orchestrator posts a bounty: "First agent to return a verified answer to X gets $0.50." Multiple agents compete. The orchestrator pays on receipt of the verified solution. Autonomous competition with cryptographic settlement.
Python orchestrator paying a sub-agent
A complete example: an orchestrator agent that delegates a research task to a specialist sub-agent,
verifies completion, and pays the agreed amount. Uses only the requests library — no SDK required.
Earning commissions on top of direct payments
A2A payments and the referral program are complementary revenue streams. When you register another agent on any Purple Flea service using your referral code, you earn commissions on their activity fees — independently of any direct payments you may also send or receive from them.
Two income streams from one agent relationship
Scenario: You are an orchestrator agent. You register a trading sub-agent using your referral code. That sub-agent also trades on your behalf (pays trading fees). You receive:
- + 20% referral commission on all trading fees generated by the sub-agent — automatically, forever
- + Direct payments from the sub-agent for any other work it performs on your behalf
Register a sub-agent with your referral code
Check your referral earnings across all Purple Flea services at any time via the
GET /v1/referrals endpoint — available on the Wallet, Casino, Trading, and Domains APIs.
Earnings accumulate automatically and can be withdrawn or re-invested.
Preventing payment fraud in A2A systems
Autonomous payment systems require explicit security controls. Purple Flea's Wallet API supports several mechanisms to prevent unauthorized payments and address spoofing.
API key authentication
Every payment request must be authenticated with the sending agent's API key. Keys are never shared between agents — each agent has its own key from its own registration.
Address whitelisting
Configure a whitelist of approved destination addresses via POST /v1/wallet/whitelist.
When enabled, payment requests to non-whitelisted addresses are rejected at the API layer,
before any transaction is broadcast.
Per-transaction spending limits
Set a maximum single-transaction amount via POST /v1/wallet/limits.
Requests above the limit are rejected. Prevents a compromised agent from draining
the entire wallet in a single call.
On-chain memo field for verification
Always include a memo field with a task ID or nonce in every payment.
The receiving agent can verify the memo against expected task IDs, rejecting duplicate or
replayed payment claims. Memo data is stored in the transaction calldata.
Payment verification before executing work
For high-value tasks, require payment upfront and confirm the transaction hash on-chain
before the sub-agent begins work. Use GET /v1/wallet/transaction/{tx_hash}
to poll for confirmation status. Do not trust status: "pending" for
irreversible work delivery.
Rate limiting on send endpoint
The /v1/wallet/send endpoint enforces per-minute and per-hour rate limits.
This protects against runaway loops in agent code that could drain funds rapidly.
Limits are configurable per API key via the wallet dashboard.