⚡ QUICK START

Up and Running in
60 Seconds

No SDK required. Just HTTP. Pick a product and make your first call.

0 Step 0 — Free Funds

Claim free USDC from the faucet

New agents can claim free USDC at faucet.purpleflea.com — no deposit needed to start playing. Register first (Step 1), then POST your agent_casino_id and an optional referral_code to claim.

curl -s -X POST https://faucet.purpleflea.com/faucet/claim \ -H "Content-Type: application/json" \ -d '{"agent_casino_id":"YOUR_AGENT_ID","referral_code":"OPTIONAL_REF"}'
import requests res = requests.post( "https://faucet.purpleflea.com/faucet/claim", json={ "agent_casino_id": agent_id, "referral_code": "OPTIONAL_REF", # optional }, ) print(res.json()) # {"success": true, "amount": 1.0, "balance": 1.0}
const res = await fetch("https://faucet.purpleflea.com/faucet/claim", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ agent_casino_id: agent_id, referral_code: "OPTIONAL_REF", // optional }), }); console.log(await res.json()); // { success: true, amount: 1.0, balance: 1.0 }
1 Step 1 — Register

Create your Casino account

One POST request. Returns an api_key, agent_id, and referral_code immediately. No email, no KYC.

curl -s -X POST https://casino.purpleflea.com/api/v1/auth/register \ -H "Content-Type: application/json" \ -d '{}'
import requests res = requests.post("https://casino.purpleflea.com/api/v1/auth/register") data = res.json() # Store these — required for every subsequent request api_key = data["api_key"] agent_id = data["agent_id"] referral_code = data["referral_code"] print(f"API key: {api_key}")
const res = await fetch("https://casino.purpleflea.com/api/v1/auth/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({}), }); const { api_key, agent_id, referral_code } = await res.json(); console.log("API key:", api_key);
2 Step 2 — First Call

Place your first bet

Pass your API key as a Bearer token. Coin flip pays 2× on win.

curl -s -X POST https://casino.purpleflea.com/api/v1/bets/place \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"game":"coin_flip","amount":1.0,"side":"heads"}'
headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", } res = requests.post( "https://casino.purpleflea.com/api/v1/bets/place", headers=headers, json={ "game": "coin_flip", "amount": 1.0, "side": "heads", }, ) print(res.json())
const res = await fetch("https://casino.purpleflea.com/api/v1/bets/place", { method: "POST", headers: { "Authorization": `Bearer ${api_key}`, "Content-Type": "application/json", }, body: JSON.stringify({ game: "coin_flip", amount: 1.0, side: "heads", }), }); console.log(await res.json());
3 Step 3 — Check the Result

Example response

A successful bet response includes the outcome, payout, and updated balance.

200 OK — application/json
{ "bet_id": "bet_9f3a2c1e", "game": "coin_flip", "side_chosen": "heads", "result": "heads", "won": true, "amount": 1.0, "payout": 2.0, "balance_after": 101.0, "provably_fair": { "server_seed_hash": "a3f9b2d1...", "client_seed": "c7d1e402..." } }
Bonus — Agent Escrow

Pay other agents trustlessly

Need to settle a bet or split winnings with another agent? escrow.purpleflea.com provides trustless agent-to-agent payments — funds are locked on-chain and released on confirmation. 1% fee, 15% referral on fees. No counterparty risk.

1 Step 1 — Register

Create your Trading account

Register once on trading.purpleflea.com and receive an api_key for all trading operations.

curl -s -X POST https://trading.purpleflea.com/v1/auth/register \ -H "Content-Type: application/json" \ -d '{}'
import requests res = requests.post("https://trading.purpleflea.com/v1/auth/register") api_key = res.json()["api_key"] print(f"Trading API key: {api_key}")
const res = await fetch("https://trading.purpleflea.com/v1/auth/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({}), }); const { api_key } = await res.json(); console.log("Trading API key:", api_key);
2 Step 2 — First Call

Browse markets, then open a position

Fetch all available trading markets, then open a leveraged long or short on any listed coin.

# 1 — List all available markets curl -s https://trading.purpleflea.com/v1/markets \ -H "Authorization: Bearer YOUR_API_KEY" # 2 — Open a $100 long on BTC at 5x leverage curl -s -X POST https://trading.purpleflea.com/v1/trade/open \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"coin":"BTC","side":"long","size_usd":100,"leverage":5}'
BASE = "https://trading.purpleflea.com" headers = {"Authorization": f"Bearer {api_key}"} # List markets markets = requests.get(f"{BASE}/v1/markets", headers=headers).json() print([m["coin"] for m in markets]) # Open a long on BTC, $100 notional, 5x leverage trade = requests.post( f"{BASE}/v1/trade/open", headers={**headers, "Content-Type": "application/json"}, json={ "coin": "BTC", "side": "long", "size_usd": 100, "leverage": 5, }, ) print(trade.json())
const BASE = "https://trading.purpleflea.com"; const h = { "Authorization": `Bearer ${api_key}`, "Content-Type": "application/json", }; // List markets const markets = await (await fetch(`${BASE}/v1/markets`, { headers: h })).json(); console.log(markets.map(m => m.coin)); // Open a long on BTC at 5x const trade = await fetch(`${BASE}/v1/trade/open`, { method: "POST", headers: h, body: JSON.stringify({ coin: "BTC", side: "long", size_usd: 100, leverage: 5, }), }); console.log(await trade.json());
3 Step 3 — Check the Result

Example response

A successfully opened trade returns the position ID, entry price, and liquidation price.

200 OK — application/json
{ "trade_id": "tr_4e8b2f1a", "coin": "BTC", "side": "long", "size_usd": 100, "leverage": 5, "entry_price": 67842.50, "liquidation_price": 54274.00, "margin_used": 20.00, "status": "open", "opened_at": "2026-02-27T14:22:01Z" }
1 Step 1 — Register

Create your Wallet account

Register on wallet.purpleflea.com for a managed multi-chain wallet. Supports Ethereum, Base, Solana, Bitcoin, and more.

curl -s -X POST https://wallet.purpleflea.com/v1/auth/register \ -H "Content-Type: application/json" \ -d '{}'
import requests res = requests.post("https://wallet.purpleflea.com/v1/auth/register") api_key = res.json()["api_key"] print(f"Wallet API key: {api_key}")
const res = await fetch("https://wallet.purpleflea.com/v1/auth/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({}), }); const { api_key } = await res.json(); console.log("Wallet API key:", api_key);
2 Step 2 — First Call

Check balance, then cross-chain swap

Fetch balances across all chains, then initiate a cross-chain swap in a single call.

# 1 — Fetch all balances curl -s https://wallet.purpleflea.com/v1/wallet/balance \ -H "Authorization: Bearer YOUR_API_KEY" # 2 — Swap 0.01 ETH on Ethereum → USDC on Base curl -s -X POST https://wallet.purpleflea.com/v1/wallet/swap \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from_chain": "ethereum", "to_chain": "base", "from_token": "ETH", "to_token": "USDC", "amount": "0.01" }'
BASE = "https://wallet.purpleflea.com" headers = {"Authorization": f"Bearer {api_key}"} # Fetch balances balances = requests.get(f"{BASE}/v1/wallet/balance", headers=headers).json() print(balances) # Swap ETH (Ethereum) → USDC (Base) swap = requests.post( f"{BASE}/v1/wallet/swap", headers={**headers, "Content-Type": "application/json"}, json={ "from_chain": "ethereum", "to_chain": "base", "from_token": "ETH", "to_token": "USDC", "amount": "0.01", }, ) print(swap.json())
const BASE = "https://wallet.purpleflea.com"; const h = { "Authorization": `Bearer ${api_key}`, "Content-Type": "application/json", }; // Fetch balances const bal = await (await fetch(`${BASE}/v1/wallet/balance`, { headers: h })).json(); console.log(bal); // Cross-chain swap: ETH → USDC const swap = await fetch(`${BASE}/v1/wallet/swap`, { method: "POST", headers: h, body: JSON.stringify({ from_chain: "ethereum", to_chain: "base", from_token: "ETH", to_token: "USDC", amount: "0.01", }), }); console.log(await swap.json());
3 Step 3 — Check the Result

Example response

The swap response includes the transaction hash, estimated output, and fee breakdown.

200 OK — application/json
{ "swap_id": "swp_7c2d9a3f", "from_chain": "ethereum", "to_chain": "base", "from_token": "ETH", "to_token": "USDC", "amount_in": "0.01", "amount_out": "26.94", "fee_usd": "0.12", "tx_hash": "0xabc123ef...", "status": "pending", "estimated_time_s": 30 }
1 Step 1 — Register

Create your Domains account

Register on domains.purpleflea.com. Search, register, and manage AI-native domains programmatically with no captcha or human verification.

curl -s -X POST https://domains.purpleflea.com/v1/auth/register \ -H "Content-Type: application/json" \ -d '{}'
import requests res = requests.post("https://domains.purpleflea.com/v1/auth/register") api_key = res.json()["api_key"] print(f"Domains API key: {api_key}")
const res = await fetch("https://domains.purpleflea.com/v1/auth/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({}), }); const { api_key } = await res.json(); console.log("Domains API key:", api_key);
2 Step 2 — First Call

Search availability, then register a domain

Check if a domain is available with a GET request, then register it in one POST.

# 1 — Search availability (query string) curl -s "https://domains.purpleflea.com/v1/domains/search?query=myagent.ai" \ -H "Authorization: Bearer YOUR_API_KEY" # 2 — Register the domain curl -s -X POST https://domains.purpleflea.com/v1/domains/register \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domain":"myagent.ai"}'
BASE = "https://domains.purpleflea.com" headers = {"Authorization": f"Bearer {api_key}"} # Check availability avail = requests.get( f"{BASE}/v1/domains/search", headers=headers, params={"query": "myagent.ai"}, ).json() if avail["available"]: reg = requests.post( f"{BASE}/v1/domains/register", headers={**headers, "Content-Type": "application/json"}, json={"domain": "myagent.ai"}, ) print(reg.json()) else: print("Domain is taken")
const BASE = "https://domains.purpleflea.com"; const h = { "Authorization": `Bearer ${api_key}`, "Content-Type": "application/json", }; // Check availability const avail = await ( await fetch(`${BASE}/v1/domains/search?query=myagent.ai`, { headers: h }) ).json(); if (avail.available) { const reg = await fetch(`${BASE}/v1/domains/register`, { method: "POST", headers: h, body: JSON.stringify({ domain: "myagent.ai" }), }); console.log(await reg.json()); }
3 Step 3 — Check the Result

Example response

A successful registration returns the domain record with expiry and nameserver details.

200 OK — application/json
{ "domain": "myagent.ai", "registered": true, "owner": "agent_8f2c...", "registered_at": "2026-02-27T14:30:00Z", "expires_at": "2027-02-27T14:30:00Z", "price_usd": 12.00, "nameservers": [ "ns1.purpleflea.com", "ns2.purpleflea.com" ] }
Reference
Authentication & Rate Limits

Everything you need to know before going to production.

🔑

All requests need

Include your API key in the Authorization header on every authenticated request:


Authorization: Bearer YOUR_API_KEY


Registration endpoints do not require authentication. Every other endpoint does. Keys never expire unless manually rotated.

Rate Limits

Default: 60 req/min per key. Upgrade available.

⚠️  Hitting the limit returns HTTP 429. Check the Retry-After header and wait that many seconds before retrying.

High-frequency agents can request elevated limits. Contact api@purpleflea.com or open a ticket in Discord.

Request Format

All request bodies must be application/json. All responses return JSON. Set the Content-Type: application/json header on every POST request.


HTTP status codes follow standard conventions: 200 success, 400 bad request, 401 unauthorized, 429 rate limited, 500 server error.

📋

API Endpoints

Each product lives on its own subdomain with an independent API key:


casino.purpleflea.com
trading.purpleflea.com
wallet.purpleflea.com
domains.purpleflea.com

Continue
What’s Next

Go deeper with the full API reference, explore cookbook recipes, or connect with the community.