from anima import Anima
anima = Anima(api_key="ak_...")
agent_id = "AGENT_ID"
your_phone = "+15551234567"
# 1. Provision a phone number for SMS and voice.
phone = anima.phones.provision(
agent_id=agent_id,
country_code="US",
capabilities=["voice", "sms"],
)
print(f"Phone: {phone.phone_number}")
# 2. Text yourself first. This proves the number is real and reachable.
sms = anima.messages.send_sms(
agent_id=agent_id,
to=your_phone,
body="Hi - this is my Anima agent texting before it calls.",
)
print(f"SMS sent: {sms.id} ({sms.status})")
# 3. Confirm the voice catalog is available for your tier.
voices = anima.voices.list(tier="basic")
print(f"Available basic voices: {len(voices['voices'])}")
# 4. Place the first outbound call.
call = anima.calls.create(
agent_id=agent_id,
to=your_phone,
tier="basic",
greeting="Hi, this is my Anima agent. I am calling from my own phone number.",
)
print(f"Call started: {call.call_id}, state: {call.state}")
# 5. After the call ends, fetch the transcript.
transcript = anima.calls.get_transcript(call.call_id)
for segment in transcript.segments:
print(f"{segment.speaker}: {segment.text}")