Composio Integration

Purple Flea for Composio

Add crypto wallets, on-chain trading, provably fair casino, Web3 domains, agent faucet, and trustless escrow to any AI agent framework through Composio — one integration, every agent.

Get Free API Key → Open Composio →

What Is Composio?

Composio is a tool management platform that lets you connect external APIs to AI agents without writing integration code. Think of it as an app store for agent capabilities.

🔌
Framework Agnostic
Composio actions work with LangChain, CrewAI, AutoGen, OpenAI Assistants, Claude, GPT-4o, Gemini, and any framework that supports function calling or tool use.
🔐
Managed Authentication
Composio handles OAuth, API keys, and credential rotation. Your agents never store secrets — they call authenticated tools through the Composio proxy.
📦
300+ Pre-Built Actions
Composio ships with actions for GitHub, Slack, Notion, Jira, and now Purple Flea — all available to any agent with a single import.
One-Line Tool Registration
Register Purple Flea tools with a single Composio API call. No custom BaseTool classes, no schema writing, no adapter boilerplate.

Purple Flea Actions on Composio

Six complete crypto product categories, each with multiple actions. Your agents get a full financial stack, not just a single API.

💼
Crypto Wallet
Create BIP-39 HD wallets, check balances, send transactions, and receive payments across Bitcoin, Ethereum, Solana, Tron, BNB Chain, and Polygon.
📈
Perpetual Trading
Open and close perpetual futures positions on 275+ markets via Hyperliquid. Market, limit, stop-loss, take-profit — all from a single action call.
🎰
Casino Games
Provably fair dice, roulette, blackjack, and slots with on-chain RNG verification. Your agent can play, prove fairness, and track winnings.
🌐
Domain Registration
Register .com, .io, .ai, and 500+ TLDs with crypto. DNS management, WHOIS privacy, and multi-year registration — all via action calls.
🚰
Agent Faucet
New agents claim a free crypto balance to bootstrap their first transactions. No proof-of-work, no captcha — just register and receive.
🤝
Trustless Escrow
Agent-to-agent escrow for service payments. Funds lock on acceptance, release on delivery confirmation, or auto-refund after timeout. 1% fee, 15% referral.

Quickstart with Composio

Install Composio, connect Purple Flea, and add tools to your agent in under 5 minutes.

Step 1 — Install

# Install Composio + your agent framework pip install composio-langchain # or composio-crewai, composio-openai, etc. # Login to Composio composio login

Step 2 — Connect Purple Flea

# Add your Purple Flea API key composio add purpleflea # Enter API key when prompted # Find your key at purpleflea.com/quick-register

Step 3 — LangChain Example

from composio_langchain import ComposioToolSet, Action from langchain.agents import AgentExecutor, create_openai_functions_agent from langchain_openai import ChatOpenAI toolset = ComposioToolSet() tools = toolset.get_tools(actions=[ Action.PURPLEFLEA_GET_WALLET_BALANCE, Action.PURPLEFLEA_SEND_CRYPTO, Action.PURPLEFLEA_OPEN_TRADE, Action.PURPLEFLEA_PLAY_DICE, Action.PURPLEFLEA_REGISTER_DOMAIN, Action.PURPLEFLEA_CREATE_ESCROW, ]) llm = ChatOpenAI(model="gpt-4o") agent = create_openai_functions_agent(llm, tools, prompt) executor = AgentExecutor(agent=agent, tools=tools) result = executor.invoke({ "input": "Check my ETH balance and send 0.01 ETH to vitalik.eth" })

Step 4 — CrewAI Example

from composio_crewai import ComposioToolSet, Action from crewai import Agent, Task, Crew toolset = ComposioToolSet() tools = toolset.get_tools(actions=[ Action.PURPLEFLEA_GET_MARKET_PRICE, Action.PURPLEFLEA_OPEN_TRADE, Action.PURPLEFLEA_CLOSE_TRADE, ]) trader = Agent( role="Autonomous Crypto Trader", goal="Profit from BTC perpetual futures", backstory="Expert in technical analysis and risk management", tools=tools, verbose=True ) task = Task( description="Analyze BTC market and open a position if bullish signal", agent=trader ) crew = Crew(agents=[trader], tasks=[task]) crew.kickoff()

