Skip to main content

tontaube

Python SDK for the Tontaube text-to-speech API.

Installation

pip install tontaube

Usage

import tontaube

with tontaube.Client(api_key="your-api-key") as client:
    voices = client.list_voices()
    response = client.generate_speech(
        text="Tell me what we are building today, and I will get right to work.",
        voice_id=voices[0].id,
    )

with open("speech.m4a", "wb") as f:
    f.write(response.content)

Audio is returned as Opus in an MP4 container. Async client is also available via tontaube.AsyncClient.

Your own voices

voice = client.create_voice(name="My voice", audio="reference.wav", language="en")
response = client.generate_speech(text="Hello in my own voice.", voice_id=voice.id)

list_voices() returns your voices and the Tontaube library voices, get_voice() and delete_voice() manage them. For a one-off voice without storing it, pass the recording directly: generate_speech(text, voice_audio="reference.wav").

Streaming

with open("speech.mp3", "wb") as f:
    for chunk in client.stream_speech(text="Hello while it is still being generated.", voice_id=voice.id):
        f.write(chunk)

More options

  • style (audiobook, conversational, agentic) and controls=tontaube.Controls(rate=1, pause=3) shape the delivery.
  • seed makes a generation repeatable.
  • style, controls, seed and prefix work for streaming too.
  • include_timestamps=True returns when each word is spoken (English).
  • return_context=True and prefix continue earlier speech seamlessly.

Errors from the API raise tontaube.APIError with status_code, code and message.

See the examples/ folder for more usage patterns.

For full API reference see tontaube.ai/api-reference.

Metadata

Release files for tontaube 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tontaube 0.2.1
File Size Uploaded Provenance Actions
tontaube-0.2.1.tar.gz 11.2 kB Without provenance Details for tontaube-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tontaube 0.2.1
File Interpreter ABI Platform Actions
tontaube-0.2.1-py3-none-any.whl Python 3 none any Details for tontaube-0.2.1-py3-none-any.whl

Total release size: 22.0 kB

Release files / tontaube-0.2.1.tar.gz

Download URL tontaube-0.2.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7d405b7bf63b39eb2df3de6002540770f7745101d3dccf4ae3c382b512a45d87
BLAKE2b-256 checksum
How to use checksums
113f27ef2c12159600dd50eeafbc6be83a51c3447b76ededd1be844cb6414914
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / tontaube-0.2.1-py3-none-any.whl

Download URL tontaube-0.2.1-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b7d2a6a4d6c76cf5face6aef9901566451ca9a79dabe5ec5473c3f5d71d532a
BLAKE2b-256 checksum
How to use checksums
ade2cab534e28b18071c6feed3cdbf5073250867ed05f5879572cf280554185e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Security for tontaube 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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