🎉 ai-infra v1.0 is here — Production-ready AI/LLM infrastructure
What's new
nfrax logonfrax

Infrastructure that just works. Ship products, not boilerplate.

Frameworks

  • svc-infra
  • ai-infra
  • fin-infra
  • robo-infra

Resources

  • Getting Started
  • What's New
  • Contributing

Community

  • GitHub

© 2026 nfrax. All rights reserved.

nfrax logonfrax
Start HereWhat's New
GitHub
ai-infra / API Reference

TTS

from ai_infra.llm import TTS
View source
ai_infra.llm

Text-to-Speech with provider-agnostic API. Supports OpenAI, Google Cloud TTS, and ElevenLabs. Auto-detects provider based on available API keys if not specified.

Constructor
TTS(provider: str | None = None, voice: str | None = None, model: str | None = None, api_key: str | None = None)
ParameterTypeDefaultDescription
providerstr|NoneNoneTTS provider ("openai", "google", "elevenlabs"). Auto-detected if None.
voicestr|NoneNoneVoice name (provider-specific). Uses default if None.
modelstr|NoneNoneModel name (provider-specific). Uses default if None.
api_keystr|NoneNoneAPI key (uses environment variable if None).

Methods

On This Page

Constructoraspeakasyncastreamasynclist_providersstaticlist_voicesstaticspeakspeak_to_filestream