Import Purple Flea as a custom tool in Dify using a single OpenAPI schema URL. Your Dify AI agents gain crypto wallets, live perpetual trading, and provably fair casino games instantly.
About Dify
Dify.ai is an open-source LLM application development platform with a visual workflow builder at its core. Teams use Dify to compose RAG pipelines, chatbots, and autonomous AI agents without managing LLM infrastructure directly. Dify supports custom tools through its OpenAPI-compatible tool provider system — any API that publishes a valid OpenAPI 3.x specification can be imported and used by Dify agents in seconds.
Purple Flea publishes a complete, production-grade OpenAPI 3.1 schema at purpleflea.com/openapi. Paste that URL into Dify's custom tool import dialog and the full Purple Flea tool suite — wallets, trading, casino, domains, escrow, and faucet — appears immediately in Dify's tool palette, ready to be added to any workflow or agent.
Dify's custom tool system accepts an OpenAPI schema URL directly. Enter https://purpleflea.com/openapi, confirm the tool list, add your API key, and every Purple Flea endpoint becomes available to your agents. No code changes, no package installs.
Purple Flea is submitted to the Dify marketplace as a verified tool provider under the "Finance" category. If you are running Dify Cloud or a self-hosted instance with marketplace access enabled, you can install Purple Flea from the marketplace with a single click.
Dify stores your Purple Flea API key in its encrypted credential store. The key is injected as the X-PF-API-Key header on every outbound request. Your key is never exposed in workflow definitions or logs.
Purple Flea tools work in both Dify's Workflow mode (deterministic, node-based pipelines) and Agent mode (LLM-driven tool selection). In workflow mode you call specific tools explicitly; in agent mode the LLM decides which financial action to take based on context.
Dify supports streaming responses for LLM nodes. Purple Flea's API responses are compact JSON, so tool call latency is typically under 300ms — fast enough that streaming is never blocked waiting for a wallet balance or trade fill.
Dify supports multi-agent pipelines where separate agents handle different tasks. Run a Trading Agent and a Risk Manager Agent in parallel, each calling Purple Flea independently, coordinating through Dify's shared memory nodes.
Setup Guide
The full integration takes under two minutes. No local dependencies to install.
In your Dify instance (Cloud or self-hosted), go to the top navigation and select Tools. Click "Create Custom Tool" in the upper right.
Select "Import from URL" and paste the schema URL. Dify will fetch and parse the schema automatically.
After import, Dify will prompt you for the tool's authentication credential. Select "API Key" auth type, set the header name to X-PF-API-Key, and paste your Purple Flea API key.
Open any existing or new App in Dify. In the Tools panel, enable the Purple Flea tools you want available. In agent mode, the LLM will call them autonomously. In workflow mode, drag tool nodes onto the canvas and connect them explicitly.
In the Dify Playground, try a prompt like: "Check my BTC balance and place a 0.001 BTC long on BTC-PERP at market price." Watch the agent call getBalance and placeOrder in sequence.
Schema Detail
The full schema defines every endpoint, request/response shape, and authentication method. Dify renders tool descriptions from the summary and description fields — the LLM uses these to decide when to call each tool.
Each operation includes an x-dify-tool-description extension with a concise natural language description optimized for LLM reasoning. This ensures Dify agents route to the correct financial action even when the user's intent is expressed in casual language.
Tool Catalogue
Every Purple Flea capability is exposed as a discrete OpenAPI operation, discoverable by Dify's tool system.
All operations are available in both Dify's Workflow node palette and Agent tool selector. In Workflow mode, each operation maps to a dedicated node with typed input/output fields. In Agent mode, the LLM receives the full list of tool descriptions and selects operations autonomously based on the task at hand. Dify renders tool call history in its Conversation debug view, so you can see exactly which Purple Flea endpoints your agent called and with what parameters.
Referral Program
Every Purple Flea API key carries a referral code. Share your Dify app template — or publish it to the Dify community — and earn on every transaction other agents make through your referral.
Referral payouts are automatic and instantaneous — credited to your Purple Flea wallet balance as soon as a referred transaction settles. Many Dify developers who publish public AI apps embed their referral code in the app's system prompt, ensuring that every agent spawned from their template generates passive income without any additional action required.
Explore More
Purple Flea integrates across the full AI agent ecosystem. Find your framework below.