# OpenAI Text to Speech

Source: https://openflow.run/en/templates/openai-text-to-speech/
Content language: en
Template revision: f2bf5895d91486412f320151dafd9c6b95b42091

Content

Convert supplied text into an MP3 with OpenAI tts-1 and return a downloadable audio file.

[Use in Open Flow](https://console.openflow.run/flows?importUrl=https%3A%2F%2Fraw.githubusercontent.com%2Foomol-lab%2Fawesome-workflow-templates%2Ff2bf5895d91486412f320151dafd9c6b95b42091%2Fworkflows%2Fopenai-text-to-speech%2Ftemplates%2Fopenai-text-to-speech.openflow.json)

*   [Open Flow JSON](https://raw.githubusercontent.com/oomol-lab/awesome-workflow-templates/f2bf5895d91486412f320151dafd9c6b95b42091/workflows/openai-text-to-speech/templates/openai-text-to-speech.openflow.json)
*   [n8n JSON](https://raw.githubusercontent.com/oomol-lab/awesome-workflow-templates/f2bf5895d91486412f320151dafd9c6b95b42091/workflows/openai-text-to-speech/templates/openai-text-to-speech.n8n.json)

![OpenAI Text to Speech workflow in Open Flow](https://openflow.run/_astro/preview-light.DKP3pGoZ_1GSkuv.webp)

Convert text into an MP3 using OpenAI `tts-1`. Download `speech.mp3` from the Open Flow run result, or use the binary `data` output in n8n.

## Setup and use

Connect OpenAI in **Generate MP3 speech**. Use Run and supply:

```json
{
  "input_text": "The quick brown fox jumped over the lazy dog.",
  "voice": "alloy"
}
```

The text must be nonempty and contain at most 4,096 characters. `voice` defaults to `alloy`; supported choices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, and `shimmer`. Text is sent to OpenAI and generation uses your account’s API allowance.

For n8n, edit **Set input text and TTS voice**, select an OpenAI credential in **Send HTTP Request to OpenAI’s TTS Endpoint**, and use Execute Workflow. The request returns an MP3 in binary field `data`, ready for download or a cloud upload node.

Each run has one synthesis step, with no workflow-level retries configured. The provider manages any internal request retries. A failed request or invalid audio response stops without a successful file result. Open Flow stores the resulting audio as a run artifact. If you share the recording with listeners, disclose that the voice is AI-generated.

OpenAI has [announced that `tts-1` will shut down on January 6, 2027](https://developers.openai.com/api/docs/guides/text-to-speech). This template retains the source model while that endpoint remains available. Plan a migration before that date; the replacement Realtime API requires a different workflow.

## Changes to the source

*   Remove the redundant literal Authorization header and keep authentication in the account credential.
*   Validate text and voice before synthesis, and make MP3 output explicit.
*   Correct the source input-limit note to 4,096 characters.
*   Preserve binary audio as a downloadable Open Flow artifact or n8n binary output.

Adapted from [Convert text to speech with OpenAI](https://github.com/enescingoz/awesome-n8n-templates/blob/827110332c21cbe000ab13f6d292d5adb1f1f8db/OpenAI_and_LLMs/Convert%20text%20to%20speech%20with%20OpenAI.json) in [enescingoz/awesome-n8n-templates](https://github.com/enescingoz/awesome-n8n-templates).

Source collection notice: © 2024–2026 Enes Cingoz, [CC BY 4.0](https://github.com/enescingoz/awesome-n8n-templates/blob/827110332c21cbe000ab13f6d292d5adb1f1f8db/LICENSE). The source export does not identify a separate template author or license. See [repository licensing](https://github.com/oomol-lab/awesome-workflow-templates/blob/f2bf5895d91486412f320151dafd9c6b95b42091/README.md#licensing) for the scope of OOMOL contributions and third-party material.

## Apps used

*   [**OpenAI**`openai`](https://console.openflow.run/connections/openai)

## What you’ll need

*   OpenAI connection with access to the Speech API
*   Text up to 4096 characters
*   tts-1 availability before its announced 2027-01-06 shutdown

*   audio
*   text to speech
*   openai

[View on GitHub](https://github.com/oomol-lab/awesome-workflow-templates/blob/f2bf5895d91486412f320151dafd9c6b95b42091/workflows/openai-text-to-speech/README.md)
