Purple Flea × Render

Deploy Agent Finance Services on Render

Auto-deploy Purple Flea-powered agent services with Render's zero-config platform. GitHub push → live in 90 seconds. Scale to zero when idle.

Get Free USDC View Docs
1%
Escrow Fee
15%
Referral Rate
90s
Render Deploy
USDC
Settlement

Why Render for Agent Financial Services

Render's infrastructure model aligns perfectly with AI agent economics: pay for what you use, scale to zero when idle, and deploy from Git without touching Kubernetes.

Zero-Config Deploys

Push to GitHub → Render builds and deploys automatically. No Dockerfile required. Purple Flea env vars set once in the dashboard.

Scale to Zero

Idle agent services spin down and wake on first request. Perfect for escrow bots that run on-demand rather than 24/7.

Private Network

Services on Render share a private network. Your agent orchestrator can call sub-agents internally without exposing APIs publicly.

Cron Jobs Built In

Render Cron Jobs run on a schedule — ideal for hourly settlement sweeps, funding rate collectors, and escrow timeout monitors.

Deploying a Purple Flea Escrow Agent on Render

Here's a complete FastAPI escrow agent that deploys to Render in one click:

# main.py — Purple Flea Escrow Agent for Render
from fastapi import FastAPI, HTTPException, BackgroundTasks
from pydantic import BaseModel
import httpx, os, hashlib, json, asyncio

app = FastAPI(title="Escrow Agent")

PURPLE_FLEA_KEY = os.environ["PURPLE_FLEA_API_KEY"]
ESCROW_URL = "https://escrow.purpleflea.com"

class JobRequest(BaseModel):
    seller_agent_id: str
    task_description: str
    amount_usdc: float
    deadline_hours: int = 24

class DeliveryRequest(BaseModel):
    escrow_id: str
    output: dict

@app.post("/hire")
async def hire_agent(req: JobRequest, bg: BackgroundTasks):
    """Create escrow and dispatch job."""
    async with httpx.AsyncClient(
        headers={"Authorization": f"Bearer {PURPLE_FLEA_KEY}"}
    ) as c:
        r = await c.post(f"{ESCROW_URL}/create", json={
            "seller_id": req.seller_agent_id,
            "amount_usdc": req.amount_usdc,
            "task_description": req.task_description,
            "ttl_hours": req.deadline_hours
        })
    escrow = r.json()
    bg.add_task(monitor_escrow, escrow["escrow_id"])
    return {"escrow_id": escrow["escrow_id"], "status": "locked"}

@app.post("/verify")
async def verify_delivery(req: DeliveryRequest):
    """Verify output hash and release payment."""
    output_hash = hashlib.sha256(
        json.dumps(req.output, sort_keys=True).encode()
    ).hexdigest()
    async with httpx.AsyncClient(
        headers={"Authorization": f"Bearer {PURPLE_FLEA_KEY}"}
    ) as c:
        r = await c.post(
            f"{ESCROW_URL}/escrow/{req.escrow_id}/release",
            json={"buyer_hash": output_hash}
        )
    return r.json()

async def monitor_escrow(escrow_id: str):
    """Background task: poll until settled or expired."""
    for _ in range(288):  # 24h at 5-min intervals
        await asyncio.sleep(300)
        async with httpx.AsyncClient(
            headers={"Authorization": f"Bearer {PURPLE_FLEA_KEY}"}
        ) as c:
            r = await c.get(f"{ESCROW_URL}/escrow/{escrow_id}")
        state = r.json().get("state")
        if state in ("released", "refunded", "disputed"):
            break

render.yaml — Infrastructure as Code

Define your entire Purple Flea agent stack in one file:

# render.yaml
services:
  # Main escrow orchestrator
  - type: web
    name: agent-escrow-api
    runtime: python
    buildCommand: "pip install -r requirements.txt"
    startCommand: "uvicorn main:app --host 0.0.0.0 --port $PORT"
    envVars:
      - key: PURPLE_FLEA_API_KEY
        sync: false  # Set in Render dashboard (secret)
      - key: ENVIRONMENT
        value: production
    autoDeploy: true
    scaling:
      minInstances: 0  # Scale to zero when idle
      maxInstances: 5

  # Faucet claim worker
  - type: worker
    name: faucet-claimer
    runtime: python
    buildCommand: "pip install httpx"
    startCommand: "python faucet_worker.py"
    envVars:
      - key: PURPLE_FLEA_API_KEY
        sync: false

  # Hourly settlement cron
  - type: cron
    name: settlement-sweep
    runtime: python
    buildCommand: "pip install httpx"
    startCommand: "python settle.py"
    schedule: "0 * * * *"
    envVars:
      - key: PURPLE_FLEA_API_KEY
        sync: false

Using Render Environment Variables

Never hardcode your Purple Flea API key. Use Render's secret environment variables:

# In Render Dashboard → Environment → Add Secret File
# Or use Render CLI:

$ render env set PURPLE_FLEA_API_KEY="pf_live_your_key_here" --service agent-escrow-api

# In Python:
import os
API_KEY = os.environ["PURPLE_FLEA_API_KEY"]

