resources/audio/subresources/transcriptions/index.md +0 −1544 deleted
File Deleted View Diff
1# Transcriptions
2
3## Create transcription
4
5**post** `/audio/transcriptions`
6
7Transcribes audio into the input language.
8
9Returns a transcription object in `json`, `diarized_json`, or `verbose_json`
10format, or a stream of transcript events.
11
12### Returns
13
14- `Transcription object { text, logprobs, usage }`
15
16 Represents a transcription response returned by model, based on the provided input.
17
18 - `text: string`
19
20 The transcribed text.
21
22 - `logprobs: optional array of object { token, bytes, logprob }`
23
24 The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array.
25
26 - `token: optional string`
27
28 The token in the transcription.
29
30 - `bytes: optional array of number`
31
32 The bytes of the token.
33
34 - `logprob: optional number`
35
36 The log probability of the token.
37
38 - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more } or object { seconds, type }`
39
40 Token usage statistics for the request.
41
42 - `TokenUsage object { input_tokens, output_tokens, total_tokens, 2 more }`
43
44 Usage statistics for models billed by token usage.
45
46 - `input_tokens: number`
47
48 Number of input tokens billed for this request.
49
50 - `output_tokens: number`
51
52 Number of output tokens generated.
53
54 - `total_tokens: number`
55
56 Total number of tokens used (input + output).
57
58 - `type: "tokens"`
59
60 The type of the usage object. Always `tokens` for this variant.
61
62 - `"tokens"`
63
64 - `input_token_details: optional object { audio_tokens, text_tokens }`
65
66 Details about the input tokens billed for this request.
67
68 - `audio_tokens: optional number`
69
70 Number of audio tokens billed for this request.
71
72 - `text_tokens: optional number`
73
74 Number of text tokens billed for this request.
75
76 - `DurationUsage object { seconds, type }`
77
78 Usage statistics for models billed by audio input duration.
79
80 - `seconds: number`
81
82 Duration of the input audio in seconds.
83
84 - `type: "duration"`
85
86 The type of the usage object. Always `duration` for this variant.
87
88 - `"duration"`
89
90- `TranscriptionDiarized object { duration, segments, task, 2 more }`
91
92 Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.
93
94 - `duration: number`
95
96 Duration of the input audio in seconds.
97
98 - `segments: array of TranscriptionDiarizedSegment`
99
100 Segments of the transcript annotated with timestamps and speaker labels.
101
102 - `id: string`
103
104 Unique identifier for the segment.
105
106 - `end: number`
107
108 End timestamp of the segment in seconds.
109
110 - `speaker: string`
111
112 Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).
113
114 - `start: number`
115
116 Start timestamp of the segment in seconds.
117
118 - `text: string`
119
120 Transcript text for this segment.
121
122 - `type: "transcript.text.segment"`
123
124 The type of the segment. Always `transcript.text.segment`.
125
126 - `"transcript.text.segment"`
127
128 - `task: "transcribe"`
129
130 The type of task that was run. Always `transcribe`.
131
132 - `"transcribe"`
133
134 - `text: string`
135
136 The concatenated transcript text for the entire audio input.
137
138 - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more } or object { seconds, type }`
139
140 Token or duration usage statistics for the request.
141
142 - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`
143
144 Usage statistics for models billed by token usage.
145
146 - `input_tokens: number`
147
148 Number of input tokens billed for this request.
149
150 - `output_tokens: number`
151
152 Number of output tokens generated.
153
154 - `total_tokens: number`
155
156 Total number of tokens used (input + output).
157
158 - `type: "tokens"`
159
160 The type of the usage object. Always `tokens` for this variant.
161
162 - `"tokens"`
163
164 - `input_token_details: optional object { audio_tokens, text_tokens }`
165
166 Details about the input tokens billed for this request.
167
168 - `audio_tokens: optional number`
169
170 Number of audio tokens billed for this request.
171
172 - `text_tokens: optional number`
173
174 Number of text tokens billed for this request.
175
176 - `Duration object { seconds, type }`
177
178 Usage statistics for models billed by audio input duration.
179
180 - `seconds: number`
181
182 Duration of the input audio in seconds.
183
184 - `type: "duration"`
185
186 The type of the usage object. Always `duration` for this variant.
187
188 - `"duration"`
189
190- `TranscriptionVerbose object { duration, language, text, 3 more }`
191
192 Represents a verbose json transcription response returned by model, based on the provided input.
193
194 - `duration: number`
195
196 The duration of the input audio.
197
198 - `language: string`
199
200 The language of the input audio.
201
202 - `text: string`
203
204 The transcribed text.
205
206 - `segments: optional array of TranscriptionSegment`
207
208 Segments of the transcribed text and their corresponding details.
209
210 - `id: number`
211
212 Unique identifier of the segment.
213
214 - `avg_logprob: number`
215
216 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
217
218 - `compression_ratio: number`
219
220 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
221
222 - `end: number`
223
224 End time of the segment in seconds.
225
226 - `no_speech_prob: number`
227
228 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.
229
230 - `seek: number`
231
232 Seek offset of the segment.
233
234 - `start: number`
235
236 Start time of the segment in seconds.
237
238 - `temperature: number`
239
240 Temperature parameter used for generating the segment.
241
242 - `text: string`
243
244 Text content of the segment.
245
246 - `tokens: array of number`
247
248 Array of token IDs for the text content.
249
250 - `usage: optional object { seconds, type }`
251
252 Usage statistics for models billed by audio input duration.
253
254 - `seconds: number`
255
256 Duration of the input audio in seconds.
257
258 - `type: "duration"`
259
260 The type of the usage object. Always `duration` for this variant.
261
262 - `"duration"`
263
264 - `words: optional array of TranscriptionWord`
265
266 Extracted words and their corresponding timestamps.
267
268 - `end: number`
269
270 End time of the word in seconds.
271
272 - `start: number`
273
274 Start time of the word in seconds.
275
276 - `word: string`
277
278 The text content of the word.
279
280### Example
281
282```http
283curl https://api.openai.com/v1/audio/transcriptions \
284 -H 'Content-Type: multipart/form-data' \
285 -H "Authorization: Bearer $OPENAI_API_KEY" \
286 -F 'file=@/path/to/file' \
287 -F model=gpt-4o-transcribe
288```
289
290#### Response
291
292```json
293{
294 "text": "text",
295 "logprobs": [
296 {
297 "token": "token",
298 "bytes": [
299 0
300 ],
301 "logprob": 0
302 }
303 ],
304 "usage": {
305 "input_tokens": 0,
306 "output_tokens": 0,
307 "total_tokens": 0,
308 "type": "tokens",
309 "input_token_details": {
310 "audio_tokens": 0,
311 "text_tokens": 0
312 }
313 }
314}
315```
316
317### Example
318
319```http
320curl https://api.openai.com/v1/audio/transcriptions \
321 -H "Authorization: Bearer $OPENAI_API_KEY" \
322 -H "Content-Type: multipart/form-data" \
323 -F file="@/path/to/file/audio.mp3" \
324 -F model="gpt-4o-transcribe"
325```
326
327#### Response
328
329```json
330{
331 "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.",
332 "usage": {
333 "type": "tokens",
334 "input_tokens": 14,
335 "input_token_details": {
336 "text_tokens": 0,
337 "audio_tokens": 14
338 },
339 "output_tokens": 45,
340 "total_tokens": 59
341 }
342}
343```
344
345### Diarization
346
347```http
348curl https://api.openai.com/v1/audio/transcriptions \
349 -H "Authorization: Bearer $OPENAI_API_KEY" \
350 -H "Content-Type: multipart/form-data" \
351 -F file="@/path/to/file/meeting.wav" \
352 -F model="gpt-4o-transcribe-diarize" \
353 -F response_format="diarized_json" \
354 -F chunking_strategy=auto \
355 -F 'known_speaker_names[]=agent' \
356 -F 'known_speaker_references[]=data:audio/wav;base64,AAA...'
357```
358
359#### Response
360
361```json
362{
363 "task": "transcribe",
364 "duration": 27.4,
365 "text": "Agent: Thanks for calling OpenAI support.\nA: Hi, I'm trying to enable diarization.\nAgent: Happy to walk you through the steps.",
366 "segments": [
367 {
368 "type": "transcript.text.segment",
369 "id": "seg_001",
370 "start": 0.0,
371 "end": 4.7,
372 "text": "Thanks for calling OpenAI support.",
373 "speaker": "agent"
374 },
375 {
376 "type": "transcript.text.segment",
377 "id": "seg_002",
378 "start": 4.7,
379 "end": 11.8,
380 "text": "Hi, I'm trying to enable diarization.",
381 "speaker": "A"
382 },
383 {
384 "type": "transcript.text.segment",
385 "id": "seg_003",
386 "start": 12.1,
387 "end": 18.5,
388 "text": "Happy to walk you through the steps.",
389 "speaker": "agent"
390 }
391 ],
392 "usage": {
393 "type": "duration",
394 "seconds": 27
395 }
396}
397```
398
399### Streaming
400
401```http
402curl https://api.openai.com/v1/audio/transcriptions \
403 -H "Authorization: Bearer $OPENAI_API_KEY" \
404 -H "Content-Type: multipart/form-data" \
405 -F file="@/path/to/file/audio.mp3" \
406 -F model="gpt-4o-mini-transcribe" \
407 -F stream=true
408```
409
410#### Response
411
412```json
413data: {"type":"transcript.text.delta","delta":"I","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]}]}
414
415data: {"type":"transcript.text.delta","delta":" see","logprobs":[{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]}]}
416
417data: {"type":"transcript.text.delta","delta":" skies","logprobs":[{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]}]}
418
419data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]}]}
420
421data: {"type":"transcript.text.delta","delta":" blue","logprobs":[{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]}]}
422
423data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]}]}
424
425data: {"type":"transcript.text.delta","delta":" clouds","logprobs":[{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]}]}
426
427data: {"type":"transcript.text.delta","delta":" of","logprobs":[{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]}]}
428
429data: {"type":"transcript.text.delta","delta":" white","logprobs":[{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]}]}
430
431data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0014890312,"bytes":[44]}]}
432
433data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]}]}
434
435data: {"type":"transcript.text.delta","delta":" bright","logprobs":[{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]}]}
436
437data: {"type":"transcript.text.delta","delta":" blessed","logprobs":[{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]}]}
438
439data: {"type":"transcript.text.delta","delta":" days","logprobs":[{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]}]}
440
441data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.00001700133,"bytes":[44]}]}
442
443data: {"type":"transcript.text.delta","delta":" the","logprobs":[{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]}]}
444
445data: {"type":"transcript.text.delta","delta":" dark","logprobs":[{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]}]}
446
447data: {"type":"transcript.text.delta","delta":" sacred","logprobs":[{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]}]}
448
449data: {"type":"transcript.text.delta","delta":" nights","logprobs":[{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]}]}
450
451data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.0036910512,"bytes":[44]}]}
452
453data: {"type":"transcript.text.delta","delta":" and","logprobs":[{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]}]}
454
455data: {"type":"transcript.text.delta","delta":" I","logprobs":[{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]}]}
456
457data: {"type":"transcript.text.delta","delta":" think","logprobs":[{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]}]}
458
459data: {"type":"transcript.text.delta","delta":" to","logprobs":[{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]}]}
460
461data: {"type":"transcript.text.delta","delta":" myself","logprobs":[{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]}]}
462
463data: {"type":"transcript.text.delta","delta":",","logprobs":[{"token":",","logprob":-0.29254505,"bytes":[44]}]}
464
465data: {"type":"transcript.text.delta","delta":" what","logprobs":[{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]}]}
466
467data: {"type":"transcript.text.delta","delta":" a","logprobs":[{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]}]}
468
469data: {"type":"transcript.text.delta","delta":" wonderful","logprobs":[{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]}]}
470
471data: {"type":"transcript.text.delta","delta":" world","logprobs":[{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]}]}
472
473data: {"type":"transcript.text.delta","delta":".","logprobs":[{"token":".","logprob":-0.014231676,"bytes":[46]}]}
474
475data: {"type":"transcript.text.done","text":"I see skies of blue and clouds of white, the bright blessed days, the dark sacred nights, and I think to myself, what a wonderful world.","logprobs":[{"token":"I","logprob":-0.00007588794,"bytes":[73]},{"token":" see","logprob":-3.1281633e-7,"bytes":[32,115,101,101]},{"token":" skies","logprob":-2.3392786e-6,"bytes":[32,115,107,105,101,115]},{"token":" of","logprob":-3.1281633e-7,"bytes":[32,111,102]},{"token":" blue","logprob":-1.0280384e-6,"bytes":[32,98,108,117,101]},{"token":" and","logprob":-0.0005108566,"bytes":[32,97,110,100]},{"token":" clouds","logprob":-1.9361265e-7,"bytes":[32,99,108,111,117,100,115]},{"token":" of","logprob":-1.9361265e-7,"bytes":[32,111,102]},{"token":" white","logprob":-7.89631e-7,"bytes":[32,119,104,105,116,101]},{"token":",","logprob":-0.0014890312,"bytes":[44]},{"token":" the","logprob":-0.0110956915,"bytes":[32,116,104,101]},{"token":" bright","logprob":0.0,"bytes":[32,98,114,105,103,104,116]},{"token":" blessed","logprob":-0.000045848617,"bytes":[32,98,108,101,115,115,101,100]},{"token":" days","logprob":-0.000010802739,"bytes":[32,100,97,121,115]},{"token":",","logprob":-0.00001700133,"bytes":[44]},{"token":" the","logprob":-0.0000118755715,"bytes":[32,116,104,101]},{"token":" dark","logprob":-5.5122365e-7,"bytes":[32,100,97,114,107]},{"token":" sacred","logprob":-5.4385737e-6,"bytes":[32,115,97,99,114,101,100]},{"token":" nights","logprob":-4.00813e-6,"bytes":[32,110,105,103,104,116,115]},{"token":",","logprob":-0.0036910512,"bytes":[44]},{"token":" and","logprob":-0.0031903093,"bytes":[32,97,110,100]},{"token":" I","logprob":-1.504853e-6,"bytes":[32,73]},{"token":" think","logprob":-4.3202e-7,"bytes":[32,116,104,105,110,107]},{"token":" to","logprob":-1.9361265e-7,"bytes":[32,116,111]},{"token":" myself","logprob":-1.7432603e-6,"bytes":[32,109,121,115,101,108,102]},{"token":",","logprob":-0.29254505,"bytes":[44]},{"token":" what","logprob":-0.016815351,"bytes":[32,119,104,97,116]},{"token":" a","logprob":-3.1281633e-7,"bytes":[32,97]},{"token":" wonderful","logprob":-2.1008714e-6,"bytes":[32,119,111,110,100,101,114,102,117,108]},{"token":" world","logprob":-8.180258e-6,"bytes":[32,119,111,114,108,100]},{"token":".","logprob":-0.014231676,"bytes":[46]}],"usage":{"input_tokens":14,"input_token_details":{"text_tokens":0,"audio_tokens":14},"output_tokens":45,"total_tokens":59}}
476```
477
478### Logprobs
479
480```http
481curl https://api.openai.com/v1/audio/transcriptions \
482 -H "Authorization: Bearer $OPENAI_API_KEY" \
483 -H "Content-Type: multipart/form-data" \
484 -F file="@/path/to/file/audio.mp3" \
485 -F "include[]=logprobs" \
486 -F model="gpt-4o-transcribe" \
487 -F response_format="json"
488```
489
490#### Response
491
492```json
493{
494 "text": "Hey, my knee is hurting and I want to see the doctor tomorrow ideally.",
495 "logprobs": [
496 { "token": "Hey", "logprob": -1.0415299, "bytes": [72, 101, 121] },
497 { "token": ",", "logprob": -9.805982e-5, "bytes": [44] },
498 { "token": " my", "logprob": -0.00229799, "bytes": [32, 109, 121] },
499 {
500 "token": " knee",
501 "logprob": -4.7159858e-5,
502 "bytes": [32, 107, 110, 101, 101]
503 },
504 { "token": " is", "logprob": -0.043909557, "bytes": [32, 105, 115] },
505 {
506 "token": " hurting",
507 "logprob": -1.1041146e-5,
508 "bytes": [32, 104, 117, 114, 116, 105, 110, 103]
509 },
510 { "token": " and", "logprob": -0.011076359, "bytes": [32, 97, 110, 100] },
511 { "token": " I", "logprob": -5.3193703e-6, "bytes": [32, 73] },
512 {
513 "token": " want",
514 "logprob": -0.0017156356,
515 "bytes": [32, 119, 97, 110, 116]
516 },
517 { "token": " to", "logprob": -7.89631e-7, "bytes": [32, 116, 111] },
518 { "token": " see", "logprob": -5.5122365e-7, "bytes": [32, 115, 101, 101] },
519 { "token": " the", "logprob": -0.0040786397, "bytes": [32, 116, 104, 101] },
520 {
521 "token": " doctor",
522 "logprob": -2.3392786e-6,
523 "bytes": [32, 100, 111, 99, 116, 111, 114]
524 },
525 {
526 "token": " tomorrow",
527 "logprob": -7.89631e-7,
528 "bytes": [32, 116, 111, 109, 111, 114, 114, 111, 119]
529 },
530 {
531 "token": " ideally",
532 "logprob": -0.5800861,
533 "bytes": [32, 105, 100, 101, 97, 108, 108, 121]
534 },
535 { "token": ".", "logprob": -0.00011093382, "bytes": [46] }
536 ],
537 "usage": {
538 "type": "tokens",
539 "input_tokens": 14,
540 "input_token_details": {
541 "text_tokens": 0,
542 "audio_tokens": 14
543 },
544 "output_tokens": 45,
545 "total_tokens": 59
546 }
547}
548```
549
550### Word timestamps
551
552```http
553curl https://api.openai.com/v1/audio/transcriptions \
554 -H "Authorization: Bearer $OPENAI_API_KEY" \
555 -H "Content-Type: multipart/form-data" \
556 -F file="@/path/to/file/audio.mp3" \
557 -F "timestamp_granularities[]=word" \
558 -F model="whisper-1" \
559 -F response_format="verbose_json"
560```
561
562#### Response
563
564```json
565{
566 "task": "transcribe",
567 "language": "english",
568 "duration": 8.470000267028809,
569 "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
570 "words": [
571 {
572 "word": "The",
573 "start": 0.0,
574 "end": 0.23999999463558197
575 },
576 ...
577 {
578 "word": "volleyball",
579 "start": 7.400000095367432,
580 "end": 7.900000095367432
581 }
582 ],
583 "usage": {
584 "type": "duration",
585 "seconds": 9
586 }
587}
588```
589
590### Segment timestamps
591
592```http
593curl https://api.openai.com/v1/audio/transcriptions \
594 -H "Authorization: Bearer $OPENAI_API_KEY" \
595 -H "Content-Type: multipart/form-data" \
596 -F file="@/path/to/file/audio.mp3" \
597 -F "timestamp_granularities[]=segment" \
598 -F model="whisper-1" \
599 -F response_format="verbose_json"
600```
601
602#### Response
603
604```json
605{
606 "task": "transcribe",
607 "language": "english",
608 "duration": 8.470000267028809,
609 "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
610 "segments": [
611 {
612 "id": 0,
613 "seek": 0,
614 "start": 0.0,
615 "end": 3.319999933242798,
616 "text": " The beach was a popular spot on a hot summer day.",
617 "tokens": [
618 50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530
619 ],
620 "temperature": 0.0,
621 "avg_logprob": -0.2860786020755768,
622 "compression_ratio": 1.2363636493682861,
623 "no_speech_prob": 0.00985979475080967
624 },
625 ...
626 ],
627 "usage": {
628 "type": "duration",
629 "seconds": 9
630 }
631}
632```
633
634## Domain Types
635
636### Transcription
637
638- `Transcription object { text, logprobs, usage }`
639
640 Represents a transcription response returned by model, based on the provided input.
641
642 - `text: string`
643
644 The transcribed text.
645
646 - `logprobs: optional array of object { token, bytes, logprob }`
647
648 The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array.
649
650 - `token: optional string`
651
652 The token in the transcription.
653
654 - `bytes: optional array of number`
655
656 The bytes of the token.
657
658 - `logprob: optional number`
659
660 The log probability of the token.
661
662 - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more } or object { seconds, type }`
663
664 Token usage statistics for the request.
665
666 - `TokenUsage object { input_tokens, output_tokens, total_tokens, 2 more }`
667
668 Usage statistics for models billed by token usage.
669
670 - `input_tokens: number`
671
672 Number of input tokens billed for this request.
673
674 - `output_tokens: number`
675
676 Number of output tokens generated.
677
678 - `total_tokens: number`
679
680 Total number of tokens used (input + output).
681
682 - `type: "tokens"`
683
684 The type of the usage object. Always `tokens` for this variant.
685
686 - `"tokens"`
687
688 - `input_token_details: optional object { audio_tokens, text_tokens }`
689
690 Details about the input tokens billed for this request.
691
692 - `audio_tokens: optional number`
693
694 Number of audio tokens billed for this request.
695
696 - `text_tokens: optional number`
697
698 Number of text tokens billed for this request.
699
700 - `DurationUsage object { seconds, type }`
701
702 Usage statistics for models billed by audio input duration.
703
704 - `seconds: number`
705
706 Duration of the input audio in seconds.
707
708 - `type: "duration"`
709
710 The type of the usage object. Always `duration` for this variant.
711
712 - `"duration"`
713
714### Transcription Diarized
715
716- `TranscriptionDiarized object { duration, segments, task, 2 more }`
717
718 Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.
719
720 - `duration: number`
721
722 Duration of the input audio in seconds.
723
724 - `segments: array of TranscriptionDiarizedSegment`
725
726 Segments of the transcript annotated with timestamps and speaker labels.
727
728 - `id: string`
729
730 Unique identifier for the segment.
731
732 - `end: number`
733
734 End timestamp of the segment in seconds.
735
736 - `speaker: string`
737
738 Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).
739
740 - `start: number`
741
742 Start timestamp of the segment in seconds.
743
744 - `text: string`
745
746 Transcript text for this segment.
747
748 - `type: "transcript.text.segment"`
749
750 The type of the segment. Always `transcript.text.segment`.
751
752 - `"transcript.text.segment"`
753
754 - `task: "transcribe"`
755
756 The type of task that was run. Always `transcribe`.
757
758 - `"transcribe"`
759
760 - `text: string`
761
762 The concatenated transcript text for the entire audio input.
763
764 - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more } or object { seconds, type }`
765
766 Token or duration usage statistics for the request.
767
768 - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`
769
770 Usage statistics for models billed by token usage.
771
772 - `input_tokens: number`
773
774 Number of input tokens billed for this request.
775
776 - `output_tokens: number`
777
778 Number of output tokens generated.
779
780 - `total_tokens: number`
781
782 Total number of tokens used (input + output).
783
784 - `type: "tokens"`
785
786 The type of the usage object. Always `tokens` for this variant.
787
788 - `"tokens"`
789
790 - `input_token_details: optional object { audio_tokens, text_tokens }`
791
792 Details about the input tokens billed for this request.
793
794 - `audio_tokens: optional number`
795
796 Number of audio tokens billed for this request.
797
798 - `text_tokens: optional number`
799
800 Number of text tokens billed for this request.
801
802 - `Duration object { seconds, type }`
803
804 Usage statistics for models billed by audio input duration.
805
806 - `seconds: number`
807
808 Duration of the input audio in seconds.
809
810 - `type: "duration"`
811
812 The type of the usage object. Always `duration` for this variant.
813
814 - `"duration"`
815
816### Transcription Diarized Segment
817
818- `TranscriptionDiarizedSegment object { id, end, speaker, 3 more }`
819
820 A segment of diarized transcript text with speaker metadata.
821
822 - `id: string`
823
824 Unique identifier for the segment.
825
826 - `end: number`
827
828 End timestamp of the segment in seconds.
829
830 - `speaker: string`
831
832 Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).
833
834 - `start: number`
835
836 Start timestamp of the segment in seconds.
837
838 - `text: string`
839
840 Transcript text for this segment.
841
842 - `type: "transcript.text.segment"`
843
844 The type of the segment. Always `transcript.text.segment`.
845
846 - `"transcript.text.segment"`
847
848### Transcription Include
849
850- `TranscriptionInclude = "logprobs"`
851
852 - `"logprobs"`
853
854### Transcription Segment
855
856- `TranscriptionSegment object { id, avg_logprob, compression_ratio, 7 more }`
857
858 - `id: number`
859
860 Unique identifier of the segment.
861
862 - `avg_logprob: number`
863
864 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
865
866 - `compression_ratio: number`
867
868 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
869
870 - `end: number`
871
872 End time of the segment in seconds.
873
874 - `no_speech_prob: number`
875
876 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.
877
878 - `seek: number`
879
880 Seek offset of the segment.
881
882 - `start: number`
883
884 Start time of the segment in seconds.
885
886 - `temperature: number`
887
888 Temperature parameter used for generating the segment.
889
890 - `text: string`
891
892 Text content of the segment.
893
894 - `tokens: array of number`
895
896 Array of token IDs for the text content.
897
898### Transcription Stream Event
899
900- `TranscriptionStreamEvent = TranscriptionTextSegmentEvent or TranscriptionTextDeltaEvent or TranscriptionTextDoneEvent`
901
902 Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`.
903
904 - `TranscriptionTextSegmentEvent object { id, end, speaker, 3 more }`
905
906 Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`.
907
908 - `id: string`
909
910 Unique identifier for the segment.
911
912 - `end: number`
913
914 End timestamp of the segment in seconds.
915
916 - `speaker: string`
917
918 Speaker label for this segment.
919
920 - `start: number`
921
922 Start timestamp of the segment in seconds.
923
924 - `text: string`
925
926 Transcript text for this segment.
927
928 - `type: "transcript.text.segment"`
929
930 The type of the event. Always `transcript.text.segment`.
931
932 - `"transcript.text.segment"`
933
934 - `TranscriptionTextDeltaEvent object { delta, type, logprobs, segment_id }`
935
936 Emitted when there is an additional text delta. This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`.
937
938 - `delta: string`
939
940 The text delta that was additionally transcribed.
941
942 - `type: "transcript.text.delta"`
943
944 The type of the event. Always `transcript.text.delta`.
945
946 - `"transcript.text.delta"`
947
948 - `logprobs: optional array of object { token, bytes, logprob }`
949
950 The log probabilities of the delta. Only included if you [create a transcription](/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
951
952 - `token: optional string`
953
954 The token that was used to generate the log probability.
955
956 - `bytes: optional array of number`
957
958 The bytes that were used to generate the log probability.
959
960 - `logprob: optional number`
961
962 The log probability of the token.
963
964 - `segment_id: optional string`
965
966 Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`.
967
968 - `TranscriptionTextDoneEvent object { text, type, logprobs, usage }`
969
970 Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`.
971
972 - `text: string`
973
974 The text that was transcribed.
975
976 - `type: "transcript.text.done"`
977
978 The type of the event. Always `transcript.text.done`.
979
980 - `"transcript.text.done"`
981
982 - `logprobs: optional array of object { token, bytes, logprob }`
983
984 The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
985
986 - `token: optional string`
987
988 The token that was used to generate the log probability.
989
990 - `bytes: optional array of number`
991
992 The bytes that were used to generate the log probability.
993
994 - `logprob: optional number`
995
996 The log probability of the token.
997
998 - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }`
999
1000 Usage statistics for models billed by token usage.
1001
1002 - `input_tokens: number`
1003
1004 Number of input tokens billed for this request.
1005
1006 - `output_tokens: number`
1007
1008 Number of output tokens generated.
1009
1010 - `total_tokens: number`
1011
1012 Total number of tokens used (input + output).
1013
1014 - `type: "tokens"`
1015
1016 The type of the usage object. Always `tokens` for this variant.
1017
1018 - `"tokens"`
1019
1020 - `input_token_details: optional object { audio_tokens, text_tokens }`
1021
1022 Details about the input tokens billed for this request.
1023
1024 - `audio_tokens: optional number`
1025
1026 Number of audio tokens billed for this request.
1027
1028 - `text_tokens: optional number`
1029
1030 Number of text tokens billed for this request.
1031
1032### Transcription Text Delta Event
1033
1034- `TranscriptionTextDeltaEvent object { delta, type, logprobs, segment_id }`
1035
1036 Emitted when there is an additional text delta. This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`.
1037
1038 - `delta: string`
1039
1040 The text delta that was additionally transcribed.
1041
1042 - `type: "transcript.text.delta"`
1043
1044 The type of the event. Always `transcript.text.delta`.
1045
1046 - `"transcript.text.delta"`
1047
1048 - `logprobs: optional array of object { token, bytes, logprob }`
1049
1050 The log probabilities of the delta. Only included if you [create a transcription](/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
1051
1052 - `token: optional string`
1053
1054 The token that was used to generate the log probability.
1055
1056 - `bytes: optional array of number`
1057
1058 The bytes that were used to generate the log probability.
1059
1060 - `logprob: optional number`
1061
1062 The log probability of the token.
1063
1064 - `segment_id: optional string`
1065
1066 Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`.
1067
1068### Transcription Text Done Event
1069
1070- `TranscriptionTextDoneEvent object { text, type, logprobs, usage }`
1071
1072 Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`.
1073
1074 - `text: string`
1075
1076 The text that was transcribed.
1077
1078 - `type: "transcript.text.done"`
1079
1080 The type of the event. Always `transcript.text.done`.
1081
1082 - `"transcript.text.done"`
1083
1084 - `logprobs: optional array of object { token, bytes, logprob }`
1085
1086 The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
1087
1088 - `token: optional string`
1089
1090 The token that was used to generate the log probability.
1091
1092 - `bytes: optional array of number`
1093
1094 The bytes that were used to generate the log probability.
1095
1096 - `logprob: optional number`
1097
1098 The log probability of the token.
1099
1100 - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more }`
1101
1102 Usage statistics for models billed by token usage.
1103
1104 - `input_tokens: number`
1105
1106 Number of input tokens billed for this request.
1107
1108 - `output_tokens: number`
1109
1110 Number of output tokens generated.
1111
1112 - `total_tokens: number`
1113
1114 Total number of tokens used (input + output).
1115
1116 - `type: "tokens"`
1117
1118 The type of the usage object. Always `tokens` for this variant.
1119
1120 - `"tokens"`
1121
1122 - `input_token_details: optional object { audio_tokens, text_tokens }`
1123
1124 Details about the input tokens billed for this request.
1125
1126 - `audio_tokens: optional number`
1127
1128 Number of audio tokens billed for this request.
1129
1130 - `text_tokens: optional number`
1131
1132 Number of text tokens billed for this request.
1133
1134### Transcription Text Segment Event
1135
1136- `TranscriptionTextSegmentEvent object { id, end, speaker, 3 more }`
1137
1138 Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`.
1139
1140 - `id: string`
1141
1142 Unique identifier for the segment.
1143
1144 - `end: number`
1145
1146 End timestamp of the segment in seconds.
1147
1148 - `speaker: string`
1149
1150 Speaker label for this segment.
1151
1152 - `start: number`
1153
1154 Start timestamp of the segment in seconds.
1155
1156 - `text: string`
1157
1158 Transcript text for this segment.
1159
1160 - `type: "transcript.text.segment"`
1161
1162 The type of the event. Always `transcript.text.segment`.
1163
1164 - `"transcript.text.segment"`
1165
1166### Transcription Verbose
1167
1168- `TranscriptionVerbose object { duration, language, text, 3 more }`
1169
1170 Represents a verbose json transcription response returned by model, based on the provided input.
1171
1172 - `duration: number`
1173
1174 The duration of the input audio.
1175
1176 - `language: string`
1177
1178 The language of the input audio.
1179
1180 - `text: string`
1181
1182 The transcribed text.
1183
1184 - `segments: optional array of TranscriptionSegment`
1185
1186 Segments of the transcribed text and their corresponding details.
1187
1188 - `id: number`
1189
1190 Unique identifier of the segment.
1191
1192 - `avg_logprob: number`
1193
1194 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
1195
1196 - `compression_ratio: number`
1197
1198 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
1199
1200 - `end: number`
1201
1202 End time of the segment in seconds.
1203
1204 - `no_speech_prob: number`
1205
1206 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.
1207
1208 - `seek: number`
1209
1210 Seek offset of the segment.
1211
1212 - `start: number`
1213
1214 Start time of the segment in seconds.
1215
1216 - `temperature: number`
1217
1218 Temperature parameter used for generating the segment.
1219
1220 - `text: string`
1221
1222 Text content of the segment.
1223
1224 - `tokens: array of number`
1225
1226 Array of token IDs for the text content.
1227
1228 - `usage: optional object { seconds, type }`
1229
1230 Usage statistics for models billed by audio input duration.
1231
1232 - `seconds: number`
1233
1234 Duration of the input audio in seconds.
1235
1236 - `type: "duration"`
1237
1238 The type of the usage object. Always `duration` for this variant.
1239
1240 - `"duration"`
1241
1242 - `words: optional array of TranscriptionWord`
1243
1244 Extracted words and their corresponding timestamps.
1245
1246 - `end: number`
1247
1248 End time of the word in seconds.
1249
1250 - `start: number`
1251
1252 Start time of the word in seconds.
1253
1254 - `word: string`
1255
1256 The text content of the word.
1257
1258### Transcription Word
1259
1260- `TranscriptionWord object { end, start, word }`
1261
1262 - `end: number`
1263
1264 End time of the word in seconds.
1265
1266 - `start: number`
1267
1268 Start time of the word in seconds.
1269
1270 - `word: string`
1271
1272 The text content of the word.
1273
1274### Transcription Create Response
1275
1276- `TranscriptionCreateResponse = Transcription or TranscriptionDiarized or TranscriptionVerbose`
1277
1278 Represents a transcription response returned by model, based on the provided input.
1279
1280 - `Transcription object { text, logprobs, usage }`
1281
1282 Represents a transcription response returned by model, based on the provided input.
1283
1284 - `text: string`
1285
1286 The transcribed text.
1287
1288 - `logprobs: optional array of object { token, bytes, logprob }`
1289
1290 The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array.
1291
1292 - `token: optional string`
1293
1294 The token in the transcription.
1295
1296 - `bytes: optional array of number`
1297
1298 The bytes of the token.
1299
1300 - `logprob: optional number`
1301
1302 The log probability of the token.
1303
1304 - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more } or object { seconds, type }`
1305
1306 Token usage statistics for the request.
1307
1308 - `TokenUsage object { input_tokens, output_tokens, total_tokens, 2 more }`
1309
1310 Usage statistics for models billed by token usage.
1311
1312 - `input_tokens: number`
1313
1314 Number of input tokens billed for this request.
1315
1316 - `output_tokens: number`
1317
1318 Number of output tokens generated.
1319
1320 - `total_tokens: number`
1321
1322 Total number of tokens used (input + output).
1323
1324 - `type: "tokens"`
1325
1326 The type of the usage object. Always `tokens` for this variant.
1327
1328 - `"tokens"`
1329
1330 - `input_token_details: optional object { audio_tokens, text_tokens }`
1331
1332 Details about the input tokens billed for this request.
1333
1334 - `audio_tokens: optional number`
1335
1336 Number of audio tokens billed for this request.
1337
1338 - `text_tokens: optional number`
1339
1340 Number of text tokens billed for this request.
1341
1342 - `DurationUsage object { seconds, type }`
1343
1344 Usage statistics for models billed by audio input duration.
1345
1346 - `seconds: number`
1347
1348 Duration of the input audio in seconds.
1349
1350 - `type: "duration"`
1351
1352 The type of the usage object. Always `duration` for this variant.
1353
1354 - `"duration"`
1355
1356 - `TranscriptionDiarized object { duration, segments, task, 2 more }`
1357
1358 Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.
1359
1360 - `duration: number`
1361
1362 Duration of the input audio in seconds.
1363
1364 - `segments: array of TranscriptionDiarizedSegment`
1365
1366 Segments of the transcript annotated with timestamps and speaker labels.
1367
1368 - `id: string`
1369
1370 Unique identifier for the segment.
1371
1372 - `end: number`
1373
1374 End timestamp of the segment in seconds.
1375
1376 - `speaker: string`
1377
1378 Speaker label for this segment. When known speakers are provided, the label matches `known_speaker_names[]`. Otherwise speakers are labeled sequentially using capital letters (`A`, `B`, ...).
1379
1380 - `start: number`
1381
1382 Start timestamp of the segment in seconds.
1383
1384 - `text: string`
1385
1386 Transcript text for this segment.
1387
1388 - `type: "transcript.text.segment"`
1389
1390 The type of the segment. Always `transcript.text.segment`.
1391
1392 - `"transcript.text.segment"`
1393
1394 - `task: "transcribe"`
1395
1396 The type of task that was run. Always `transcribe`.
1397
1398 - `"transcribe"`
1399
1400 - `text: string`
1401
1402 The concatenated transcript text for the entire audio input.
1403
1404 - `usage: optional object { input_tokens, output_tokens, total_tokens, 2 more } or object { seconds, type }`
1405
1406 Token or duration usage statistics for the request.
1407
1408 - `Tokens object { input_tokens, output_tokens, total_tokens, 2 more }`
1409
1410 Usage statistics for models billed by token usage.
1411
1412 - `input_tokens: number`
1413
1414 Number of input tokens billed for this request.
1415
1416 - `output_tokens: number`
1417
1418 Number of output tokens generated.
1419
1420 - `total_tokens: number`
1421
1422 Total number of tokens used (input + output).
1423
1424 - `type: "tokens"`
1425
1426 The type of the usage object. Always `tokens` for this variant.
1427
1428 - `"tokens"`
1429
1430 - `input_token_details: optional object { audio_tokens, text_tokens }`
1431
1432 Details about the input tokens billed for this request.
1433
1434 - `audio_tokens: optional number`
1435
1436 Number of audio tokens billed for this request.
1437
1438 - `text_tokens: optional number`
1439
1440 Number of text tokens billed for this request.
1441
1442 - `Duration object { seconds, type }`
1443
1444 Usage statistics for models billed by audio input duration.
1445
1446 - `seconds: number`
1447
1448 Duration of the input audio in seconds.
1449
1450 - `type: "duration"`
1451
1452 The type of the usage object. Always `duration` for this variant.
1453
1454 - `"duration"`
1455
1456 - `TranscriptionVerbose object { duration, language, text, 3 more }`
1457
1458 Represents a verbose json transcription response returned by model, based on the provided input.
1459
1460 - `duration: number`
1461
1462 The duration of the input audio.
1463
1464 - `language: string`
1465
1466 The language of the input audio.
1467
1468 - `text: string`
1469
1470 The transcribed text.
1471
1472 - `segments: optional array of TranscriptionSegment`
1473
1474 Segments of the transcribed text and their corresponding details.
1475
1476 - `id: number`
1477
1478 Unique identifier of the segment.
1479
1480 - `avg_logprob: number`
1481
1482 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
1483
1484 - `compression_ratio: number`
1485
1486 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
1487
1488 - `end: number`
1489
1490 End time of the segment in seconds.
1491
1492 - `no_speech_prob: number`
1493
1494 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.
1495
1496 - `seek: number`
1497
1498 Seek offset of the segment.
1499
1500 - `start: number`
1501
1502 Start time of the segment in seconds.
1503
1504 - `temperature: number`
1505
1506 Temperature parameter used for generating the segment.
1507
1508 - `text: string`
1509
1510 Text content of the segment.
1511
1512 - `tokens: array of number`
1513
1514 Array of token IDs for the text content.
1515
1516 - `usage: optional object { seconds, type }`
1517
1518 Usage statistics for models billed by audio input duration.
1519
1520 - `seconds: number`
1521
1522 Duration of the input audio in seconds.
1523
1524 - `type: "duration"`
1525
1526 The type of the usage object. Always `duration` for this variant.
1527
1528 - `"duration"`
1529
1530 - `words: optional array of TranscriptionWord`
1531
1532 Extracted words and their corresponding timestamps.
1533
1534 - `end: number`
1535
1536 End time of the word in seconds.
1537
1538 - `start: number`
1539
1540 Start time of the word in seconds.
1541
1542 - `word: string`
1543
1544 The text content of the word.