What Is Coze?

Coze (coze.com) is a no-code / low-code AI agent platform from ByteDance. It provides a visual workspace where you define an agent's persona, knowledge base, memory, and tools — then publish to multiple messaging platforms simultaneously. Under the hood, Coze handles OAuth handshakes, webhook infrastructure, rate limiting, and conversation state so you do not have to.

The killer feature for crypto builders is the plugin system. A Coze plugin is a JSON schema that describes a set of REST API endpoints. Once defined, the agent understands when to call which endpoint and how to parse the response into a human-readable reply. This maps perfectly to Purple Flea's REST API surface.

Coze platform deployment targets

  • Telegram — most popular for crypto communities; supports inline buttons
  • Discord — slash commands, embeds, role-based access control
  • WhatsApp — Business API; ideal for personal portfolio alerts
  • Slack — team / DAO treasury management workflows
  • Web widget — embeddable on any site (including purpleflea.com/mcp)
  • API — call your Coze bot from any backend via REST

Adding Purple Flea as a Coze Plugin

Navigate to Coze → Tools → Plugins → Create Plugin. Give it a name (PurpleFlea), then paste the API schema. Coze accepts OpenAPI 3.0 JSON or a simplified tool-manifest format. Below is the full manifest for Purple Flea's core endpoints:

{
  "schema_version": "v1",
  "name_for_human": "Purple Flea Finance",
  "name_for_model": "purple_flea",
  "description_for_human": "Crypto trading, wallets, casino games, faucet, and escrow for AI agents.",
  "description_for_model": "Call Purple Flea APIs to query wallet balances, execute spot/perp trades on 275 markets, play provably fair casino games, claim free USDC from the faucet, and create agent-to-agent escrow contracts.",
  "auth": {
    "type": "bearer",
    "verification_tokens": {}
  },
  "api": {
    "type": "openapi",
    "url": "https://purpleflea.com/api/v1/openapi.json"
  },
  "logo_url": "https://purpleflea.com/logo.png",
  "contact_email": "support@purpleflea.com",
  "legal_info_url": "https://purpleflea.com/terms"
}

Coze will fetch the OpenAPI spec from the URL and auto-populate the available actions. If you prefer to define actions manually, use Coze's Action editor:

// Action: get_wallet_balance
{
  "name": "get_wallet_balance",
  "description": "Get current balances for all supported chains: ETH, SOL, BTC, MATIC, BNB, XMR.",
  "parameters": {
    "type": "object",
    "properties": {
      "wallet_id": {
        "type": "string",
        "description": "The Purple Flea wallet identifier"
      }
    },
    "required": ["wallet_id"]
  },
  "endpoint": {
    "method": "GET",
    "url": "https://purpleflea.com/api/v1/wallet"
  }
}
// Action: place_order
{
  "name": "place_order",
  "description": "Place a spot or perpetual futures order.",
  "parameters": {
    "type": "object",
    "properties": {
      "market":  {"type": "string", "description": "e.g. ETH-USDC, BTC-USDC, SOL-USDC"},
      "side":    {"type": "string", "enum": ["buy", "sell"]},
      "size":    {"type": "number", "description": "Order size in base currency"},
      "type":    {"type": "string", "enum": ["market", "limit"]},
      "price":   {"type": "number", "description": "Required for limit orders only"}
    },
    "required": ["market", "side", "size", "type"]
  },
  "endpoint": {
    "method": "POST",
    "url": "https://purpleflea.com/api/v1/orders"
  }
}
// Action: claim_faucet
{
  "name": "claim_faucet",
  "description": "Claim free USDC from the Purple Flea faucet. Available once per agent.",
  "parameters": {
    "type": "object",
    "properties": {
      "wallet_id": {"type": "string"}
    },
    "required": ["wallet_id"]
  },
  "endpoint": {
    "method": "POST",
    "url": "https://purpleflea.com/api/v1/faucet/claim"
  }
}

Four Bot Templates

Template 1 — Price Alert Bot

The bot polls Purple Flea's GET /markets endpoint on a schedule (use Coze's Scheduled Task feature) and messages users when a market moves more than a configurable threshold.

System prompt snippet:

You monitor crypto prices on behalf of the user. When asked to set an alert,
store {market, threshold_pct, direction} in memory. On each scheduled check,
call get_market_price for each stored alert. If the threshold is crossed, send
a message: "ALERT: {market} is {direction} {pct}% in the last {period}."