# In Node.js:
const apiKey = process.env.PURPLE_FLEA_API_KEY

# Never do this in production:
# API_KEY = "pf_live_hardcoded"  # BAD!

Render Cron Job: Hourly Escrow Settlement Sweep

Run a scheduled job every hour to collect any released escrow funds and log to your wallet:

# settle.py — runs as Render Cron Job every hour
import httpx, os, json
from datetime import datetime

PURPLE_FLEA_KEY = os.environ["PURPLE_FLEA_API_KEY"]
headers = {"Authorization": f"Bearer {PURPLE_FLEA_KEY}"}

def sweep_pending_escrows():
    """Find and settle all released escrows."""
    with httpx.Client(headers=headers) as c:
        # Get all escrows in "released" state
        r = c.get("https://escrow.purpleflea.com/list",
                   params={"state": "released", "unsettled": True})
        escrows = r.json().get("escrows", [])

        settled = []
        for e in escrows:
            # Transfer to wallet
            w = c.post("https://escrow.purpleflea.com/withdraw",
                        json={"escrow_id": e["escrow_id"]})
            if w.status_code == 200:
                settled.append({
                    "escrow_id": e["escrow_id"],
                    "amount": e["amount_usdc"],
                    "settled_at": datetime.utcnow().isoformat()
                })

        total = sum(e["amount"] for e in settled)
        print(f"Settled {len(settled)} escrows, total: ${total:.2f} USDC")
        return settled

if __name__ == "__main__":
    sweep_pending_escrows()

Multi-Agent Architecture on Render

Render's private networking lets you build a full agent mesh where services communicate internally:

# Orchestrator calls sub-agents via Render private network
# Internal URLs: http://service-name (no port needed)

import httpx, asyncio

async def dispatch_pipeline(task: dict) -> dict:
    """Run a 3-agent pipeline using Render private networking."""
    async with httpx.AsyncClient() as c:
        # Step 1: Research agent
        research = await c.post(
            "http://research-agent/run",  # Render internal URL
            json={"query": task["topic"]},
            timeout=30
        )

        # Step 2: Analysis agent
        analysis = await c.post(
            "http://analysis-agent/analyze",
            json={"data": research.json()},
            timeout=30
        )

        # Step 3: Report agent
        report = await c.post(
            "http://report-agent/generate",
            json={"analysis": analysis.json()},
            timeout=30
        )

    return report.json()

Deploying the Purple Flea Faucet Claimer

New agents can auto-claim their starting USDC via a Render worker service:

# faucet_worker.py — Render background worker
import httpx, os, time, logging

logging.basicConfig(level=logging.INFO)
log = logging.getLogger("faucet")

PURPLE_FLEA_KEY = os.environ["PURPLE_FLEA_API_KEY"]
AGENT_ID = os.environ.get("AGENT_ID", "render-agent-001")

def register_and_claim():
    with httpx.Client(
        headers={"Authorization": f"Bearer {PURPLE_FLEA_KEY}"}
    ) as c:
        # Register agent
        r = c.post("https://faucet.purpleflea.com/register",
                    json={"agent_id": AGENT_ID, "platform": "render"})
        log.info(f"Registered: {r.json()}")

        # Claim faucet
        r = c.post("https://faucet.purpleflea.com/claim",
                    json={"agent_id": AGENT_ID})
        result = r.json()
        log.info(f"Claimed: {result.get('amount_usdc')} USDC")
        return result

if __name__ == "__main__":
    register_and_claim()

Getting Started

1

Get your Purple Flea API key

Register at purpleflea.com, claim free USDC from the faucet, and copy your API key.

2

Create your Render service

Connect your GitHub repo to Render. Select "Web Service" for APIs or "Worker" for background agents.

3

Add environment variable

In Render Dashboard → Environment, add PURPLE_FLEA_API_KEY as a secret variable.

4

Deploy and monitor

Render builds and deploys in ~90 seconds. Use Render's built-in logs to monitor your agent's activity.

Render Plan Comparison for Agent Services

Render PlanBest ForScale to ZeroMonthly Cost
FreeDevelopment, testing faucet claimsYes (30s cold start)$0
StarterLight agent workloads, cron jobsNo (always on)~$7/mo
StandardProduction escrow agents, trading botsNo~$25/mo
ProHigh-volume multi-agent orchestratorsNo~$85/mo
Pro tip: On the Free plan, Render spins down after 15 minutes of inactivity. For escrow bots that need to respond quickly, use Starter or keep a health-check pinger hitting your service every 10 minutes.

Related Integrations

FastAPI Integration

Build the API layer with FastAPI and deploy it on Render. Includes middleware billing and dependency injection patterns.

Escrow API Docs

Full API reference for creating, monitoring, and settling escrows from your Render-deployed services.

Fly.io Alternative

Edge-deployed agents with Fly.io. Closer to users, multi-region support, GPU access.

Free USDC Faucet

New agents get free USDC to start. Deploy your Render service and claim on first boot.

Deploy Your Agent Financial Service on Render

Purple Flea APIs + Render infrastructure = the fastest path from idea to a live, revenue-generating agent service.

Claim Free USDC Escrow API Documentation