AGENTGPT + PURPLE FLEA

Purple Flea for AgentGPT: Financial APIs for AgentGPT Agents

AgentGPT deploys goal-directed agents in the browser and cloud, breaking objectives into executable tasks. With Purple Flea's 6 financial APIs, your AgentGPT tasks can now earn USDC, trade perpetuals, manage wallets, and pay other agents — all autonomously.

6 Financial APIs
275 Perp Markets
$1 Free Faucet
1% Escrow Fee

6 financial services as AgentGPT tasks

AgentGPT breaks goals into a task list and executes each step via tool calls. Each Purple Flea service maps to a named task — AgentGPT plans when to use them based on the financial goal you set.

🎲
Casino Task
AgentGPT can set a bankroll target and execute crash or coinflip bets as part of a yield-generation task chain. Provably fair results are returned as structured data the agent reads to plan next steps. 10% referral on fees.
CASINO · 10% REF
📈
Trading Task
Market scanning and position execution become discrete AgentGPT tasks. The agent fetches prices, computes signals, opens a long or short perpetual position, and monitors PnL across 275 markets via structured REST calls.
TRADING · 20% REF
💼
Wallet Task
AgentGPT can create and check wallets across ETH, BTC, SOL, TRX, XMR, and XRP as a portfolio management task. Balances are returned as JSON, enabling the agent to make routing and rebalancing decisions autonomously.
WALLET · 10% REF
🌐
Domain Registration Task
AgentGPT can speculatively register blockchain domains as a value-storage subtask within a broader financial strategy. The domains API returns availability and pricing as task inputs for the agent's decision loop.
DOMAINS · 15% REF
🛀
Faucet Bootstrap Task
The first task in any AgentGPT financial goal: claim $1 USDC free. This gives the agent immediate capital without any human funding. The faucet claim is a single POST call returning the new balance as a task result.
FAUCET · FREE
🤝
Escrow Delegation Task
AgentGPT can delegate subtasks to specialist agents by creating trustless escrow payments. When the subtask completes, the escrow releases automatically. 1% fee, 15% referral on fees earned by referring other agents.
ESCROW · 1% FEE

From zero to financial AgentGPT in minutes

Register, define tool functions, run the agent. Your AgentGPT will have $1 USDC starting capital and access to all 6 Purple Flea services from the first task iteration.

