go/resources/audio/subresources/transcriptions/index.md +0 −981 deleted
File Deleted View Diff
1# Transcriptions
2
3## Create transcription
4
5`client.Audio.Transcriptions.New(ctx, body) (*AudioTranscriptionNewResponseUnion, error)`
6
7**post** `/audio/transcriptions`
8
9Transcribes audio into the input language.
10
11Returns a transcription object in `json`, `diarized_json`, or `verbose_json`
12format, or a stream of transcript events.
13
14### Parameters
15
16- `body AudioTranscriptionNewParams`
17
18 - `File param.Field[Reader]`
19
20 The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
21
22 - `Model param.Field[AudioModel]`
23
24 ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`.
25
26 - `string`
27
28 - `type AudioModel string`
29
30 - `const AudioModelWhisper1 AudioModel = "whisper-1"`
31
32 - `const AudioModelGPT4oTranscribe AudioModel = "gpt-4o-transcribe"`
33
34 - `const AudioModelGPT4oMiniTranscribe AudioModel = "gpt-4o-mini-transcribe"`
35
36 - `const AudioModelGPT4oMiniTranscribe2025_12_15 AudioModel = "gpt-4o-mini-transcribe-2025-12-15"`
37
38 - `const AudioModelGPT4oTranscribeDiarize AudioModel = "gpt-4o-transcribe-diarize"`
39
40 - `ChunkingStrategy param.Field[AudioTranscriptionNewParamsChunkingStrategyUnion]`
41
42 Controls how the audio is cut into chunks. When set to `"auto"`, the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. `server_vad` object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. Required when using `gpt-4o-transcribe-diarize` for inputs longer than 30 seconds.
43
44 - `Auto`
45
46 - `const AutoAuto Auto = "auto"`
47
48 - `AudioTranscriptionNewParamsChunkingStrategyVadConfig`
49
50 - `Type string`
51
52 Must be set to `server_vad` to enable manual chunking using server side VAD.
53
54 - `const AudioTranscriptionNewParamsChunkingStrategyVadConfigTypeServerVad AudioTranscriptionNewParamsChunkingStrategyVadConfigType = "server_vad"`
55
56 - `PrefixPaddingMs int64`
57
58 Amount of audio to include before the VAD detected speech (in
59 milliseconds).
60
61 - `SilenceDurationMs int64`
62
63 Duration of silence to detect speech stop (in milliseconds).
64 With shorter values the model will respond more quickly,
65 but may jump in on short pauses from the user.
66
67 - `Threshold float64`
68
69 Sensitivity threshold (0.0 to 1.0) for voice activity detection. A
70 higher threshold will require louder audio to activate the model, and
71 thus might perform better in noisy environments.
72
73 - `Include param.Field[[]TranscriptionInclude]`
74
75 Additional information to include in the transcription response.
76 `logprobs` will return the log probabilities of the tokens in the
77 response to understand the model's confidence in the transcription.
78 `logprobs` only works with response_format set to `json` and only with
79 the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`.
80
81 - `const TranscriptionIncludeLogprobs TranscriptionInclude = "logprobs"`
82
83 - `KnownSpeakerNames param.Field[[]string]`
84
85 Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported.
86
87 - `KnownSpeakerReferences param.Field[[]string]`
88
89 Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) that contain known speaker references matching `known_speaker_names[]`. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by `file`.
90
91 - `Language param.Field[string]`
92
93 The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency.
94
95 - `Prompt param.Field[string]`
96
97 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 match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`.
98
99 - `ResponseFormat param.Field[AudioResponseFormat]`
100
101 The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. For `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and `diarized_json`, with `diarized_json` required to receive speaker annotations.
102
103 - ``
104
105 - `Temperature param.Field[float64]`
106
107 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.
108
109 - `TimestampGranularities param.Field[[]string]`
110
111 The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
112 This option is not available for `gpt-4o-transcribe-diarize`.
113
114 - `const AudioTranscriptionNewParamsTimestampGranularityWord AudioTranscriptionNewParamsTimestampGranularity = "word"`
115
116 - `const AudioTranscriptionNewParamsTimestampGranularitySegment AudioTranscriptionNewParamsTimestampGranularity = "segment"`
117
118### Returns
119
120- `type AudioTranscriptionNewResponseUnion interface{…}`
121
122 Represents a transcription response returned by model, based on the provided input.
123
124 - `type Transcription struct{…}`
125
126 Represents a transcription response returned by model, based on the provided input.
127
128 - `Text string`
129
130 The transcribed text.
131
132 - `Logprobs []TranscriptionLogprob`
133
134 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.
135
136 - `Token string`
137
138 The token in the transcription.
139
140 - `Bytes []float64`
141
142 The bytes of the token.
143
144 - `Logprob float64`
145
146 The log probability of the token.
147
148 - `Usage TranscriptionUsageUnion`
149
150 Token usage statistics for the request.
151
152 - `type TranscriptionUsageTokens struct{…}`
153
154 Usage statistics for models billed by token usage.
155
156 - `InputTokens int64`
157
158 Number of input tokens billed for this request.
159
160 - `OutputTokens int64`
161
162 Number of output tokens generated.
163
164 - `TotalTokens int64`
165
166 Total number of tokens used (input + output).
167
168 - `Type Tokens`
169
170 The type of the usage object. Always `tokens` for this variant.
171
172 - `const TokensTokens Tokens = "tokens"`
173
174 - `InputTokenDetails TranscriptionUsageTokensInputTokenDetails`
175
176 Details about the input tokens billed for this request.
177
178 - `AudioTokens int64`
179
180 Number of audio tokens billed for this request.
181
182 - `TextTokens int64`
183
184 Number of text tokens billed for this request.
185
186 - `type TranscriptionUsageDuration struct{…}`
187
188 Usage statistics for models billed by audio input duration.
189
190 - `Seconds float64`
191
192 Duration of the input audio in seconds.
193
194 - `Type Duration`
195
196 The type of the usage object. Always `duration` for this variant.
197
198 - `const DurationDuration Duration = "duration"`
199
200 - `type TranscriptionVerbose struct{…}`
201
202 Represents a verbose json transcription response returned by model, based on the provided input.
203
204 - `Duration float64`
205
206 The duration of the input audio.
207
208 - `Language string`
209
210 The language of the input audio.
211
212 - `Text string`
213
214 The transcribed text.
215
216 - `Segments []TranscriptionSegment`
217
218 Segments of the transcribed text and their corresponding details.
219
220 - `ID int64`
221
222 Unique identifier of the segment.
223
224 - `AvgLogprob float64`
225
226 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
227
228 - `CompressionRatio float64`
229
230 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
231
232 - `End float64`
233
234 End time of the segment in seconds.
235
236 - `NoSpeechProb float64`
237
238 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.
239
240 - `Seek int64`
241
242 Seek offset of the segment.
243
244 - `Start float64`
245
246 Start time of the segment in seconds.
247
248 - `Temperature float64`
249
250 Temperature parameter used for generating the segment.
251
252 - `Text string`
253
254 Text content of the segment.
255
256 - `Tokens []int64`
257
258 Array of token IDs for the text content.
259
260 - `Usage TranscriptionVerboseUsage`
261
262 Usage statistics for models billed by audio input duration.
263
264 - `Seconds float64`
265
266 Duration of the input audio in seconds.
267
268 - `Type Duration`
269
270 The type of the usage object. Always `duration` for this variant.
271
272 - `const DurationDuration Duration = "duration"`
273
274 - `Words []TranscriptionWord`
275
276 Extracted words and their corresponding timestamps.
277
278 - `End float64`
279
280 End time of the word in seconds.
281
282 - `Start float64`
283
284 Start time of the word in seconds.
285
286 - `Word string`
287
288 The text content of the word.
289
290### Example
291
292```go
293package main
294
295import (
296 "bytes"
297 "context"
298 "fmt"
299 "io"
300
301 "github.com/openai/openai-go"
302 "github.com/openai/openai-go/option"
303)
304
305func main() {
306 client := openai.NewClient(
307 option.WithAPIKey("My API Key"),
308 )
309 transcription, err := client.Audio.Transcriptions.New(context.TODO(), openai.AudioTranscriptionNewParams{
310 File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
311 Model: openai.AudioModelGPT4oTranscribe,
312 })
313 if err != nil {
314 panic(err.Error())
315 }
316 fmt.Printf("%+v\n", transcription)
317}
318```
319
320#### Response
321
322```json
323{
324 "text": "text",
325 "logprobs": [
326 {
327 "token": "token",
328 "bytes": [
329 0
330 ],
331 "logprob": 0
332 }
333 ],
334 "usage": {
335 "input_tokens": 0,
336 "output_tokens": 0,
337 "total_tokens": 0,
338 "type": "tokens",
339 "input_token_details": {
340 "audio_tokens": 0,
341 "text_tokens": 0
342 }
343 }
344}
345```
346
347## Domain Types
348
349### Transcription
350
351- `type Transcription struct{…}`
352
353 Represents a transcription response returned by model, based on the provided input.
354
355 - `Text string`
356
357 The transcribed text.
358
359 - `Logprobs []TranscriptionLogprob`
360
361 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.
362
363 - `Token string`
364
365 The token in the transcription.
366
367 - `Bytes []float64`
368
369 The bytes of the token.
370
371 - `Logprob float64`
372
373 The log probability of the token.
374
375 - `Usage TranscriptionUsageUnion`
376
377 Token usage statistics for the request.
378
379 - `type TranscriptionUsageTokens struct{…}`
380
381 Usage statistics for models billed by token usage.
382
383 - `InputTokens int64`
384
385 Number of input tokens billed for this request.
386
387 - `OutputTokens int64`
388
389 Number of output tokens generated.
390
391 - `TotalTokens int64`
392
393 Total number of tokens used (input + output).
394
395 - `Type Tokens`
396
397 The type of the usage object. Always `tokens` for this variant.
398
399 - `const TokensTokens Tokens = "tokens"`
400
401 - `InputTokenDetails TranscriptionUsageTokensInputTokenDetails`
402
403 Details about the input tokens billed for this request.
404
405 - `AudioTokens int64`
406
407 Number of audio tokens billed for this request.
408
409 - `TextTokens int64`
410
411 Number of text tokens billed for this request.
412
413 - `type TranscriptionUsageDuration struct{…}`
414
415 Usage statistics for models billed by audio input duration.
416
417 - `Seconds float64`
418
419 Duration of the input audio in seconds.
420
421 - `Type Duration`
422
423 The type of the usage object. Always `duration` for this variant.
424
425 - `const DurationDuration Duration = "duration"`
426
427### Transcription Diarized
428
429- `type TranscriptionDiarized struct{…}`
430
431 Represents a diarized transcription response returned by the model, including the combined transcript and speaker-segment annotations.
432
433 - `Duration float64`
434
435 Duration of the input audio in seconds.
436
437 - `Segments []TranscriptionDiarizedSegment`
438
439 Segments of the transcript annotated with timestamps and speaker labels.
440
441 - `ID string`
442
443 Unique identifier for the segment.
444
445 - `End float64`
446
447 End timestamp of the segment in seconds.
448
449 - `Speaker string`
450
451 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`, ...).
452
453 - `Start float64`
454
455 Start timestamp of the segment in seconds.
456
457 - `Text string`
458
459 Transcript text for this segment.
460
461 - `Type TranscriptTextSegment`
462
463 The type of the segment. Always `transcript.text.segment`.
464
465 - `const TranscriptTextSegmentTranscriptTextSegment TranscriptTextSegment = "transcript.text.segment"`
466
467 - `Task Transcribe`
468
469 The type of task that was run. Always `transcribe`.
470
471 - `const TranscribeTranscribe Transcribe = "transcribe"`
472
473 - `Text string`
474
475 The concatenated transcript text for the entire audio input.
476
477 - `Usage TranscriptionDiarizedUsageUnion`
478
479 Token or duration usage statistics for the request.
480
481 - `TranscriptionDiarizedUsageTokens`
482
483 - `InputTokens int64`
484
485 Number of input tokens billed for this request.
486
487 - `OutputTokens int64`
488
489 Number of output tokens generated.
490
491 - `TotalTokens int64`
492
493 Total number of tokens used (input + output).
494
495 - `Type Tokens`
496
497 The type of the usage object. Always `tokens` for this variant.
498
499 - `const TokensTokens Tokens = "tokens"`
500
501 - `InputTokenDetails TranscriptionDiarizedUsageTokensInputTokenDetails`
502
503 Details about the input tokens billed for this request.
504
505 - `AudioTokens int64`
506
507 Number of audio tokens billed for this request.
508
509 - `TextTokens int64`
510
511 Number of text tokens billed for this request.
512
513 - `TranscriptionDiarizedUsageDuration`
514
515 - `Seconds float64`
516
517 Duration of the input audio in seconds.
518
519 - `Type Duration`
520
521 The type of the usage object. Always `duration` for this variant.
522
523 - `const DurationDuration Duration = "duration"`
524
525### Transcription Diarized Segment
526
527- `type TranscriptionDiarizedSegment struct{…}`
528
529 A segment of diarized transcript text with speaker metadata.
530
531 - `ID string`
532
533 Unique identifier for the segment.
534
535 - `End float64`
536
537 End timestamp of the segment in seconds.
538
539 - `Speaker string`
540
541 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`, ...).
542
543 - `Start float64`
544
545 Start timestamp of the segment in seconds.
546
547 - `Text string`
548
549 Transcript text for this segment.
550
551 - `Type TranscriptTextSegment`
552
553 The type of the segment. Always `transcript.text.segment`.
554
555 - `const TranscriptTextSegmentTranscriptTextSegment TranscriptTextSegment = "transcript.text.segment"`
556
557### Transcription Include
558
559- `type TranscriptionInclude string`
560
561 - `const TranscriptionIncludeLogprobs TranscriptionInclude = "logprobs"`
562
563### Transcription Segment
564
565- `type TranscriptionSegment struct{…}`
566
567 - `ID int64`
568
569 Unique identifier of the segment.
570
571 - `AvgLogprob float64`
572
573 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
574
575 - `CompressionRatio float64`
576
577 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
578
579 - `End float64`
580
581 End time of the segment in seconds.
582
583 - `NoSpeechProb float64`
584
585 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.
586
587 - `Seek int64`
588
589 Seek offset of the segment.
590
591 - `Start float64`
592
593 Start time of the segment in seconds.
594
595 - `Temperature float64`
596
597 Temperature parameter used for generating the segment.
598
599 - `Text string`
600
601 Text content of the segment.
602
603 - `Tokens []int64`
604
605 Array of token IDs for the text content.
606
607### Transcription Stream Event
608
609- `type TranscriptionStreamEventUnion interface{…}`
610
611 Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`.
612
613 - `type TranscriptionTextSegmentEvent struct{…}`
614
615 Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`.
616
617 - `ID string`
618
619 Unique identifier for the segment.
620
621 - `End float64`
622
623 End timestamp of the segment in seconds.
624
625 - `Speaker string`
626
627 Speaker label for this segment.
628
629 - `Start float64`
630
631 Start timestamp of the segment in seconds.
632
633 - `Text string`
634
635 Transcript text for this segment.
636
637 - `Type TranscriptTextSegment`
638
639 The type of the event. Always `transcript.text.segment`.
640
641 - `const TranscriptTextSegmentTranscriptTextSegment TranscriptTextSegment = "transcript.text.segment"`
642
643 - `type TranscriptionTextDeltaEvent struct{…}`
644
645 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](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`.
646
647 - `Delta string`
648
649 The text delta that was additionally transcribed.
650
651 - `Type TranscriptTextDelta`
652
653 The type of the event. Always `transcript.text.delta`.
654
655 - `const TranscriptTextDeltaTranscriptTextDelta TranscriptTextDelta = "transcript.text.delta"`
656
657 - `Logprobs []TranscriptionTextDeltaEventLogprob`
658
659 The log probabilities of the delta. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
660
661 - `Token string`
662
663 The token that was used to generate the log probability.
664
665 - `Bytes []int64`
666
667 The bytes that were used to generate the log probability.
668
669 - `Logprob float64`
670
671 The log probability of the token.
672
673 - `SegmentID string`
674
675 Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`.
676
677 - `type TranscriptionTextDoneEvent struct{…}`
678
679 Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`.
680
681 - `Text string`
682
683 The text that was transcribed.
684
685 - `Type TranscriptTextDone`
686
687 The type of the event. Always `transcript.text.done`.
688
689 - `const TranscriptTextDoneTranscriptTextDone TranscriptTextDone = "transcript.text.done"`
690
691 - `Logprobs []TranscriptionTextDoneEventLogprob`
692
693 The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
694
695 - `Token string`
696
697 The token that was used to generate the log probability.
698
699 - `Bytes []int64`
700
701 The bytes that were used to generate the log probability.
702
703 - `Logprob float64`
704
705 The log probability of the token.
706
707 - `Usage TranscriptionTextDoneEventUsage`
708
709 Usage statistics for models billed by token usage.
710
711 - `InputTokens int64`
712
713 Number of input tokens billed for this request.
714
715 - `OutputTokens int64`
716
717 Number of output tokens generated.
718
719 - `TotalTokens int64`
720
721 Total number of tokens used (input + output).
722
723 - `Type Tokens`
724
725 The type of the usage object. Always `tokens` for this variant.
726
727 - `const TokensTokens Tokens = "tokens"`
728
729 - `InputTokenDetails TranscriptionTextDoneEventUsageInputTokenDetails`
730
731 Details about the input tokens billed for this request.
732
733 - `AudioTokens int64`
734
735 Number of audio tokens billed for this request.
736
737 - `TextTokens int64`
738
739 Number of text tokens billed for this request.
740
741### Transcription Text Delta Event
742
743- `type TranscriptionTextDeltaEvent struct{…}`
744
745 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](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`.
746
747 - `Delta string`
748
749 The text delta that was additionally transcribed.
750
751 - `Type TranscriptTextDelta`
752
753 The type of the event. Always `transcript.text.delta`.
754
755 - `const TranscriptTextDeltaTranscriptTextDelta TranscriptTextDelta = "transcript.text.delta"`
756
757 - `Logprobs []TranscriptionTextDeltaEventLogprob`
758
759 The log probabilities of the delta. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
760
761 - `Token string`
762
763 The token that was used to generate the log probability.
764
765 - `Bytes []int64`
766
767 The bytes that were used to generate the log probability.
768
769 - `Logprob float64`
770
771 The log probability of the token.
772
773 - `SegmentID string`
774
775 Identifier of the diarized segment that this delta belongs to. Only present when using `gpt-4o-transcribe-diarize`.
776
777### Transcription Text Done Event
778
779- `type TranscriptionTextDoneEvent struct{…}`
780
781 Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`.
782
783 - `Text string`
784
785 The text that was transcribed.
786
787 - `Type TranscriptTextDone`
788
789 The type of the event. Always `transcript.text.done`.
790
791 - `const TranscriptTextDoneTranscriptTextDone TranscriptTextDone = "transcript.text.done"`
792
793 - `Logprobs []TranscriptionTextDoneEventLogprob`
794
795 The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`.
796
797 - `Token string`
798
799 The token that was used to generate the log probability.
800
801 - `Bytes []int64`
802
803 The bytes that were used to generate the log probability.
804
805 - `Logprob float64`
806
807 The log probability of the token.
808
809 - `Usage TranscriptionTextDoneEventUsage`
810
811 Usage statistics for models billed by token usage.
812
813 - `InputTokens int64`
814
815 Number of input tokens billed for this request.
816
817 - `OutputTokens int64`
818
819 Number of output tokens generated.
820
821 - `TotalTokens int64`
822
823 Total number of tokens used (input + output).
824
825 - `Type Tokens`
826
827 The type of the usage object. Always `tokens` for this variant.
828
829 - `const TokensTokens Tokens = "tokens"`
830
831 - `InputTokenDetails TranscriptionTextDoneEventUsageInputTokenDetails`
832
833 Details about the input tokens billed for this request.
834
835 - `AudioTokens int64`
836
837 Number of audio tokens billed for this request.
838
839 - `TextTokens int64`
840
841 Number of text tokens billed for this request.
842
843### Transcription Text Segment Event
844
845- `type TranscriptionTextSegmentEvent struct{…}`
846
847 Emitted when a diarized transcription returns a completed segment with speaker information. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with `stream` set to `true` and `response_format` set to `diarized_json`.
848
849 - `ID string`
850
851 Unique identifier for the segment.
852
853 - `End float64`
854
855 End timestamp of the segment in seconds.
856
857 - `Speaker string`
858
859 Speaker label for this segment.
860
861 - `Start float64`
862
863 Start timestamp of the segment in seconds.
864
865 - `Text string`
866
867 Transcript text for this segment.
868
869 - `Type TranscriptTextSegment`
870
871 The type of the event. Always `transcript.text.segment`.
872
873 - `const TranscriptTextSegmentTranscriptTextSegment TranscriptTextSegment = "transcript.text.segment"`
874
875### Transcription Verbose
876
877- `type TranscriptionVerbose struct{…}`
878
879 Represents a verbose json transcription response returned by model, based on the provided input.
880
881 - `Duration float64`
882
883 The duration of the input audio.
884
885 - `Language string`
886
887 The language of the input audio.
888
889 - `Text string`
890
891 The transcribed text.
892
893 - `Segments []TranscriptionSegment`
894
895 Segments of the transcribed text and their corresponding details.
896
897 - `ID int64`
898
899 Unique identifier of the segment.
900
901 - `AvgLogprob float64`
902
903 Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
904
905 - `CompressionRatio float64`
906
907 Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
908
909 - `End float64`
910
911 End time of the segment in seconds.
912
913 - `NoSpeechProb float64`
914
915 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.
916
917 - `Seek int64`
918
919 Seek offset of the segment.
920
921 - `Start float64`
922
923 Start time of the segment in seconds.
924
925 - `Temperature float64`
926
927 Temperature parameter used for generating the segment.
928
929 - `Text string`
930
931 Text content of the segment.
932
933 - `Tokens []int64`
934
935 Array of token IDs for the text content.
936
937 - `Usage TranscriptionVerboseUsage`
938
939 Usage statistics for models billed by audio input duration.
940
941 - `Seconds float64`
942
943 Duration of the input audio in seconds.
944
945 - `Type Duration`
946
947 The type of the usage object. Always `duration` for this variant.
948
949 - `const DurationDuration Duration = "duration"`
950
951 - `Words []TranscriptionWord`
952
953 Extracted words and their corresponding timestamps.
954
955 - `End float64`
956
957 End time of the word in seconds.
958
959 - `Start float64`
960
961 Start time of the word in seconds.
962
963 - `Word string`
964
965 The text content of the word.
966
967### Transcription Word
968
969- `type TranscriptionWord struct{…}`
970
971 - `End float64`
972
973 End time of the word in seconds.
974
975 - `Start float64`
976
977 Start time of the word in seconds.
978
979 - `Word string`
980
981 The text content of the word.