Skip to main content

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():