Integrations / CrewAI
CrewAI tools for phone calls, SMS, and email
A CrewAI crew reaches the outside world through custom tools. Wrap the Hail SDK once and every agent in the crew can text, email, or call on a real number.
01Install
Hail's SDK needs Python 3.11+.
pip install hail-sdk # .env HAIL_API_KEY="hl_live_9fa2..." pip install crewai
02Write the tool
CrewAI tools run sync, and the Hail SDK is async-only, so the tool bridges with asyncio.run. Consent stays explicit.
import asyncio
from crewai.tools import BaseTool
from hail import Client
class SendSms(BaseTool):
name: str = "send_sms"
description: str = "Text an opted-in recipient."
def _run(self, to: str, body: str) -> str:
async def go():
async with Client() as hail:
sms = await hail.sms.create(
to=to, body=body, recipient_consent=True,
)
return f"queued {sms['id']}"
return asyncio.run(go())03Hand it to the crew
Any agent with the tool can now text. The same pattern covers hail.emails.create and hail.calls.create.
from crewai import Agent
support = Agent(
role="Support agent",
goal="Resolve orders and confirm by SMS",
backstory="Handles order issues end to end.",
tools=[SendSms()],
)Questions
CrewAI tools are sync. Does the async Hail SDK still work?
Yes. Bridge with asyncio.run inside _run, as in the example. The SDK call itself stays async.
Can one crew share one Hail account?
Yes. One API key covers every agent and every channel. There is no seat pricing.
Ship it with a real number
Sign up, grab a key, and the examples above run as written. Pay per use, no subscription.
Get started →More frameworks
LangGraph · OpenAI Agents SDK · Vercel AI SDK · n8n · Claude