Coze's Memory block stores alert configurations across sessions without a database. Users interact via: "Alert me when ETH drops 5%" — and the bot handles the rest.

Template 2 — Casino Game Bot

Expose Purple Flea's provably fair casino games over Telegram. Users place bets via natural language or inline buttons.

// Coze inline keyboard definition (Telegram)
{
  "keyboard": [
    [
      {"text": "Flip Heads 🪙", "callback": "coinflip heads"},
      {"text": "Flip Tails 🪙", "callback": "coinflip tails"}
    ],
    [
      {"text": "Crash (1.5x auto)", "callback": "crash 1.5"},
      {"text": "Crash (2.0x auto)", "callback": "crash 2.0"}
    ]
  ]
}

The bot system prompt maps each callback to a Purple Flea casino action. Bet size comes from the user's stored preference (default: 1 USDC). Results are formatted with win/loss emoji and a running session P&L.

Template 3 — Portfolio Tracker Bot

Daily portfolio snapshots delivered to a Telegram channel. The bot calls get_wallet_balance, fetches USD prices, computes 24h change, and formats a clean summary:

📊 Daily Portfolio — March 6 2026

  ETH   0.412  →  $1,041  (+2.1%)
  SOL  14.800  →  $2,146  (-0.8%)
  BTC   0.003  →    $198  (+1.4%)
  USDC 847.32  →    $847

  Total: $4,232  (+0.9% vs yesterday)
  Open PnL: +$82 (3 positions)

Powered by purpleflea.com

Template 4 — DCA Bot

Dollar-cost averaging on a weekly schedule. The bot stores the DCA configuration (asset, amount, frequency) in Coze memory and executes purchases via place_order at each interval.

User: "Buy $20 of SOL every Monday at 9am UTC"

Bot stores:
{
  "strategy": "dca",
  "asset": "SOL",
  "amount_usd": 20,
  "schedule": "weekly_monday_0900_utc",
  "wallet_id": "wlt_user123"
}

On trigger: calls place_order {market:"SOL-USDC", side:"buy",
             size: 20/current_price, type:"market"}
Then confirms: "Bought 0.138 SOL at $144.92. DCA streak: 6 weeks."

Publishing Workflow

Step 1
Create Bot

New Bot → paste system prompt → add PurpleFlea plugin → add memory blocks for user preferences.

Step 2
Test in Studio

Use Coze's preview chat to verify each action fires correctly. Check that API keys are passed in headers.

Step 3
Publish Channel

Bot Settings → Publish → select Telegram. Paste BotFather token. Click Deploy.

Step 4
Connect to Group

Add the bot to your Telegram group as admin. Set slash command hints via BotFather.

Securing API Keys in Coze

Never hardcode your Purple Flea API key in a system prompt — Coze logs are accessible to workspace collaborators. Instead:

  1. Go to Coze → Settings → Secrets and add PURPLE_FLEA_API_KEY.
  2. In the Plugin auth config, reference it as {{secrets.PURPLE_FLEA_API_KEY}}.
  3. Coze injects the value at runtime without exposing it in conversation logs.

For multi-user bots (where each user has their own Purple Flea account), store per-user wallet IDs in Coze's User Memory block. The bot can retrieve them at the start of each conversation without re-asking.

Free tier limits. Coze's free tier supports up to 100 messages/day per bot across all channels. For production trading bots, upgrade to Coze Pro or run multiple bot instances per template. Purple Flea's faucet is a great way to fund a dedicated bot wallet without connecting personal funds.

Advanced: Chaining Bots via Escrow

Coze supports multi-agent workflows where one bot can invoke another. A practical pattern for Purple Flea:

  • Signal Bot — monitors social and on-chain signals, publishes trade recommendations
  • Execution Bot — listens to Signal Bot, places orders, manages positions
  • Escrow Bot — when Signal Bot charges for premium signals (via Purple Flea Escrow), it creates an escrow contract, receives payment confirmation, then releases the signal

This creates a trust-minimised marketplace where signal sellers receive payment only when buyers confirm signal delivery — all orchestrated through Coze's multi-agent routing and Purple Flea's 1% escrow fee structure with 15% referral commission.

Next Steps

Get started at coze.com and purpleflea.com/api-keys. The full Purple Flea OpenAPI spec is at purpleflea.com/api/v1/openapi.json — paste the URL into Coze's plugin importer for instant setup. All six Purple Flea products (Casino, Trading, Wallet, Domains, Faucet, Escrow) are available as plugin actions.