Extend your IBM watsonx AI agents with a complete financial toolkit: crypto wallets, perpetual futures trading, provably fair casino, and trustless escrow — all via watsonx.ai function calling.
IBM watsonx.ai supports OpenAI-compatible function calling through its InferenceClient. Purple Flea exposes all its operations as JSON function schemas — identical to the OpenAI tool format — so integration requires minimal code changes.
watsonx.ai's InferenceClient accepts the same tools parameter format as the OpenAI SDK. Purple Flea's tool schemas drop in directly with zero modification.
Purple Flea API keys support IP allowlisting, spending limits, and audit log exports — compatible with enterprise security requirements for watsonx deployments.
For watsonx deployments on IBM Cloud Pak, Purple Flea API calls route through standard HTTPS — no VPC peering or special networking required.
pip install ibm-watsonx-ai purpleflea
You need an IBM Cloud API key + watsonx project ID, plus a Purple Flea API key from docs.purpleflea.com.
# .env WATSONX_API_KEY="ibm_api_key_here" WATSONX_PROJECT_ID="your_project_id" PURPLE_FLEA_API_KEY="pf_live_..."
import purpleflea as pf # Purple Flea provides pre-built tool schemas in watsonx/OpenAI format tools = pf.get_tool_schemas(format="openai") # Or define specific tools manually: tools = [ { "type": "function", "function": { "name": "open_trading_position", "description": "Open a long or short perpetual futures position. 275 markets available.", "parameters": { "type": "object", "properties": { "symbol": {"type": "string", "description": "e.g. BTC-USD, ETH-USD"}, "side": {"type": "string", "enum": ["long", "short"]}, "size_usd": {"type": "number"}, "leverage": {"type": "integer", "minimum": 1, "maximum": 50} }, "required": ["symbol", "side", "size_usd"] } } } ]
import json, os from ibm_watsonx_ai import Credentials from ibm_watsonx_ai.foundation_models import ModelInference import purpleflea as pf credentials = Credentials( url="https://us-south.ml.cloud.ibm.com", api_key=os.environ["WATSONX_API_KEY"] ) pf_client = pf.Client(os.environ["PURPLE_FLEA_API_KEY"]) model = ModelInference( model_id="meta-llama/llama-3-3-70b-instruct", credentials=credentials, project_id=os.environ["WATSONX_PROJECT_ID"], params={"max_new_tokens": 1024} ) messages = [{"role": "user", "content": "Create a new wallet and check my ETH balance"}] while True: response = model.chat(messages=messages, tools=tools, tool_choice="auto") msg = response["choices"][0]["message"] messages.append(msg) if not msg.get("tool_calls"): print("Agent:", msg["content"]) break for tc in msg["tool_calls"]: fn_name = tc["function"]["name"] args = json.loads(tc["function"]["arguments"]) result = pf_client.call(fn_name, **args) messages.append({ "role": "tool", "tool_call_id": tc["id"], "content": json.dumps(result) })
Deploy Purple Flea tools in your watsonx applications and earn recurring commission on everything your agents do.
| Product | Your Commission |
|---|---|
| Trading API (275 perp markets) | 20% of fees |
| Casino API (dice, slots, crash) | 10% of house edge |
| Wallet API (6+ chains) | 10% of fees |
| Escrow API (agent payments) | 15% of 1% fee |
| Domain Registration API | 10% of registration |
One API key unlocks wallets, 275 trading markets, casino, escrow, and domains for your IBM watsonx agents.