# `PhxDemo.TTS.OpenAI`
[🔗](https://github.com/thenatespack/phoenix_demo/blob/main/lib/phx_demo/tts/openai.ex#L1)

Narration with OpenAI's text-to-speech API.

    config :phx_demo, :tts, {PhxDemo.TTS.OpenAI, voice: "nova"}

Options:
  * `:api_key`: defaults to the `OPENAI_API_KEY` environment variable
  * `:model`: default `"gpt-4o-mini-tts"`
  * `:voice`: default `"alloy"`
  * `:instructions`: speaking style, e.g. "Calm, friendly product demo"
  * `:base_url`: default `"https://api.openai.com/v1"`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
