Class: OpenAI::Models::Audio::TranscriptionCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/openai/models/audio/transcription_create_params.rb,
sig/openai/models/audio/transcription_create_params.rbs

Overview

See Also:

  • OpenAI::Resources::Audio::Transcriptions#create
  • OpenAI::Resources::Audio::Transcriptions#create_streaming

Defined Under Namespace

Modules: ChunkingStrategy, Model, TimestampGranularity

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(file:, model:, chunking_strategy: nil, include: nil, keywords: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, languages: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Audio::TranscriptionCreateParams for more details.

Parameters:

  • file (Pathname, StringIO, IO, String, OpenAI::FilePart)

    The audio file object (not file name) to transcribe, in one of these formats: fl

  • model (String, Symbol, OpenAI::Models::AudioModel)

    ID of the model to use. The options are gpt-transcribe, gpt-4o-transcribe, `

  • chunking_strategy (Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig, nil) (defaults to: nil)

    Controls how the audio is cut into chunks. When set to "auto", the server firs

  • include (Array<Symbol, OpenAI::Models::Audio::TranscriptionInclude>) (defaults to: nil)

    Additional information to include in the transcription response.

  • keywords (Array<String>) (defaults to: nil)

    Words or phrases to guide transcription of the input audio. Supported by `gpt-tr

  • known_speaker_names (Array<String>) (defaults to: nil)

    Optional list of speaker names that correspond to the audio samples provided in

  • known_speaker_references (Array<String>) (defaults to: nil)

    Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-

  • language (String) (defaults to: nil)

    The language of the input audio. Supplying the input language in [ISO-639-1](htt

  • languages (Array<String>) (defaults to: nil)

    Possible languages of the input audio, in [ISO-639-1](https://en.wikipedia.org/w

  • prompt (String) (defaults to: nil)

    An optional text to guide the model's style or continue a previous audio segment

  • response_format (Symbol, OpenAI::Models::AudioResponseFormat) (defaults to: nil)

    The format of the output, in one of these options: json, text, srt, `verbo

  • temperature (Float) (defaults to: nil)

    The sampling temperature, between 0 and 1. Higher values like 0.8 will make the

  • timestamp_granularities (Array<Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity>) (defaults to: nil)

    The timestamp granularities to populate for this transcription. `response_format

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/openai/models/audio/transcription_create_params.rb', line 142

Instance Attribute Details

#chunking_strategySymbol, ...

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.

Parameters:

  • value (OpenAI::Models::Audio::TranscriptionCreateParams::chunking_strategy, nil)

Returns:



44
45
46
# File 'lib/openai/models/audio/transcription_create_params.rb', line 44

optional :chunking_strategy,
union: -> { OpenAI::Audio::TranscriptionCreateParams::ChunkingStrategy },
nil?: true

#filePathname, ...

The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. The request must include enough format metadata for the file to be identified. We recommend an extension-bearing filename and an appropriate content type.

String, StringIO, and pathless IO inputs are sent with generic upload metadata. Use OpenAI::FilePart when you need to override the filename or content type.

Parameters:

  • value (OpenAI::Internal::file_input)

Returns:



24
# File 'lib/openai/models/audio/transcription_create_params.rb', line 24

required :file, OpenAI::Internal::Type::FileInput

#includeArray<Symbol, OpenAI::Models::Audio::TranscriptionInclude>?

Additional information to include in the transcription response. logprobs will return the log probabilities of the tokens in the response to understand the model's confidence in the transcription. logprobs only works with response_format set to json and only with 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.

Returns:



57
# File 'lib/openai/models/audio/transcription_create_params.rb', line 57

optional :include, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionInclude] }

#keywordsArray<String>?

Words or phrases to guide transcription of the input audio. Supported by gpt-transcribe.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


64
# File 'lib/openai/models/audio/transcription_create_params.rb', line 64

optional :keywords, OpenAI::Internal::Type::ArrayOf[String]

#known_speaker_namesArray<String>?

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.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


72
# File 'lib/openai/models/audio/transcription_create_params.rb', line 72

optional :known_speaker_names, OpenAI::Internal::Type::ArrayOf[String]

#known_speaker_referencesArray<String>?

Optional list of audio samples (as 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.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


82
# File 'lib/openai/models/audio/transcription_create_params.rb', line 82

optional :known_speaker_references, OpenAI::Internal::Type::ArrayOf[String]

#languageString?

The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency.

Parameters:

  • (String)

Returns:

  • (String, nil)


90
# File 'lib/openai/models/audio/transcription_create_params.rb', line 90

optional :language, String

#languagesArray<String>?

Possible languages of the input audio, in ISO-639-1 format. Supported by gpt-transcribe.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


98
# File 'lib/openai/models/audio/transcription_create_params.rb', line 98

optional :languages, OpenAI::Internal::Type::ArrayOf[String]

#modelString, ...

ID of the model to use. The options are gpt-transcribe, 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.

Parameters:

  • value (OpenAI::Models::Audio::TranscriptionCreateParams::model)

Returns:



33
# File 'lib/openai/models/audio/transcription_create_params.rb', line 33

required :model, union: -> { OpenAI::Audio::TranscriptionCreateParams::Model }

#promptString?

An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language. This field is not supported when using gpt-4o-transcribe-diarize.

Parameters:

  • (String)

Returns:

  • (String, nil)


108
# File 'lib/openai/models/audio/transcription_create_params.rb', line 108

optional :prompt, String

#response_formatSymbol, ...

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.

Returns:



118
# File 'lib/openai/models/audio/transcription_create_params.rb', line 118

optional :response_format, enum: -> { OpenAI::AudioResponseFormat }

#temperatureFloat?

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 to automatically increase the temperature until certain thresholds are hit.

Parameters:

  • (Float)

Returns:

  • (Float, nil)


128
# File 'lib/openai/models/audio/transcription_create_params.rb', line 128

optional :temperature, Float

#timestamp_granularitiesArray<Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity>?

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. This option is not available for gpt-4o-transcribe-diarize.



139
140
# File 'lib/openai/models/audio/transcription_create_params.rb', line 139

optional :timestamp_granularities,
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionCreateParams::TimestampGranularity] }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/audio/transcription_create_params.rb', line 254

.variantsArray(Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig)



# File 'lib/openai/models/audio/transcription_create_params.rb', line 186

Instance Method Details

#to_hash{

Returns:

  • ({)


95
# File 'sig/openai/models/audio/transcription_create_params.rbs', line 95

def to_hash: -> {