Non-custodial HD wallets, BIP-39 mnemonic generation, and DEX swap routing across Ethereum, Solana, Bitcoin, BNB Chain, Polygon, Avalanche, and Tron — all behind a single developer-friendly REST API.
The Purple Flea Wallet API is a production-grade, non-custodial HD wallet service purpose-built for AI agents and autonomous applications. Traditional crypto SDKs require your application to manage private keys, sign transactions locally, and integrate with each blockchain separately. That works fine for human-facing apps but creates a significant complexity burden when you want an AI agent to hold and transact crypto assets autonomously.
Our Wallet API abstracts all of that away. You make a single POST /wallet/create call and receive a BIP-39 mnemonic and a wallet ID. From that point forward, your agent can query balances, send tokens, and execute DEX swaps on seven blockchains using simple JSON requests — the same mnemonic derivation path is used consistently so the same phrase controls the same address on every supported chain.
The API is framework-agnostic. It works identically whether your agent is built on LangChain, CrewAI, AutoGen, or is a raw Python script calling our MCP server from Claude Desktop. Every endpoint returns structured JSON with predictable schemas, making it trivially easy to parse results in a tool-use callback.
Every wallet created through the Purple Flea API uses standard BIP-39 / BIP-32 / BIP-44 derivation. The master seed derived from the 12- or 24-word mnemonic is the root of all chain addresses. This means if your agent ever needs to recover a wallet outside of our API, it can import the mnemonic into any compatible wallet (MetaMask, Phantom, Electrum, etc.) and access its funds immediately.
Tron support uses the same BIP-32 root as Ethereum but encodes addresses in base58check with the 0x41 prefix — identical to how hardware wallets handle Tron derivation.
The base URL for all Wallet API requests is https://api.purpleflea.xyz/v1. Authenticate by passing your API key in the X-Purple-Key header on every request. All request and response bodies are JSON.
Creates a brand-new BIP-39 mnemonic and derives the master HD key. Returns a wallet_id you use for all subsequent calls, plus the 12-word mnemonic. Store the mnemonic securely — Purple Flea does not persist it after this response.
curl -X POST https://api.purpleflea.xyz/v1/wallet/create \ -H "X-Purple-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "strength": 128, "label": "my-agent-wallet" }'
{
"wallet_id": "wlt_9f3k2m8xqp",
"mnemonic": "artist region hollow timber voyage walnut glide stone fade lunar damp bridge",
"created_at": "2025-09-14T10:22:41Z",
"label": "my-agent-wallet"
}
Derives and returns the public address for the specified chain. Pass the chain name as a query parameter. The address is deterministically computed from the mnemonic using the BIP-44 path listed in the chain table above.
curl https://api.purpleflea.xyz/v1/wallet/wlt_9f3k2m8xqp/address?chain=ethereum \
-H "X-Purple-Key: YOUR_API_KEY"
{
"chain": "ethereum",
"address": "0x4a7B3F9c2E8d1A6bC0f5D2e7A4B9C3F8E1D6A2b",
"derivation_path": "m/44'/60'/0'/0/0"
}
Returns native token balances and any ERC-20 / SPL / TRC-20 token balances for the specified chain, along with current USD values sourced from CoinGecko. Omit the chain parameter to get balances across all supported networks in a single call.
curl https://api.purpleflea.xyz/v1/wallet/wlt_9f3k2m8xqp/balance \
-H "X-Purple-Key: YOUR_API_KEY"
{
"wallet_id": "wlt_9f3k2m8xqp",
"balances": [
{
"chain": "ethereum",
"native": { "symbol": "ETH", "amount": "0.847", "usd": "2114.50" },
"tokens": [
{ "symbol": "USDC", "amount": "500.00", "usd": "500.00" },
{ "symbol": "LINK", "amount": "42.5", "usd": "637.50" }
]
},
{
"chain": "solana",
"native": { "symbol": "SOL", "amount": "12.3", "usd": "1847.43" },
"tokens": []
}
],
"total_usd": "5099.43"
}
Signs and broadcasts a token transfer transaction. Supports native asset transfers and token transfers (ERC-20, SPL, TRC-20, BEP-20). The API constructs the transaction, signs it server-side using the encrypted key material, and broadcasts it to the network. Returns the transaction hash immediately and polls for confirmation in the background.
curl -X POST https://api.purpleflea.xyz/v1/wallet/wlt_9f3k2m8xqp/send \ -H "X-Purple-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "chain": "ethereum", "to": "0xRecipientAddressHere", "asset": "ETH", "amount": "0.05", "priority": "standard" }'
{
"tx_hash": "0x3d8f2a9c1b4e7f0a2d5c8e1b4f7a0d3c6e9b2f5",
"chain": "ethereum",
"status": "pending",
"gas_used": "21000",
"fee_usd": "1.24",
"explorer_url": "https://etherscan.io/tx/0x3d8f2a9c..."
}
Executes a token swap by aggregating quotes from 1inch (Ethereum, BNB, Polygon, Avalanche), Jupiter (Solana), and Paraswap (Ethereum, Polygon). The API automatically selects the route with the best net output after accounting for gas costs and protocol fees. Specify a slippage_bps tolerance in basis points (100 = 1%).
curl -X POST https://api.purpleflea.xyz/v1/wallet/wlt_9f3k2m8xqp/swap \ -H "X-Purple-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "chain": "ethereum", "from_asset": "ETH", "to_asset": "USDC", "amount": "0.1", "slippage_bps": 50 }'
{
"tx_hash": "0xabc123def456...",
"from_asset": "ETH",
"from_amount": "0.1",
"to_asset": "USDC",
"to_amount": "249.82",
"route": "1inch",
"price_impact_pct": "0.04",
"fee_usd": "2.10",
"status": "pending"
}
Getting the best price on a DEX swap is genuinely difficult. Liquidity is fragmented across dozens of protocols — Uniswap, Curve, Balancer, Orca, Raydium — and the optimal route changes with every block. Rather than building and maintaining routing infrastructure yourself, the Purple Flea Wallet API handles all of this transparently.
When your agent calls POST /wallet/:id/swap, the API simultaneously queries all three aggregators, compares net output amounts after gas estimation, and executes through whichever route delivers the most tokens to your wallet. The response tells you which aggregator won and what the final price impact was.
The leading EVM aggregator. Splits orders across Uniswap V2/V3, SushiSwap, Curve, Balancer, and 200+ other sources. Best for large ETH, BNB Chain, Polygon, and Avalanche swaps where deep liquidity matters.
Solana's dominant liquidity aggregator, routing across Orca, Raydium, Meteora, Phoenix, and all major Solana AMMs and CLMMs. Handles SPL-to-SPL swaps with sub-second finality and minimal slippage.
Battle-tested EVM aggregator with strong Polygon and Ethereum coverage. Particularly effective for stablecoin swaps and routes through Curve, Aave, and Compound that 1inch occasionally misses.
Security is the most important design decision in any wallet service. Purple Flea's architecture is built around a simple principle: your agent owns the mnemonic, and we only ever see encrypted key material.
Private keys derived from the mnemonic are encrypted with AES-256-GCM using a key derived from your API key. The ciphertext is what lives in our database. Even in the unlikely event of a database breach, the attacker gains nothing without your API key.
We never log or store your 12 or 24-word mnemonic after the initial POST /wallet/create response. Once that response is delivered, mnemonic recovery is entirely your responsibility — and entirely under your control.
Your AI agent receives the mnemonic in plaintext exactly once. The agent can store it in its own secret store (HashiCorp Vault, AWS Secrets Manager, a local encrypted file) and use it to recover the wallet at any time via any BIP-39-compatible tool.
All transactions are signed in-memory within an isolated execution environment. Signing keys are never written to disk in plaintext and are zeroed from memory immediately after use. Signing happens within an isolated execution environment per request.
Optionally restrict your API key to specific IP ranges. Built-in rate limits prevent runaway agents from draining wallets. Set per-transaction spend limits and daily caps via the dashboard.
Every API call, transaction signature, and swap execution is recorded in a tamper-evident audit log accessible through the dashboard and via GET /wallet/:id/history. Useful for agent debugging and compliance review.
Building an agent platform, a DeFi tool, or a framework integration? Embed your referral code in the Purple Flea Wallet API configuration and earn 10% of the swap fee on every transaction your users execute — paid out weekly in USDC.
The referral system requires no code changes beyond setting a single referrer field in the swap request body. Purple Flea handles attribution, accounting, and payouts automatically. There is no cap on earnings and the 10% rate is locked in for the lifetime of any referred user.
{
"chain": "solana",
"from_asset": "SOL",
"to_asset": "USDC",
"amount": "5",
"slippage_bps": 100,
"referrer": "ref_YOUR_CODE_HERE"
}
The Wallet API is available as native tool bindings for every major agent framework. Pick your stack:
Free tier includes unlimited wallet creation, balance reads, and 10 free swaps per month. No credit card required to get started. Production-grade infrastructure that scales with your usage.