Skip to content

SDKs

Teler ships two official SDKs that wrap the REST API and the media-streaming WebSocket protocol. Both expose the same conceptual surface: a Client for calls, 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.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, recordings
AsyncClientyesnoAsync REST client (Node is async by default)
client.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.
UnauthorizedException401Bad or missing API key. Node auto-maps 401; Python does not.
ForbiddenException403Number not owned by your account. Auto-mapped by both SDKs.
NotImplementedException501Feature not available (e.g. unidirectional streams). Raised client-side.
TelerException500Base 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.