This guide walks you through building with Smallest AI using the official Python SDK.
For full details, see the Python SDK on GitHub.


1. Installation

Install the SDK using pip:

pip install smallestai

2. Get Your API Key

  1. Go to the Smallest AI Console and sign up or log in.
  2. Navigate to the API Keys tab and create a new API key.
  3. Store your key securely (e.g., as SMALLEST_API_KEY in your environment).

3. Create Your First Agent

Create an agent with a display name, voice, and language:

from smallestai import Configuration, AtomsClient

config = Configuration(
    access_token="your-api-key"
)
atoms_client = AtomsClient(config)

# Create your first agent
agent = atoms_client.create_agent(
    display_name="My First Agent",
    voice_id="emily",  # or any available voice
    language="en"
)
print("Created agent:", agent)

4. Place an Outbound Call

Place a call using your agent to a phone number:

call = atoms_client.place_call(
    agent_id=agent["id"],
    phone_number="+1234567890"
)
print("Placed call:", call)

5. Provide Context to the Agent

Optionally, provide context to your agent for personalized conversations:

context = {
    "customer_name": "Alice",
    "order_id": "12345"
}
response = atoms_client.update_agent_context(
    agent_id=agent["id"],
    context=context
)
print("Updated agent context:", response)

6. Bulk Calling / Campaigns

Provision bulk calling using campaigns:

campaign = atoms_client.create_campaign(
    agent_id=agent["id"],
    phone_numbers=["+1234567890", "+1987654321"]
)
print("Created campaign:", campaign)

For more details and advanced usage, see the Python SDK Repository.