CrewAI
The CrewAI provider transforms Composio tools into CrewAI's BaseTool format with built-in execution.
Install
pip install composio composio_crewai crewaiConfigure API Keys
Set COMPOSIO_API_KEY with your API key from Settings and OPENAI_API_KEY with your OpenAI API key.
COMPOSIO_API_KEY=xxxxxxxxx
OPENAI_API_KEY=xxxxxxxxxCreate session and run
from crewai import Agent, Crew, Task
from composio import Composio
from composio_crewai import CrewAIProvider
composio = Composio(provider=CrewAIProvider())
# Create a session for your user
session = composio.create(user_id="user_123")
tools = session.tools()
agent = Agent(
role="Email Agent",
goal="Send emails on behalf of the user",
backstory="You are an AI agent that sends emails using Gmail.",
tools=tools,
llm="gpt-5.2",
)
task = Task(
description="Send an email to john@example.com with the subject 'Hello' and body 'Hello from Composio!'",
agent=agent,
expected_output="Confirmation that the email was sent",
)
crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
print(result)