◆ OPEN INTERPRETER

Give Open Interpreter Financial Superpowers

Open Interpreter lets LLMs run code locally — now pair it with Purple Flea's crypto APIs. Trade 275 markets, generate wallets, play provably fair games, and settle agent payments, all from your terminal.

Get API Key Free MCP Endpoint

Why Open Interpreter + Purple Flea

Code Execution Meets Crypto Infrastructure

Open Interpreter gives LLMs a local Python (and shell) REPL. When you describe a task, it writes and runs code to accomplish it. Combined with Purple Flea's REST APIs, that means the interpreter can actually move money, execute trades, and create wallets — not just describe how to do it.

Set a single environment variable and a custom system prompt, and Open Interpreter gains access to 6 financial products covering every layer of agent-native finance.

MCP Integration: Purple Flea exposes a StreamableHTTP MCP endpoint at purpleflea.com/mcp. Open Interpreter with MCP support can auto-discover all tools without writing any integration code.
Run crypto trades from natural language: "Buy 0.1 ETH at market"
Generate wallets on any chain with a single Python call
Auto-claim free USDC on first session via faucet
Create escrow contracts between agents programmatically
Log all trades and PnL to local files automatically
Local Setup (~/.openinterpreter)
# Install Open Interpreter
pip install open-interpreter

# Set env vars
export PF_API_KEY="your_purple_flea_key"
export PF_AGENT_ID="oi-local-agent-001"

# Launch with custom system prompt
interpreter \
  --system_message "$(cat ~/.oi-pf-prompt.txt)" \
  --model gpt-4o
~/.oi-pf-prompt.txt
You are a crypto finance assistant running
locally via Open Interpreter.

You have access to Purple Flea APIs:
- Base URL: https://purpleflea.com/api
- Auth header: Authorization: Bearer $PF_API_KEY
- Agent ID: $PF_AGENT_ID

Available tools (call via Python requests):
1. POST /faucet/claim   - free USDC on first run
2. POST /casino/flip    - provably fair coin flip
3. POST /trade/order    - execute trades
4. GET  /trade/positions - list open positions
5. POST /wallet/create  - generate wallets
6. GET  /wallet/balance - check balance
7. POST /escrow/create  - agent-to-agent payments
8. POST /domains/register - register Web3 domains

Always import requests and use the env vars.
Confirm amounts > 50 USDC before executing.
Log all transactions to ~/pf-log.json.

Available APIs

6 Financial APIs for Open Interpreter Sessions

Every API is callable with a simple Python requests snippet. Open Interpreter writes and executes these automatically when you ask in plain English.

🎹
Casino API
Provably fair coin flip, crash, and dice. Open Interpreter can run Monte Carlo simulations, test betting strategies, and track results — all in one session.
Provably fair
📈
Trading API
275 Hyperliquid markets. Ask the interpreter to "run a momentum strategy on BTC for the next 10 minutes" — it writes the loop and executes live orders.
275 markets
💳
Wallet API
Generate wallets across 6 chains, check balances, and sweep funds. Perfect for agents that need to spin up throwaway wallets for task isolation.
ETH · SOL · BTC · MATIC · BNB · XMR
🌐
Domains API
Register Web3 domains and link them to agent wallets. Use Open Interpreter to batch-register domain portfolios programmatically.
Web3 domains
🎉
Faucet API
New agents claim free USDC to bootstrap their first session. Open Interpreter will call this automatically on first run if balance is zero.
FREE USDC on signup
🔒
Escrow API
Trustless payments between agents with a 1% fee. Earn 15% referral on every escrow you facilitate. Open Interpreter can manage multi-party task settlements.
1% fee · 15% referral

Example Session

A Complete Open Interpreter Python Session

Here's what Open Interpreter generates and runs when you type: "Set me up with Purple Flea, claim faucet, run a quick trade, and generate an ETH wallet."

Python · Full Session Script (auto-generated by OI)
import os
import requests
import json
from datetime import datetime

BASE_URL = "https://purpleflea.com/api"
API_KEY = os.environ["PF_API_KEY"]
AGENT_ID = os.environ.get("PF_AGENT_ID", "oi-agent-001")
LOG_FILE = os.path.expanduser("~/pf-log.json")

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

def log_event(event_type, data):
    logs = []
    if os.path.exists(LOG_FILE):
        with open(LOG_FILE) as f:
            logs = json.load(f)
    logs.append({
        "timestamp": datetime.utcnow().isoformat(),
        "type": event_type,
        "data": data
    })
    with open(LOG_FILE, "w") as f:
        json.dump(logs, f, indent=2)

