openai · OpenAI Platform Docs
Text to speech
Teaches how to implement text-to-speech functionality using OpenAI models, including model selection, voice configuration, output format settings, and real-time audio streaming via chunk transfer encoding.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Text to speech
Teaches how to implement text-to-speech functionality using OpenAI models, including model selection, voice configuration, output format settings, and real-time audio streaming via chunk transfer encoding.
When To Use
Use when you need to implement audio narration, generate spoken content in multiple languages, or integrate low-latency real-time audio streaming into an application.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/text-to-speech-workflow-guide.md | A guide explaining the OpenAI Audio API text-to-speech models, voice options, and streaming realtime audio capabilities. | Questions about a guide explaining the OpenAI Audio API text-to-speech models, voice options, and streaming realtime audio capabilities. |
examples/text-to-speech-openai-text-to-speech.javascript | A JavaScript code example demonstrating how to use the OpenAI audio speech API to generate an MP3 file from text input. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI audio speech API to generate an MP3 file from text input. |
examples/text-to-speech-openai-text-to-speech-python-streaming-response.python | A Python script demonstrating how to use the OpenAI client to generate speech with a streaming response using the gpt-4o-mini-tts model. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to generate speech with a streaming response using the gpt... |
examples/text-to-speech-openai-text-to-speech-curl-request.bash | A bash curl command demonstrating how to send a request to the OpenAI text-to-speech API using a specific model, input text, and voice. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating how to send a request to the OpenAI text-to-speech API using a specific model, inpu... |
examples/text-to-speech-openai-text-to-speech-cli-create-request.cli | A CLI command demonstrating how to generate speech using the openai audio speech create endpoint with specific model, voice, and instructions parameters. | Exact payloads, commands, or snippets shown in A CLI command demonstrating how to generate speech using the openai audio speech create endpoint with specific model,... |
examples/text-to-speech-openai-text-to-speech-2.javascript | A JavaScript code example demonstrating how to use the OpenAI SDK to generate speech from text using the audio speech create method. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI SDK to generate speech from text using the audio speech... |
examples/text-to-speech-openai-text-to-speech-python-streaming-response-2.python | A Python script demonstrating how to use the AsyncOpenAI client to create a streaming text-to-speech response with specific voice and instructions. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the AsyncOpenAI client to create a streaming text-to-speech response with sp... |
examples/text-to-speech-openai-text-to-speech-curl-request-2.bash | A bash curl command demonstrating how to send a request to the OpenAI text-to-speech API using a specific model, voice, and instructions. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating how to send a request to the OpenAI text-to-speech API using a specific model, voic... |
examples/text-to-speech-openai-text-to-speech-voice-consent-curl-request.bash | A bash curl command to post a voice consent recording to the OpenAI text-to-speech API. | Exact payloads, commands, or snippets shown in A bash curl command to post a voice consent recording to the OpenAI text-to-speech API. |
examples/text-to-speech-openai-text-to-speech-voice-creation-curl.bash | A bash curl command demonstrating how to create a new custom voice using the OpenAI text-to-speech API. | Exact payloads, commands, or snippets shown in A bash curl command demonstrating how to create a new custom voice using the OpenAI text-to-speech API. |
examples/text-to-speech-openai-text-to-speech-curl-request-3.bash | A curl command demonstrating how to send a POST request to the OpenAI text-to-speech API to generate audio from text. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a POST request to the OpenAI text-to-speech API to generate audio from text. |
examples/text-to-speech-openai-text-to-speech-3.javascript | A JavaScript code example demonstrating how to implement text-to-speech functionality using the OpenAI API. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to implement text-to-speech functionality using the OpenAI API. |
What This Skill Covers
- The Audio API provides a speech endpoint based on our GPT-4o mini TTS (text-to-speech) model. It comes with 11 built-in voices and can be used to:
- Main sections:
Quickstart,Text-to-speech models,Voice options,Streaming realtime audio,Supported output formats.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/text-to-speech.md
