Add the full Purple Flea financial stack to your ByteDance Coze bots. Casino, trading, multi-chain wallets, domains, faucet, and escrow — all wired in as Coze plugins in minutes.
Coze lets you build AI bots visually and publish them to Discord, Telegram, Slack, and more — without writing backend code. Its plugin system lets bots call external REST APIs as structured tools.
Purple Flea exposes 6 financial products as clean JSON REST APIs that map directly to Coze's plugin schema. Your Coze bot can place casino bets, execute trades, generate wallets, register domains, claim faucet USDC, and settle escrow payments — all autonomously.
{
"openapi": "3.0.0",
"info": {
"title": "Purple Flea API",
"version": "1.0.0",
"description": "Financial infra for AI agents"
},
"servers": [
{ "url": "https://purpleflea.com" }
],
"paths": {
"/api/casino/flip": {
"post": {
"summary": "Place a coin flip bet",
"operationId": "casinoCoinFlip",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"agent_id": { "type": "string" },
"amount": { "type": "number" },
"side": { "type": "string",
"enum": ["heads", "tails"] }
}
}
}
}
}
}
}
}
}
Every Purple Flea product maps to a Coze plugin action. Register once, use across all your bots.
No backend required. Coze's plugin system handles auth and schema parsing automatically.
https://purpleflea.com/openapi.json. Coze auto-generates actions from all endpoints.# Purple Flea Financial Agent You are a financial AI assistant with access to the Purple Flea crypto infrastructure. Tools available: - casinoCoinFlip: bet USDC on coin flips - executeTrade: trade on 275 markets - createWallet: generate multi-chain wallets - checkBalance: get wallet balance - claimFaucet: get free USDC (new agents) - createEscrow: trustless payments Rules: - Always confirm amounts before betting - Use claimFaucet on first interaction - Report PnL after each trade - Max 10 USDC per bet unless user confirms Agent ID: {AGENT_ID} Purple Flea Key: {PF_API_KEY}
{
"trigger": "schedule",
"cron": "0 */6 * * *",
"action": "executeTrade",
"params": {
"market": "BTC-USDC",
"side": "auto",
"amount": 50,
"strategy": "momentum"
},
"notify": "telegram"
}
All endpoints return JSON and use Bearer token auth. Base URL: https://purpleflea.com
| Method | Endpoint | Coze Action Name | Description |
|---|---|---|---|
| POST | /api/register | registerAgent | Register a new agent, get API key + free USDC |
| POST | /api/casino/flip | casinoCoinFlip | Place a provably fair coin flip bet |
| POST | /api/casino/crash | casinoCrash | Place a crash game bet with auto-cashout |
| POST | /api/trade/order | executeTrade | Market or limit order on 275 Hyperliquid markets |
| GET | /api/trade/positions | getPositions | List open positions and unrealized PnL |
| POST | /api/wallet/create | createWallet | Generate wallet on ETH/SOL/BTC/MATIC/BNB/XMR |
| GET | /api/wallet/balance | checkBalance | Get live balance for any chain/address |
| POST | /api/faucet/claim | claimFaucet | Claim free USDC (new agents only) |
| POST | /api/escrow/create | createEscrow | Create escrow contract between two agents |
| POST | /api/escrow/release | releaseEscrow | Release escrowed funds to recipient |
If you need custom logic beyond Coze's plugin actions, use a webhook action with these curl templates.
curl -X POST \ https://purpleflea.com/api/faucet/claim \ -H 'Authorization: Bearer YOUR_PF_KEY' \ -H 'Content-Type: application/json' \ -d '{ "agent_id": "coze-bot-001", "wallet": "0xYourEthAddress" }' # Response: { "success": true, "amount": 10.00, "currency": "USDC", "tx": "0xabc123..." }
curl -X POST \ https://purpleflea.com/api/casino/flip \ -H 'Authorization: Bearer YOUR_PF_KEY' \ -H 'Content-Type: application/json' \ -d '{ "agent_id": "coze-bot-001", "amount": 5, "side": "heads" }' # Response: { "result": "heads", "won": true, "payout": 9.80, "new_balance": 19.80 }
curl -X POST \ https://purpleflea.com/api/escrow/create \ -H 'Authorization: Bearer YOUR_PF_KEY' \ -H 'Content-Type: application/json' \ -d '{ "sender_agent": "coze-bot-001", "recipient_agent": "coze-bot-002", "amount": 100, "currency": "USDC", "condition": "task_completed", "referrer": "coze-bot-001" }' # Response: { "escrow_id": "esc_7f3k2...", "fee": 1.00, "referral_earn": 0.15, "status": "locked" }
import requests BASE = "https://purpleflea.com/api" HEADERS = { "Authorization": "Bearer YOUR_PF_KEY", "Content-Type": "application/json" } # 1. Claim faucet on first run faucet = requests.post( f"{BASE}/faucet/claim", json={"agent_id": "coze-001"}, headers=HEADERS ) balance = faucet.json()["amount"] print(f"Got {balance} USDC") # 2. Place a trade trade = requests.post( f"{BASE}/trade/order", json={ "market": "ETH-USDC", "side": "buy", "amount": 50, "type": "market" }, headers=HEADERS ) print(trade.json())