cli/resources/audio/subresources/speech/index.md +0 −69 deleted
File Deleted View Diff
1# Speech
2
3## Create speech
4
5`$ openai audio:speech create`
6
7**post** `/audio/speech`
8
9Generates audio from the input text.
10
11Returns the audio file content, or a stream of audio events.
12
13### Parameters
14
15- `--input: string`
16
17 The text to generate audio for. The maximum length is 4096 characters.
18
19- `--model: string or SpeechModel`
20
21 One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
22
23- `--voice: string or "alloy" or "ash" or "ballad" or 7 more or object { id }`
24
25 The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in the [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
26
27- `--instructions: optional string`
28
29 Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`.
30
31- `--response-format: optional "mp3" or "opus" or "aac" or 3 more`
32
33 The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
34
35- `--speed: optional number`
36
37 The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
38
39- `--stream-format: optional "sse" or "audio"`
40
41 The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.
42
43### Returns
44
45- `unnamed_schema_2: file path`
46
47### Example
48
49```cli
50openai audio:speech create \
51 --api-key 'My API Key' \
52 --input input \
53 --model tts-1 \
54 --voice string
55```
56
57## Domain Types
58
59### Speech Model
60
61- `speech_model: "tts-1" or "tts-1-hd" or "gpt-4o-mini-tts" or "gpt-4o-mini-tts-2025-12-15"`
62
63 - `"tts-1"`
64
65 - `"tts-1-hd"`
66
67 - `"gpt-4o-mini-tts"`
68
69 - `"gpt-4o-mini-tts-2025-12-15"`