Installation
Voraussetzungen
Python 3.9+
Unterstützt sowohl synchrone als auch asynchrone Operationen
Hol dir deinen API-Schlüssel
Um das SDK zu nutzen, brauchst du einen API-Schlüssel aus deinem itellicoAI-Dashboard :
Zu API-Schlüsseln gehen
Gehe zu Entwickler → API-Schlüssel
Schlüssel erstellen
Klicke auf API-Schlüssel erstellen
Schlüssel kopieren
Kopiere den generierten Schlüssel - er wird nur einmal angezeigt
Speichere deinen API-Schlüssel sicher mit Umgebungsvariablen. Checke ihn niemals in die Versionsverwaltung ein.
Schnellstart
from itellicoai import Itellicoai
# Initialize client
client = Itellicoai(
api_key = "your-api-key"
)
# Create an agent
agent = client.agents.create(
account_id = "your-account-id" ,
name = "Customer Support Agent" ,
model = {
"provider" : "openai" ,
"model" : "gpt-4o-mini"
},
voice = {
"provider" : "elevenlabs" ,
"voice_id" : "EXAVITQu4vr4xnSDxMaL"
},
transcriber = {
"provider" : "deepgram" ,
"model" : "nova-2:general" ,
"language" : "en-US"
},
initial_message = {
"mode" : "fixed_message" ,
"message" : "Hello! How can I assist you today?" ,
"delay_ms" : 1000
},
max_duration_seconds = 1800 ,
tags = [ "support" , "customer-service" ]
)
print ( f "Created agent: { agent.id } " )
Asynchrone Unterstützung
import asyncio
from itellicoai import AsyncItellicoai
async def main ():
client = AsyncItellicoai( api_key = "your-api-key" )
# List agents asynchronously
agents = await client.agents.list( "account_id" )
for agent in agents.items:
print ( f "Agent: { agent.name } " )
asyncio.run(main())
SDK-Operationen
Agenten auflisten from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
agents = client.agents.list(
account_id = "account_id" ,
)
print (agents.count)
Agent abrufen from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
agent_response = client.agents.retrieve(
agent_id = "agent_id" ,
account_id = "account_id" ,
)
print (agent_response.id)
Agent aktualisieren from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
agent_response = client.agents.update(
agent_id = "agent_id" ,
account_id = "account_id" ,
)
print (agent_response.id)
Agent archivieren from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
client.agents.archive(
agent_id = "agent_id" ,
account_id = "account_id" ,
)
Gespräche auflisten from itellicoai import Itellicoai
client = Itellicoai( api_key = "My API Key" )
conversations = client.accounts.list_conversations(
account_id = "account_id"
)
for conv in conversations.items:
print ( f "Conversation ID: { conv.conversation_id } " )
print ( f "Contact: { conv.contact_number } " )
print ( f "Duration: { conv.duration_seconds } s" )
print ( f "Status: { conv.status } " )
Telefonnummern auflisten from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
phone_numbers = client.accounts.phone_numbers.list(
account_id = "account_id" ,
)
print (phone_numbers.count)
Telefonnummer erstellen from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
phone_number = client.accounts.phone_numbers.create(
account_id = "account_id" ,
sip_trunk_id = "sip_trunk_id" ,
)
print (phone_number.id)
Telefonnummer abrufen from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
phone_number = client.accounts.phone_numbers.retrieve(
phone_number_id = "phone_number_id" ,
account_id = "account_id" ,
)
print (phone_number.id)
Telefonnummer aktualisieren from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
phone_number = client.accounts.phone_numbers.update(
phone_number_id = "phone_number_id" ,
account_id = "account_id" ,
)
print (phone_number.id)
Telefonnummer löschen from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
client.accounts.phone_numbers.delete(
phone_number_id = "phone_number_id" ,
account_id = "account_id" ,
)
Modelle auflisten from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
response = client.accounts.providers.list_models(
account_id = "account_id" ,
)
print (response)
Transkribierer auflisten from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
response = client.accounts.providers.list_transcribers(
account_id = "account_id" ,
)
print (response)
Stimmen auflisten from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
response = client.accounts.providers.list_voices(
account_id = "account_id" ,
provider = "provider" ,
)
print (response)
SIP-Trunks auflisten from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
sip_trunks = client.accounts.sip_trunks.list(
account_id = "account_id" ,
)
print (sip_trunks.count)
SIP-Trunk erstellen from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
sip_trunk = client.accounts.sip_trunks.create(
account_id = "account_id" ,
)
print (sip_trunk.id)
SIP-Trunk abrufen from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
sip_trunk = client.accounts.sip_trunks.retrieve(
sip_trunk_id = "sip_trunk_id" ,
account_id = "account_id" ,
)
print (sip_trunk.id)
SIP-Trunk aktualisieren from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
sip_trunk = client.accounts.sip_trunks.update(
sip_trunk_id = "sip_trunk_id" ,
account_id = "account_id" ,
)
print (sip_trunk.id)
SIP-Trunk löschen from itellicoai import Itellicoai
client = Itellicoai(
api_key = "My API Key" ,
)
client.accounts.sip_trunks.delete(
sip_trunk_id = "sip_trunk_id" ,
account_id = "account_id" ,
)
Nutzungsanalytik abrufen response = client.accounts.analytics.get_usage(
account_id = "account_id" ,
)
print (response.meta)
Subaccounts auflisten subaccounts = client.accounts.subaccounts.list(
account_id = "account_id" ,
)
print (subaccounts.count)
Subaccount erstellen account = client.accounts.subaccounts.create(
account_id = "account_id" ,
name = "name" ,
)
print (account.id)
Subaccount abrufen account = client.accounts.subaccounts.retrieve(
subaccount_id = "subaccount_id" ,
account_id = "account_id" ,
)
print (account.id)
Subaccount aktualisieren account = client.accounts.subaccounts.update(
subaccount_id = "subaccount_id" ,
account_id = "account_id" ,
)
print (account.id)
Fehlerbehandlung
from itellicoai import Itellicoai
import itellicoai
client = Itellicoai( api_key = "your-api-key" )
try :
agent = client.agents.retrieve( "agent_123abc" , account_id = "account_id" )
except itellicoai.AuthenticationError:
print ( "Invalid API key" )
except itellicoai.NotFoundError:
print ( "Agent not found" )
except itellicoai.RateLimitError:
print ( "Rate limit exceeded" )
except itellicoai.APIStatusError as e:
print ( f "API error: { e.status_code } " )
Umgebungsvariablen
import os
from itellicoai import Itellicoai
# API key automatically loaded from ITELLICOAI_API_KEY env var
client = Itellicoai()
# Or set explicitly
client = Itellicoai( api_key = os.getenv( "ITELLICOAI_API_KEY" ))
Ressourcen
PyPI-Paket Von PyPI installieren
GitHub-Repository Quellcode auf GitHub ansehen
API-Referenz REST-API-Dokumentation durchsuchen