Skip to main content

Cheap TTS Python SDK

Generate multilingual speech with server-side text preparation and local ONNX inference. An active Cheap TTS subscription and a server secret key are required.

Requires Python 3.10–3.13. Create a project and server key in the Cheap TTS dashboard.

pip install cheap-tts
from cheap_tts import CheapTTS

with CheapTTS(secret_key="sk_live_your_project") as tts:
    result = tts.synthesize(
        text="Xin chào từ Cheap TTS.",
        voice="vi-entertainment",
    )
    result.save("audio.wav")

Async usage:

from cheap_tts import AsyncCheapTTS

async with AsyncCheapTTS(secret_key="sk_live_your_project") as tts:
    result = await tts.synthesize("Hello from Cheap TTS.", "en-narration")
    result.save("audio.wav")

API

  • voices() returns the available voices.
  • load_voice() downloads, validates, caches, and loads one voice.
  • synthesize() prepares text through API v1 and performs ONNX inference locally.
  • clear_cache() removes locally cached voice assets.
  • close() releases the active model.

load_voice() and synthesize() accept on_progress and a cancellation object with an is_set() method, such as threading.Event.

from threading import Event

cancel = Event()
result = tts.synthesize(
    "A long document",
    "en-narration",
    rate=1.25,
    on_progress=lambda event: print(event.stage, event.progress),
    cancel_event=cancel,
)

Voice models are cached in ~/.cache/cheap-tts/models. Set cache_dir or CHEAP_TTS_CACHE_DIR to change the location.

The SDK sends operational health telemetry containing success/failure stage, latency, character count, voice ID, and audio duration. It never sends TTS text or credentials through telemetry. Pass telemetry=False to disable it.

API errors are raised as CheapTTSAPIError with stable status, code, and request_id fields.

Reading pauses

Pauses are left to the voice model by default. Pass pauses to insert real silence after a punctuation mark instead, in seconds (0-2):

result = tts.synthesize(
    "Xin chào từ Cheap TTS.",
    "vi-entertainment",
    pauses={"sentence": 0.4, "paragraph": 0.8},
)

Keys: sentence, comma, ellipsis, paragraph (a blank line). Every key is optional and defaults to 0, meaning the model's own pause — so omitting pauses keeps the audio you get today. Raising a value costs generation speed, because the audio has to be cut at that boundary for silence to follow it.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cheap_tts-0.2.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cheap_tts-0.2.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file cheap_tts-0.2.0.tar.gz.

File metadata

  • Download URL: cheap_tts-0.2.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for cheap_tts-0.2.0.tar.gz
Algorithm Hash digest
SHA256 801ec1b060a1cfd5189874907812e063559cc78e0e393dafff1cf17e1e0fd98d
MD5 2266ee5d94c226c5abfa14406005431f
BLAKE2b-256 dd1d5428ec906a5411c0d12276e0eb305e4f36b8bc73b4489f2559f11f5edd4d

See more details on using hashes here.

File details

Details for the file cheap_tts-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cheap_tts-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for cheap_tts-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c122b39d2ce617090a55379807fcb7d5fb7aa622f1376112edf783dbdf6edf23
MD5 a5ea894ade12735ee22dfee0bf72c81b
BLAKE2b-256 5fa0660722528e90fb6bc9b2272610c825fba170ac3555134a3c71a416046d8b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page