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.
Python: teler-py Sync Client and AsyncClient. Pythonic StreamConnector with handlers.
Node: teler-node TypeScript-first. Typed exceptions, Promise-based API.
Install
Section titled “Install”pip install telernpm install @frejun/telerInitiate a call
Section titled “Initiate a call”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)import { Client } from "@frejun/teler";
const client = new Client("YOUR_API_KEY");
const call = await 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,});console.log(call.id);Core surface
Section titled “Core surface”| Symbol | Python | Node | Purpose |
|---|---|---|---|
Client | sync | yes | REST client: calls, voice apps, recordings |
AsyncClient | yes | no | Async REST client (Node is async by default) |
client.calls.create() | yes | yes | Initiate an outbound call |
CallFlow.stream() | yes | yes | Build a Stream flow programmatically |
StreamConnector | yes | yes | Bridge Teler’s WebSocket to a remote AI WebSocket |
StreamHandler | teler.streams | yes | Type for the callback that processes each message |
StreamOp / StreamOP | StreamOp | StreamOP | RELAY, PASS, STOP operations |
StreamType.BIDIRECTIONAL | teler.streams | yes | Stream direction enum |
Exceptions
Section titled “Exceptions”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.
| Exception | HTTP code | When |
|---|---|---|
BadParametersException | 400 | Invalid/missing parameter (carries .param). Raised by client-side validation. |
UnauthorizedException | 401 | Bad or missing API key. Node auto-maps 401; Python does not. |
ForbiddenException | 403 | Number not owned by your account. Auto-mapped by both SDKs. |
NotImplementedException | 501 | Feature not available (e.g. unidirectional streams). Raised client-side. |
TelerException | 500 | Base class; also raised for any other non-2xx HTTP error. |
Reference integrations
Section titled “Reference integrations”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.