Why Composio + Purple Flea?

Using Composio to integrate Purple Flea gives you advantages that raw REST API calls can't match.

🛡️
Credential Security
API keys live in Composio's secure vault, never in your agent's context window or environment variables. Rotate credentials without redeploying agents.
🔄
Consistent Schema
Composio normalizes Purple Flea's REST responses into typed schemas. The LLM always receives clean, structured outputs — no JSON parsing failures.
🎯
Fewer Hallucinations
Well-defined action schemas with parameter validation reduce the surface area for LLM hallucinations. Actions fail fast with clear error messages instead of silent bugs.
📊
Observability
Composio logs every action call, parameter, and result. Debug agent trading strategies, replay failed casino bets, or audit escrow workflows.
⚙️
Multi-Agent Coordination
Multiple agents can share a single Composio integration. Spawn specialist sub-agents for trading, gambling, or payment tasks without duplicating auth logic.
💰
20% Referral Revenue
Agents that refer other users to Purple Flea earn 20% of their referral's fees. Build referral workflows into your Composio action graph.

Action Reference

All available Purple Flea actions in Composio with their parameters and return types.

Action Description Key Parameters Returns
PURPLEFLEA_GET_WALLET_BALANCECheck balance across all chainschain (optional)balances object
PURPLEFLEA_SEND_CRYPTOSend on-chain transactionchain, to, amount, tokentx_hash
PURPLEFLEA_GET_RECEIVE_ADDRESSGet deposit addresschainaddress string
PURPLEFLEA_GET_MARKET_PRICEGet current price for any symbolsymbol (e.g. "BTC")price, 24h_change
PURPLEFLEA_OPEN_TRADEOpen perpetual futures positionsymbol, side, size, leverageposition_id
PURPLEFLEA_CLOSE_TRADEClose open positionposition_idpnl, close_price
PURPLEFLEA_PLAY_DICEPlay provably fair dicebet_amount, target, over_underresult, payout
PURPLEFLEA_PLAY_ROULETTESpin the roulette wheelbet_amount, bet_type, bet_valuenumber, color, payout
PURPLEFLEA_REGISTER_DOMAINRegister Web2/Web3 domaindomain, yearsregistration_id
PURPLEFLEA_CREATE_ESCROWCreate escrow contractamount, counterparty, descriptionescrow_id
PURPLEFLEA_RELEASE_ESCROWRelease funds to payeeescrow_idtx_hash
PURPLEFLEA_CLAIM_FAUCETClaim free startup balance(none required)amount, tx_hash

Frequently Asked Questions

Do I need a separate Composio subscription?
Composio has a generous free tier. You need a Composio account (free) and a Purple Flea API key (free to register). Fees only apply when your agents make trades or casino bets.
Can I use Purple Flea directly without Composio?
Yes — Purple Flea has native packages for LangChain, CrewAI, and MCP servers for Claude. Composio is one of several integration paths.
Are transactions real on mainnet?
Yes. Purple Flea operates on mainnet. New agents can claim a free balance from the faucet to test risk-free before committing real funds.
What chains does the wallet action support?
Bitcoin, Ethereum, Solana, Tron, BNB Chain, and Polygon. The same wallet API supports all six chains with unified action parameters.
How does the escrow action work in a multi-agent system?
Agent A calls PURPLEFLEA_CREATE_ESCROW with a counterparty address and amount. The funds lock. Agent B delivers the service and calls PURPLEFLEA_RELEASE_ESCROW. Trustless, no intermediary.

Start Building in Minutes

Get a free Purple Flea API key, connect it to Composio, and give your agents a complete crypto financial stack today.