class coqui.Coqui

A Coqui instance is the entry point for all API usage.

Public members

Coqui(base_url: str | None = None)

Create a Coqui instance.

property is_logged_in : bool

Whether this instance has successfully authenticated with the backend.

Asynchronous API

async login(token: str) bool

Login with the provided API token and validate it. If validation is successful, saves the authentication state for future usage of this instance.

async validate_login() bool

Returns True if the saved authentication info is valid.

async cloned_voices() list[ClonedVoice]

Return the list of cloned voices for this account.

async clone_voice(audio_file: str | BinaryIO, name) ClonedVoice

Clone a voice from an audio file.

async estimate_quality(...) tuple['high' | 'average' | 'poor', SampleQualityRaw]

Estimates quality of given audio file, return a quality level of “high”, “average” or “poor”, as well as the raw estimated sample quality numeric value.

async list_samples(voice_id: str) list[Sample]

Return a list of samples created from a given cloned voice.

async synthesize(voice_id: str, text: str, speed, ...) Sample

Synthesize speech using an existing cloned voice.

Helpers

static download_file_sync(url: str, f: BinaryIO, /, ...)

Convenience function to download an audio file from a URL.

async static download_file(url: str, f: BinaryIO, /, ...)

Convenience function to download an audio file from a URL.

Synchronous API

login_sync(token: str) bool

Login with the provided API token and validate it. If validation is successful, saves the authentication state for future usage of this instance.

validate_login_sync() bool

Returns True if the saved authentication info is valid.

cloned_voices_sync() list[ClonedVoice]

Return the list of cloned voices for this account.

clone_voice_sync(audio_file: str | BinaryIO, name) ClonedVoice

Clone a voice from an audio file.

estimate_quality_sync(...) tuple['high' | 'average' | 'poor', SampleQualityRaw]

Estimates quality of given audio file, return a quality level of “high”, “average” or “poor”, as well as the raw estimated sample quality numeric value.

list_samples_sync(voice_id: str) list[Sample]

Return a list of samples created from a given cloned voice.

synthesize_sync(voice_id: str, text: str, speed, ...) Sample

Synthesize speech using an existing cloned voice.