Python SDK

Install

$pip install phonic

Initialize the client

1import os
2from phonic import Phonic
3
4client = Phonic(
5 api_key=os.getenv("PHONIC_API_KEY"),
6)

Create an agent

1client.agents.create(
2 name="my-first-agent",
3 phone_number="assign-automatically",
4)

Make an outbound call

1client.conversations.outbound_call(
2 to_phone_number="YOUR_PHONE_NUMBER", # e.g. +19189391262
3 config={
4 "agent": "my-first-agent",
5 "welcome_message": "Hello, how can I help you?",
6 },
7)
See Via Webhooks for the full walkthrough, including inbound calls, or the API reference for the complete SDK surface. An AsyncPhonic client is also available for async code.