Skip to main content
The Audixa Python SDK provides both synchronous and asynchronous clients for the Audixa text-to-speech API, with built-in retry logic and comprehensive error handling.

Installation

For async support (file saving):

Quick Start

Synchronous (Simple)

Asynchronous

Configuration

Global Configuration

Client-Based Configuration

Using Models

Base Model

The Base model provides fast, high-quality TTS with 54+ voices:

Advanced Model

The Advanced model supports voice cloning and expressiveness controls:

Language Codes

Both models accept an optional language_code argument that tells the synthesiser which language the input text is in. The Admin panel uses this under the hood, and the SDK exposes it as a first-class parameter on every TTS function (tts, tts_and_wait, tts_to_file, and their async variants). The two models use different code schemes:
If you omit language_code, the model falls back to its default (English). The code must match a language supported by the chosen model; using an Advanced-only code with model="base" (or vice-versa) will produce unexpected pronunciation.

API Reference — Module-Level Functions

Synchronous Functions

These use the global API key set via audixa.set_api_key().

Asynchronous Functions

Common Parameters

Client API Reference

AudixaClient (Synchronous)

AsyncAudixaClient (Asynchronous)

Error Handling

The SDK provides specific exception classes for different error scenarios:

Exception Hierarchy

Audio Formats

Both WAV and MP3 formats are supported:

Custom Endpoints

Route TTS requests through a custom endpoint:

Environment Variables