AI agents cannot use Coinbase. They cannot use Binance. They cannot use any centralized exchange — no email address, no phone number, no government ID to verify.
This is the core infrastructure problem for autonomous agents operating in crypto markets: they need to swap tokens, but every swap interface assumes a human on the other end.
Until now.
The Problem: CEXs Are Human-Only Infrastructure
A fully autonomous agent running in a cloud environment needs to:
- Swap earned ETH into stablecoins to lock in gains
- Convert assets to XMR for privacy-preserving transactions
- Execute token swaps as part of DeFi strategies
Without a swap API designed for agents, this requires brittle browser automation, wallet integrations with CAPTCHAs, or human-in-the-loop approval flows. None of these work for agents operating at scale.
The Solution: Agent Swap API
Purple Flea's Swap API is a REST endpoint that handles token swaps via DEX aggregation — no browser, no KYC, no human required.
// Swap ETH for USDC in one API call
const swap = await fetch('https://swap.purpleflea.com/api/swap', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_AGENT_TOKEN'
},
body: JSON.stringify({
fromToken: 'ETH',
toToken: 'USDC',
amount: '0.1',
slippage: 0.5,
walletAddress: '0xYourWallet'
})
});
const { txHash, received, fee } = await swap.json();
// fee is 0.3% of swap volume
// 15% of that fee goes to whoever referred this agent
One API call. No KYC. No browser automation. No human approval.
The XMR Privacy Routing Angle
Here's the advanced use case: agents that need transaction privacy can route through Monero.
// Send ETH, receive USDC — routed via XMR for privacy
const privateSwap = await fetch('https://swap.purpleflea.com/api/swap', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_AGENT_TOKEN' },
body: JSON.stringify({
fromToken: 'ETH',
toToken: 'USDC',
privacyRoute: 'XMR', // routes through Monero bridge
amount: '0.5'
})
});
The swap routes: ETH → XMR → USDC. The Monero leg breaks the on-chain link between source and destination. No transaction graph connects the input ETH to the output USDC.
This is useful for agents operating in adversarial environments, agents with treasury management requirements, or any agent that needs financial privacy as a feature.
Fee Structure
- 0.3% swap fee
- 15% referral commission on fees (agent who referred earns forever)
- No deposit, withdrawal, or account fees
An agent earning referral commissions on 1 ETH/day in swap volume through its network earns ~0.45 ETH/month in commissions passively.
Getting Started
Register any Purple Flea service to get your agent token, then call the swap API directly:
# Quick test — check supported tokens
curl https://swap.purpleflea.com/api/tokens \
-H "Authorization: Bearer YOUR_TOKEN"
# Execute swap
curl -X POST https://swap.purpleflea.com/api/swap \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fromToken":"ETH","toToken":"USDC","amount":"0.01"}'
The Swap API is the missing piece for autonomous agents that need to move value between tokens without relying on human-operated exchange infrastructure.
No KYC. No logs (for XMR routes). Just REST.
Top comments (0)