Skip to content

SDKs

Teler ships two official SDKs that wrap the REST APIs and the media-streaming WebSocket protocol. Both expose the same conceptual surface: a Client for voice, sip, etc. plus a StreamConnector for bridging Teler audio to a remote AI WebSocket.

Terminal window
pip install teler
from teler import Client
client = Client("YOUR_API_KEY")
call = client.voice.calls.create(
from_number="+918065xxxx",
to_number="+919967xxxx",
flow_url="https://your-domain.com/flow",
status_callback_url="https://your-domain.com/webhook",
record=True,
)
print(call.id)
SymbolPythonNodePurpose
ClientsyncyesREST client: calls, voice apps, sip trunks, secrets, recordings, call mutations and operations
AsyncClientyesnoAsync REST client (Node is async by default)
client.voice.calls.create()yesyesInitiate an outbound call
CallFlow.stream()yesyesBuild a Stream flow programmatically
StreamConnectoryesyesBridge Teler’s WebSocket to a remote AI WebSocket
StreamHandlerteler.streamsyesType for the callback that processes each message
StreamOp / StreamOPStreamOpStreamOPRELAY, PASS, STOP operations
StreamType.BIDIRECTIONALteler.streamsyesStream direction enum

Both SDKs define the same exception hierarchy, all descending from TelerException. How HTTP errors map to these types differs slightly by SDK, and several are raised by client-side validation rather than the server. See Errors for the exact mapping and catch patterns.

ExceptionHTTP codeWhen
BadParametersException400Invalid/missing parameter (carries .param). Raised by client-side validation.
UnauthorizedException401Reserved for a 401 response.
ForbiddenException403Number not owned by your account, or an invalid/revoked API key. Auto-mapped by both SDKs.
NotImplementedException501Feature not available (e.g. unidirectional streams). Raised client-side.
TelerException-Base class; also raised for any other non-2xx HTTP error.

Each SDK has multiple reference bridges that wire Teler to a popular AI provider. Browse them in Recipes. Every provider ships both a Python and a Node implementation.