Skip to main content
The official telnyx package provides synchronous and asynchronous Python clients generated from the same OpenAPI definition as the API reference.

Requests, types, and pagination

Typed models, nested parameters, file uploads, and pagination.

Resource map

Search every SDK resource and method and open the matching REST endpoint.

Errors, retries, and timeouts

Handle structured errors and configure retry and timeout behavior.

Webhooks

Verify ED25519 signatures and process webhook events.

Advanced usage

Configure language-specific logging, transport, raw responses, and custom requests.

Install

Requirements

Python 3.9 or higher.

Initialize the client and make a request

Quickstart from the current SDK source, using TELNYX_API_KEY for authentication:

Usage

The full API of this library can be found in api.md.
While you can provide an api_key keyword argument, we recommend using python-dotenv to add TELNYX_API_KEY="My API Key" to your .env file so that your API Key is not stored in source control.

Async usage

Simply import AsyncTelnyx instead of Telnyx and use await with each API call:
Functionality between the synchronous and asynchronous clients is otherwise identical.

With aiohttp

By default, the async client uses httpx for HTTP requests. However, for improved concurrency performance you may also use aiohttp as the HTTP backend. You can enable this by installing aiohttp:
Then you can enable it by instantiating the client with http_client=DefaultAioHttpClient():

Source and releases

SDK releases can follow REST API changes at different times. Check the package registry for the current version and use the resource map to confirm method availability.