from openai import OpenAI from pathlib import Path client = OpenAI(base_url="https://api.naga.ac/v1", api_key="YOUR_API_KEY") speech_file_path = Path("speech.mp3") resp = client.audio.speech.create( model="eleven-flash-v2.5", voice="alloy", input="Hello from NagaAI Text-to-Speech!" ) resp.stream_to_file(speech_file_path)
Eleven Flash v2.5 is an ultra-low-latency text-to-speech model from ElevenLabs. It is suited for conversational and real-time use cases, supports 32 languages, and has a 40,000-character request limit.