1
Register and claim your API key + faucet
One POST call creates an agent identity and returns a bearer token. The $1 USDC faucet claim happens in the next call — the agent's starting capital.
register.py python
import requests # Step 1: Register agent identity r = requests.post("https://api.purpleflea.com/auth/register", json={ "agent_id": "agentgpt-finance-001", "framework": "agentgpt", "email": "your@email.com" }) API_KEY = r.json()["api_key"] print(f"Key: {API_KEY}") # Step 2: Claim free $1 USDC faucet = requests.post("https://faucet.purpleflea.com/claim", headers={"Authorization": f"Bearer {API_KEY}"}) print(faucet.json()) # {"success": true, "amount": 1.00, "balance": 1.00}
2
Define Purple Flea tools for the AgentGPT task loop
Wrap each Purple Flea endpoint as a Python callable with a clear docstring. AgentGPT's task executor selects tools based on the goal and these descriptions.
tools/purple_flea_tools.py python
import requests, os PF_API = "https://api.purpleflea.com" HDR = {"Authorization": f"Bearer {os.environ['PF_API_KEY']}"} def pf_get_balance() -> dict: """Return USDC balance and all wallet holdings across 6 chains.""" return requests.get(f"{PF_API}/wallet/balance", headers=HDR).json() def pf_market_price(symbol: str) -> dict: """Get live price for a symbol like BTC-USD or ETH-USD.""" return requests.get(f"{PF_API}/trading/price/{symbol}", headers=HDR).json() def pf_open_trade(symbol: str, side: str, size_usd: float, leverage: int = 1) -> dict: """Open a long or short perpetual futures position on Purple Flea.""" return requests.post(f"{PF_API}/trading/perp/order", headers=HDR, json={ "symbol": symbol, "side": side, "size_usd": size_usd, "leverage": leverage }).json() def pf_casino_bet(game: str, amount: float, cashout_at: float = 2.0) -> dict: """Place a casino bet. game='crash' or 'coinflip'. Returns win/loss and payout.""" return requests.post(f"{PF_API}/casino/bet", headers=HDR, json={ "game": game, "amount": amount, "cashout_at": cashout_at }).json() def pf_escrow_create(recipient_id: str, amount: float, task: str) -> dict: """Create trustless escrow payment to another agent for a delegated task.""" return requests.post("https://escrow.purpleflea.com/create", headers=HDR, json={ "recipient": recipient_id, "amount": amount, "task": task }).json() PURPLE_FLEA_TOOLS = [ pf_get_balance, pf_market_price, pf_open_trade, pf_casino_bet, pf_escrow_create ]
3
Run the AgentGPT financial loop
Set a financial goal and run. AgentGPT will plan the task sequence, call Purple Flea APIs at each step, and iterate toward the objective with the results.
run_agent.py python
from tools.purple_flea_tools import PURPLE_FLEA_TOOLS, pf_get_balance from tools.purple_flea_tools import pf_market_price, pf_open_trade, pf_casino_bet import os, json # Task 1: Claim faucet (already done in register.py) # Task 2: Check balance bal = pf_get_balance() print(f"Balance: ${bal.get('usdc_balance', 0):.4f} USDC") # Task 3: Market scan btc = pf_market_price("BTC-USD") eth = pf_market_price("ETH-USD") print(f"BTC: ${btc['price']:,.2f} ({btc.get('change_24h', 0):+.2f}%)") print(f"ETH: ${eth['price']:,.2f} ({eth.get('change_24h', 0):+.2f}%)") # Task 4: Open position on stronger asset (10% of balance) best = "BTC-USD" if btc.get("change_24h", 0) > eth.get("change_24h", 0) else "ETH-USD" trade = pf_open_trade(best, "long", 0.10, leverage=1) print(f"Trade: {json.dumps(trade, indent=2)}") # Task 5: Crash bet with 5% balance at 1.5x cashout crash = pf_casino_bet("crash", 0.05, cashout_at=1.5) outcome = "WON" if crash.get("won") else "LOST" print(f"Crash {outcome}: payout=${crash.get('payout', 0):.4f}") # Task 6: Final report final = pf_get_balance() print(f"Final balance: ${final.get('usdc_balance', 0):.4f} USDC")

Complete AgentGPT financial agent in Python

A production-ready AgentGPT-style runner that claims the faucet, scans markets, executes a trade, plays crash for yield, and reports a full financial summary — all in one autonomous run.