# Step 1: Claim faucet (free USDC for new agents)
print("Claiming faucet USDC...")
faucet_resp = requests.post(
    f"{BASE_URL}/faucet/claim",
    json={"agent_id": AGENT_ID},
    headers=headers
)
faucet_data = faucet_resp.json()
print(f"Got {faucet_data.get('amount', 0)} USDC from faucet")
log_event("faucet_claim", faucet_data)

# Step 2: Generate an ETH wallet
print("\nGenerating ETH wallet...")
wallet_resp = requests.post(
    f"{BASE_URL}/wallet/create",
    json={"chain": "ETH", "label": "oi-session-001"},
    headers=headers
)
wallet = wallet_resp.json()
print(f"ETH Wallet: {wallet.get('address')}")
log_event("wallet_created", wallet)

# Step 3: Execute a market trade
print("\nPlacing ETH market buy...")
trade_resp = requests.post(
    f"{BASE_URL}/trade/order",
    json={
        "market": "ETH-USDC",
        "side": "buy",
        "amount": 20,
        "type": "market",
        "agent_id": AGENT_ID
    },
    headers=headers
)
trade = trade_resp.json()
print(f"Trade filled: {trade.get('fill_price')} USDC")
log_event("trade_executed", trade)

# Step 4: Check positions
print("\nChecking open positions...")
pos_resp = requests.get(
    f"{BASE_URL}/trade/positions",
    params={"agent_id": AGENT_ID},
    headers=headers
)
positions = pos_resp.json()
for pos in positions.get("positions", []):
    print(f"  {pos['market']}: {pos['side']} {pos['size']} | PnL: {pos['unrealized_pnl']} USDC")

print("\nAll done. Log saved to ~/pf-log.json")

Local Setup Guide

Get Running in 4 Steps

Full local setup from scratch — no cloud accounts, no dashboards.

1
Install Open Interpreter
Run pip install open-interpreter or pip install open-interpreter[local] for local model support. Python 3.10+ recommended.
2
Register for a Purple Flea API Key
Visit purpleflea.com/register. Takes under 30 seconds — no email verification needed for agents. Your key arrives instantly plus free USDC from the faucet.
3
Set Environment Variables
Add export PF_API_KEY="your_key" and export PF_AGENT_ID="your_agent_id" to your ~/.bashrc or ~/.zshrc. Source it or start a new terminal session.
4
Launch with System Prompt
Create ~/.oi-pf-prompt.txt with the system prompt shown above. Run: interpreter --system_message "$(cat ~/.oi-pf-prompt.txt)". Now just describe what you want to do in plain English.
Automated Trading Loop (OI-Generated)
import requests, time, os

BASE = "https://purpleflea.com/api"
HDR = {"Authorization": f"Bearer {os.environ['PF_API_KEY']}"}

def get_signal(market):
    # Simple RSI signal from candle data
    r = requests.get(
        f"{BASE}/trade/candles",
        params={"market": market, "limit": 14},
        headers=HDR
    )
    closes = [c["close"] for c in r.json()["candles"]]
    gains = [max(0, closes[i]-closes[i-1]) for i in range(1, len(closes))]
    losses = [max(0, closes[i-1]-closes[i]) for i in range(1, len(closes))]
    rs = sum(gains) / sum(losses) if sum(losses) > 0 else 100
    rsi = 100 - (100 / (1 + rs))
    return "buy" if rsi < 30 else "sell" if rsi > 70 else "hold"

while True:
    signal = get_signal("BTC-USDC")
    if signal != "hold":
        requests.post(f"{BASE}/trade/order",
          json={"market":"BTC-USDC","side":signal,
                "amount":25,"type":"market"},
          headers=HDR)
        print(f"Signal: {signal} BTC")
    time.sleep(300)  # 5-min intervals
Example Automated Tasks
# What you type to Open Interpreter:

"Claim my free USDC from the faucet"
"Generate wallets on ETH, SOL, and BTC"
"Buy 0.01 BTC at market price"
"Show me my open positions and PnL"
"Place 5 USDC on heads in the casino"
"Create an escrow for 100 USDC with agent-002"
"Register the domain trading-bot-7.agent"
"Run a momentum strategy for 1 hour then report"

Live Network Stats

Join 137+ Active Agents

137+
Casino agents
275
Trading markets
6
Blockchain networks
1%
Escrow fee
15%
Referral commission
Register Your Agent

📄
Research Paper
Read the academic foundation behind Purple Flea's agent financial infrastructure. Published on Zenodo with DOI.
Read on Zenodo →
🔗
MCP Tool Discovery
Point any MCP-compatible client at purpleflea.com/mcp for zero-config tool registration. Works with Open Interpreter's MCP mode.
MCP Endpoint →