Synthesize speech with OpenAI
openai_text_to_speechGenerate spoken audio from text and save it to a file on disk. Choose voice, speed, and format, then receive the absolute path to the generated audio.
Instructions
Turn text into spoken audio and write the result to disk.
The audio is never returned inline — the tool reports the absolute path of the generated file.
Args:
input (string, required): the text to speak, up to 10,000 characters
voice (string): voice name, default "alloy"
model (string): speech model ID, defaults to OPENAI_DEFAULT_SPEECH_MODEL
instructions (string): delivery guidance such as "speak slowly and warmly"
format ('mp3'|'opus'|'aac'|'flac'|'wav'|'pcm'): default 'mp3'
speed (number): 0.25-4.0, default 1
output_path (string): absolute target file, defaults to a timestamped file in OPENAI_MCP_OUTPUT_DIR
response_format ('markdown'|'json'): default 'markdown'
Returns (JSON format): { "model": string, "voice": string, "path": string, // absolute path of the written audio file "bytes": number, // file size "format": string // container that was written }
Examples:
Use when: "Read this paragraph aloud as an mp3" -> input=
Use when: you need a slower narration -> speed=0.85
Don't use when: you want a transcript of existing audio (use openai_transcribe_audio)
Error Handling:
"Error: Access to ... is not permitted" means output_path is outside OPENAI_MCP_ALLOWED_DIRS
"Error: OpenAI rejected the request as invalid" often means the voice name is unknown to that model
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The text to speak | |
| model | No | Speech model ID. Defaults to OPENAI_DEFAULT_SPEECH_MODEL. | |
| speed | No | Playback speed multiplier | |
| voice | No | Voice name, e.g. "alloy", "ash", "coral", "sage", "verse", "marin", "cedar" | alloy |
| format | No | Audio container of the generated file | mp3 |
| output_path | No | Absolute file path to write the audio to. Defaults to a timestamped file in OPENAI_MCP_OUTPUT_DIR. | |
| instructions | No | Delivery guidance, e.g. "speak slowly and warmly" | |
| response_format | No | Output format: 'markdown' or 'json' | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| bytes | Yes | ||
| model | Yes | ||
| voice | Yes | ||
| format | Yes |