Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Check out our upcoming events and meetups! View events →
Code examples for the Telnyx Text-to-Speech REST API showing OpenAI SDK compatibility, synchronous and streaming playback, and async retrieval.
from openai import OpenAI client = OpenAI( api_key="YOUR_TELNYX_API_KEY", base_url="https://api.telnyx.com/v2" ) response = client.audio.speech.create( model="tts-1-hd", voice="astra", input="Hello from Telnyx." ) response.stream_to_file("output.mp3")
Was this page helpful?