Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/text-to-speech-workflow-guide.mdA 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.javascriptA 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.pythonA 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.bashA 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.cliA 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.javascriptA 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.pythonA 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.bashA 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.bashA 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.bashA 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.bashA 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.javascriptA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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