Skip to main content

Orpheus TTS Python SDK

Stream high-quality speech from the Orpheus TTS model.

Installation

pip install orpheus-tts

Quick Start

from orpheus_tts import OrpheusClient

client = OrpheusClient(api_key="YOUR_API_KEY", provider="PROVIDER_NAME")

# Stream audio chunks
for chunk in client.stream("Hello world!", voice="josh"):
    # chunk is raw PCM bytes (int16, 48kHz, mono)
    print("Received chunk of length:", len(chunk))

Usage

Pre-connect and Save WAV

import time
import wave

from orpheus_tts import OrpheusClient

API_KEY = "YOUR_API_KEY"
PROVIDER = "PROVIDER_NAME"
VOICE = "josh"
TEXT = "Hello from Orpheus."
OUTPUT = "output.wav"

client = OrpheusClient(api_key=API_KEY, provider=PROVIDER)
client.connect(voice=VOICE, websocket_count=1)
time.sleep(1) # Brief pause to ensure connection is stable

chunks = []
start = time.perf_counter()

for i, chunk in enumerate(client.stream(TEXT, voice=VOICE)):
    if i == 0:
        print(f"TTFA: {(time.perf_counter() - start) * 1000:.1f}ms")
    chunks.append(chunk)

client.close()
audio = b"".join(chunks)

with wave.open(OUTPUT, "wb") as wav:
    wav.setnchannels(1)
    wav.setsampwidth(2)
    wav.setframerate(48000)
    wav.writeframes(audio)

Configuration

client = OrpheusClient(
    api_key="YOUR_API_KEY",
    provider="PROVIDER_NAME",
    max_tokens=3000,        # Maximum tokens to generate
    temperature=1.0,        # Sampling temperature
    repetition_penalty=1.1, # Repetition penalty
)

# Or override per-request
for chunk in client.stream(
    "Custom settings for this request.",
    voice="josh",
    max_tokens=2000,
    temperature=0.9,
):
    process(chunk)

Audio Format

All audio is returned as raw PCM with the following format:

  • Sample Rate: 48,000 Hz
  • Bit Depth: 16-bit signed integer (int16)
  • Channels: Mono (1 channel)

Error Handling

from orpheus_tts import OrpheusClient, OrpheusError, AuthenticationError

client = OrpheusClient(api_key="YOUR_API_KEY", provider="PROVIDER_NAME")

try:
    for chunk in client.stream("Hello!", voice="josh"):
        process(chunk)
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except OrpheusError as e:
    print(f"TTS error: {e}")

Connect with environment variables

export ORPHEUS_TTS_API_KEY="YOUR_API_KEY"
from orpheus_tts import OrpheusClient

client = OrpheusClient(provider="PROVIDER_NAME")  # Reads ORPHEUS_TTS_API_KEY if set
client.connect(websocket_count=1)

License

MIT

Metadata

Release files for orpheus-tts 0.1.6

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

Source distribution (sdist)

Source distribution for orpheus-tts 0.1.6
File Size Uploaded Provenance Actions
orpheus_tts-0.1.6.tar.gz 11.9 kB Without provenance Details for orpheus_tts-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orpheus-tts 0.1.6
File Interpreter ABI Platform Actions
orpheus_tts-0.1.6-py3-none-any.whl Python 3 none any Details for orpheus_tts-0.1.6-py3-none-any.whl

Total release size: 24.7 kB

Release files / orpheus_tts-0.1.6.tar.gz

Download URL orpheus_tts-0.1.6.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7e58a61aeb625c6372a079d3f3d1e8d4f7ded8717e9f4e46793ca46657f48ec6
BLAKE2b-256 checksum
How to use checksums
71f12b6d13f23383a0176c3bce285b6a4a7154b03a33640f5b0432828007125d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / orpheus_tts-0.1.6-py3-none-any.whl

Download URL orpheus_tts-0.1.6-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d2d790aad91b26991bb3e2ba460dad2ad609d2edfb418102364eeda3b4085cc
BLAKE2b-256 checksum
How to use checksums
61fdb9aca0cae12728672154516f3566927c73cdbc617042179168c907901ff0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Security for orpheus-tts 0.1.6

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