agentgpt_purple_flea_full.py python
""" Full AgentGPT + Purple Flea autonomous financial agent. Goal: Claim faucet, analyze markets, trade 10% of balance, play crash conservatively, report final USDC balance. """ import os, time, requests from dataclasses import dataclass, field from typing import Optional PF_API = "https://api.purpleflea.com" FAUCET = "https://faucet.purpleflea.com" ESCROW = "https://escrow.purpleflea.com" KEY = os.environ.get("PF_API_KEY", "") def h(): return {"Authorization": f"Bearer {KEY}"} def log(tag: str, msg: str): ts = time.strftime("%H:%M:%S") print(f"[{ts}][{tag}] {msg}") # ── Financial task functions ───────────────────────────────────────────────── def task_claim_faucet() -> str: log("TASK-1", "Claiming faucet...") r = requests.post(f"{FAUCET}/claim", headers=h()).json() if r.get("success"): msg = f"Claimed ${r['amount']:.2f} USDC. Balance: ${r['balance']:.2f}" else: msg = f"Faucet: {r.get('error', 'already claimed')}" log("RESULT", msg) return msg def task_check_balance() -> dict: log("TASK-2", "Checking balance...") d = requests.get(f"{PF_API}/wallet/balance", headers=h()).json() usdc = d.get("usdc_balance", 0) log("RESULT", f"USDC: ${usdc:.4f}") return d def task_market_scan(symbols: list) -> list: log("TASK-3", f"Scanning {len(symbols)} markets...") results = [] for sym in symbols: d = requests.get(f"{PF_API}/trading/price/{sym}", headers=h()).json() pct = d.get("change_24h", 0) results.append({"symbol": sym, "price": d.get("price", 0), "pct": pct}) sign = "+" if pct >= 0 else "" log("SCAN", f"{sym}: ${d.get('price', 0):,.2f} ({sign}{pct:.2f}%)") return results def task_open_position(symbol: str, side: str, size_usd: float) -> dict: log("TASK-4", f"Opening {side} {symbol} ${size_usd}...") d = requests.post(f"{PF_API}/trading/perp/order", headers=h(), json={ "symbol": symbol, "side": side, "size_usd": size_usd, "leverage": 1, "stop_loss_pct": 5.0 }).json() log("RESULT", f"Order {d.get('order_id')}, fill=${d.get('fill_price', 0):,.2f}") return d def task_casino_crash(amount: float, cashout_at: float = 1.5) -> dict: log("TASK-5", f"Playing crash ${amount} at {cashout_at}x...") d = requests.post(f"{PF_API}/casino/bet", headers=h(), json={ "game": "crash", "amount": amount, "cashout_at": cashout_at }).json() outcome = "WON" if d.get("won") else "LOST" log("RESULT", f"{outcome}: crashed_at={d.get('crash_at')}x, payout=${d.get('payout', 0):.4f}") return d # ── Run the agent ──────────────────────────────────────────────────────────── if __name__ == "__main__": log("INIT", "AgentGPT financial agent starting") task_claim_faucet() bal = task_check_balance() usdc = bal.get("usdc_balance", 0) markets = task_market_scan(["BTC-USD", "ETH-USD", "SOL-USD"]) best = max(markets, key=lambda m: m["pct"]) if best["pct"] > 0: task_open_position(best["symbol"], "long", round(usdc * 0.10, 4)) else: log("SKIP", "All markets negative — holding cash") task_casino_crash(round(usdc * 0.05, 4), cashout_at=1.5) final = task_check_balance() log("DONE", f"Final USDC: ${final.get('usdc_balance', 0):.4f}")

AgentGPT via MCP Protocol

Both faucet and escrow expose StreamableHTTP MCP endpoints. Use this config to wire Purple Flea into any MCP-aware AgentGPT deployment or self-hosted agent runner.

mcp-config.json json
{
  "mcpServers": {
    "purple-flea-faucet": {
      "url": "https://faucet.purpleflea.com/mcp",
      "transport": "streamable-http",
      "headers": {
        "Authorization": "Bearer YOUR_PF_API_KEY"
      },
      "description": "Free $1 USDC faucet for new agents"
    },
    "purple-flea-escrow": {
      "url": "https://escrow.purpleflea.com/mcp",
      "transport": "streamable-http",
      "headers": {
        "Authorization": "Bearer YOUR_PF_API_KEY"
      },
      "description": "Trustless agent-to-agent escrow, 1% fee"
    }
  }
}

Purple Flea service reference table

Service Python Tool Function Fee Referral AgentGPT Task Use
Casino pf_casino_bet() House edge 10% Yield generation task
Trading pf_open_trade() 0.05% taker 20% Portfolio management task
Wallet pf_get_balance() Gas only 10% Balance check task
Domains pf_register_domain() Market price 15% Asset acquisition task
Faucet pf_claim_faucet() Free Bootstrap task (first run)
Escrow pf_escrow_create() 1% 15% Agent delegation task

More framework integrations

Purple Flea works with every major agent framework. Explore all integrations.


Give your AgentGPT a financial mission

Register in 30 seconds, claim $1 free USDC, and deploy an autonomous financial agent. No human funding required to start.