cli/resources/audio/subresources/translations/index.md +0 −182 deleted
File Deleted View Diff
1# Translations
2
3## Create translation
4
5`$ openai audio:translations create`
6
7**post** `/audio/translations`
8
9Translates audio into English.
10
11### Parameters
12
13- `--file: string`
14
15 The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
16
17- `--model: string or AudioModel`
18
19 ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available.
20
21- `--prompt: optional string`
22
23 An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should be in English.
24
25- `--response-format: optional "json" or "text" or "srt" or 2 more`
26
27 The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.
28
29- `--temperature: optional number`
30
31 The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
32
33### Returns
34
35- `unnamed_schema_1: Translation or TranslationVerbose`
36
37 - `translation: object { text }`
38
39 - `text: string`
40
41 - `translation_verbose: object { duration, language, text, segments }`
42
43 - `duration: number`
44
45 The duration of the input audio.
46
47 - `language: string`
48
49 The language of the output translation (always `english`).
50
51 - `text: string`
52
53 The translated text.
54
55 - `segments: optional array of TranscriptionSegment`
56
57 Segments of the translated text and their corresponding details.
58
59 - `id: number`
60
61 Unique identifier of the segment.
62
63 - `avg_logprob: number`
64
65 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
66
67 - `compression_ratio: number`
68
69 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
70
71 - `end: number`
72
73 End time of the segment in seconds.
74
75 - `no_speech_prob: number`
76
77 Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.
78
79 - `seek: number`
80
81 Seek offset of the segment.
82
83 - `start: number`
84
85 Start time of the segment in seconds.
86
87 - `temperature: number`
88
89 Temperature parameter used for generating the segment.
90
91 - `text: string`
92
93 Text content of the segment.
94
95 - `tokens: array of number`
96
97 Array of token IDs for the text content.
98
99### Example
100
101```cli
102openai audio:translations create \
103 --api-key 'My API Key' \
104 --file 'Example data' \
105 --model whisper-1
106```
107
108#### Response
109
110```json
111{
112 "text": "text"
113}
114```
115
116## Domain Types
117
118### Translation
119
120- `translation: object { text }`
121
122 - `text: string`
123
124### Translation Verbose
125
126- `translation_verbose: object { duration, language, text, segments }`
127
128 - `duration: number`
129
130 The duration of the input audio.
131
132 - `language: string`
133
134 The language of the output translation (always `english`).
135
136 - `text: string`
137
138 The translated text.
139
140 - `segments: optional array of TranscriptionSegment`
141
142 Segments of the translated text and their corresponding details.
143
144 - `id: number`
145
146 Unique identifier of the segment.
147
148 - `avg_logprob: number`
149
150 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
151
152 - `compression_ratio: number`
153
154 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
155
156 - `end: number`
157
158 End time of the segment in seconds.
159
160 - `no_speech_prob: number`
161
162 Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.
163
164 - `seek: number`
165
166 Seek offset of the segment.
167
168 - `start: number`
169
170 Start time of the segment in seconds.
171
172 - `temperature: number`
173
174 Temperature parameter used for generating the segment.
175
176 - `text: string`
177
178 Text content of the segment.
179
180 - `tokens: array of number`
181
182 Array of token IDs for the text content.