CrewAI x402 Integration
CrewAI enables the creation of sophisticated multi-agent systems where AI agents work together in organized crews to accomplish complex tasks. Each agent has specific roles, goals, and tools, making it ideal for collaborative workflows. With built-in tool integration, CrewAI can incorporate x402 payment capabilities into multi-agent financial workflows.
⚡ x402 Integration Method
Integration Type: Tools Functions
CrewAI's tool system allows x402 payment tools to be assigned to specific agents, enabling collaborative financial operations within multi-agent workflows.
Setup Complexity
Maintenance
Documentation
Examples
Installation & Setup
Install the necessary packages to get started with x402 payments in CrewAI:
# Install the necessary packages pip install crewai crewai-openai x402-crewai
The x402-crewai package is a helper library that simplifies wrapping facilitators into CrewAI-compatible tools, bridging our facilitator ecosystem with your agent framework.
Integration Examples
x402 Payment Agent in CrewAI
Create a specialized payment agent within a CrewAI crew that handles x402 transactions for other agents
from crewai import Agent, Task, Crew
from crewai_tools import BaseTool
from x402_client import X402Client
class X402PaymentTool(BaseTool):
name: str = "x402_payment"
description: str = "Execute x402 payments"
def _run(self, amount: str, recipient: str) -> str:
client = X402Client()
result = client.send_payment(amount, recipient)
return f"Payment executed: {result.transaction_id}"
payment_agent = Agent(
role='Payment Specialist',
goal='Handle all financial transactions',
tools=[X402PaymentTool()],
backstory='Expert in secure payment processing'
)Prerequisites:
CrewAI installation
x402 client library
LLM API access
Choosing Your Facilitator
The X402PaymentTool is generic and works with any facilitator that has a compatible client. Here's how you might initialize different clients based on your specific needs:
For Enterprise (CDP)
from x402_facilitators import CDPClient client = CDPClient(api_key="...")
See the CDP Facilitator Guide for details.
For Zero Fees (Mogami)
from x402_facilitators import MogamiClient client = MogamiClient(wallet_pk="...")
See the Mogami Facilitator Guide for details.
For Developer Experience (thirdweb)
from x402_facilitators import ThirdwebClient client = ThirdwebClient(secret_key="...")
See the thirdweb Facilitator Guide for details.
Custom Setup
# Use any facilitator from our hub
from x402_facilitators import CustomClient
client = CustomClient(config={"..."})Browse all 8 facilitators in our hub.
Quick Info
Category
Multi-Agent Systems
Primary Language
Python
License
MIT
Latest Version
0.70.1
Community Stats
GitHub Stars
25,000
Weekly Downloads
180,000
Community Size
Large
Payment-Enabled Use Cases
Content creation and research teams
Financial analysis and reporting
Customer service workflows
Data processing pipelines
Marketing campaign management
Software development teams
Business process automation
Collaborative decision making
Strengths
Intuitive role-based agent design
Strong community and rapid growth
Clear separation of concerns
Good documentation and examples
Active development and updates
Production deployment examples
Flexible tool integration
Easy to understand concepts
Limitations
Relatively new framework
Python-only implementation
Limited enterprise features
Dependent on LLM API quality
Less mature than alternatives
Limited advanced orchestration
Memory management complexity
Debugging multi-agent interactions
Get the Complete Template
Access a complete, runnable repository with working CrewAI x402 integration examples, configuration templates, and step-by-step setup guides.
View on GitHub: CrewAI x402 TemplateReady to Build Payment-Enabled Agents?
Get started with our complete CrewAI x402 integration template. Includes working examples, facilitator configurations, and production-ready code.
