class RealtimeSessionCreateRequest:

Realtime session object configuration.

JsonValue; type
constant
constant

The type of session to create. Always realtime for the Realtime API.

Optional<RealtimeAudioConfig> audio

Configuration for input and output audio.

Optional<RealtimeAudioConfigInput> input
Optional<RealtimeAudioFormats> format

The format of the input audio.

One of the following:
AudioPcm
This type repeats the enclosing schema.
AudioPcmu
This type repeats the enclosing schema.
AudioPcma
This type repeats the enclosing schema.
Optional<NoiseReduction> noiseReduction

Configuration for input audio noise reduction. This can be set to null to turn off. Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.

Optional<Double> strength

Input noise suppression strength. Higher values apply more suppression. Defaults to 1 when noise reduction is first enabled. Omitting strength from a session update preserves the current strength.

minimum0
maximum1
Optional<NoiseReductionType> type

Type of noise reduction. near_field is for close-talking microphones such as headphones, far_field is for far-field microphones such as laptop or conference room microphones.

One of the following:
NEAR_FIELD("near_field")
FAR_FIELD("far_field")
Optional<AudioTranscription> transcription

Configuration for input audio transcription, defaults to off and can be set to null to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through the /audio/transcriptions endpoint and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.

Optional<Delay> delay

Controls how long the model waits before emitting transcription text. Higher values can improve transcription accuracy at the cost of latency. Only supported with gpt-realtime-whisper in GA Realtime sessions.

One of the following:
MINIMAL("minimal")
LOW("low")
MEDIUM("medium")
HIGH("high")
XHIGH("xhigh")
Optional<List<String>> keywords

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

Optional<String> language

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

Optional<List<String>> languages

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

minItems1
Optional<Model> model

The model to use for transcription. Current options are whisper-1, gpt-transcribe, gpt-live-transcribe, gpt-4o-mini-transcribe, gpt-4o-mini-transcribe-2025-12-15, gpt-4o-transcribe, gpt-4o-transcribe-diarize, and gpt-realtime-whisper. Use gpt-4o-transcribe-diarize when you need diarization with speaker labels.

One of the following:
GPT_TRANSCRIBE("gpt-transcribe")
GPT_LIVE_TRANSCRIBE("gpt-live-transcribe")
GPT_REALTIME_WHISPER("gpt-realtime-whisper")
WHISPER_1("whisper-1")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_4O_MINI_TRANSCRIBE("gpt-4o-mini-transcribe")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_4O_MINI_TRANSCRIBE_2025_12_15("gpt-4o-mini-transcribe-2025-12-15")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_4O_TRANSCRIBE("gpt-4o-transcribe")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_4O_TRANSCRIBE_DIARIZE("gpt-4o-transcribe-diarize")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

Optional<String> prompt

An optional text to guide the model’s style or continue a previous audio segment. For whisper-1, the prompt is a list of keywords. For gpt-4o-transcribe models (excluding gpt-4o-transcribe-diarize), the prompt is a free text string, for example “expect words related to technology”. Prompt is not supported with gpt-realtime-whisper in GA Realtime sessions.

Optional<RealtimeAudioInputTurnDetection> turnDetection

Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to null to turn off, in which case the client must manually trigger model response.

Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.

Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with “uhhm”, the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency.

For gpt-realtime-whisper transcription sessions, turn detection must be set to null; VAD is not supported.

One of the following:
ServerVad
This type repeats the enclosing schema.
SemanticVad
This type repeats the enclosing schema.
Optional<RealtimeAudioConfigOutput> output
Optional<RealtimeAudioFormats> format

The format of the output audio.

One of the following:
AudioPcm
This type repeats the enclosing schema.
AudioPcmu
This type repeats the enclosing schema.
AudioPcma
This type repeats the enclosing schema.
Optional<Double> speed

The speed of the model’s spoken response as a multiple of the original speed. 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed. This value can only be changed in between model turns, not while a response is in progress.

This parameter is a post-processing adjustment to the audio after it is generated, it’s also possible to prompt the model to speak faster or slower.

minimum0.25
maximum1.5
Optional<Voice> voice

The voice the model uses to respond. Supported built-in voices are alloy, ash, ballad, coral, echo, sage, shimmer, verse, marin, and cedar. You may also provide a custom voice object with an id, for example { "id": "voice_1234" }. Voice cannot be changed during the session once the model has responded with audio at least once. Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live. We recommend marin and cedar for best quality.

One of the following:
String
enum UnionMember1:
ALLOY("alloy")
ASH("ash")
BALLAD("ballad")
CORAL("coral")
ECHO("echo")
SAGE("sage")
SHIMMER("shimmer")
VERSE("verse")
MARIN("marin")
CEDAR("cedar")
class Id:

Custom voice reference.

String id

The custom voice ID, e.g. voice_1234.

Optional<List<Include>> include

Additional fields to include in server outputs.

item.input_audio_transcription.logprobs: Include logprobs for input audio transcription.

Optional<String> instructions

The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. “be extremely succinct”, “act friendly”, “here are examples of good responses”) and on audio behavior (e.g. “talk quickly”, “inject emotion into your voice”, “laugh frequently”). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.

Note that the server sets default instructions which will be used if this field is not set and are visible in the session.created event at the start of the session.

Optional<MaxOutputTokens> maxOutputTokens

Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or inf for the maximum available tokens for a given model. Defaults to inf.

One of the following:
long
JsonValue;
Optional<Model> model

The Realtime model used for this session.

One of the following:
GPT_REALTIME_1_5("gpt-realtime-1.5")
GPT_REALTIME_2("gpt-realtime-2")
GPT_REALTIME_2_1("gpt-realtime-2.1")
GPT_REALTIME_2_1_MINI("gpt-realtime-2.1-mini")
GPT_4O_REALTIME_PREVIEW("gpt-4o-realtime-preview")
GPT_4O_REALTIME_PREVIEW_2024_10_01("gpt-4o-realtime-preview-2024-10-01")
GPT_4O_REALTIME_PREVIEW_2024_12_17("gpt-4o-realtime-preview-2024-12-17")
GPT_4O_REALTIME_PREVIEW_2025_06_03("gpt-4o-realtime-preview-2025-06-03")
GPT_4O_MINI_REALTIME_PREVIEW("gpt-4o-mini-realtime-preview")
GPT_4O_MINI_REALTIME_PREVIEW_2024_12_17("gpt-4o-mini-realtime-preview-2024-12-17")
GPT_REALTIME_MINI_2025_10_06("gpt-realtime-mini-2025-10-06")
GPT_AUDIO_1_5("gpt-audio-1.5")
GPT_AUDIO_MINI_2025_10_06("gpt-audio-mini-2025-10-06")
GPT_REALTIME("gpt-realtime")

Deprecated. Announced shutdown date: 2027-01-20. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_REALTIME_2025_08_28("gpt-realtime-2025-08-28")

Deprecated. Announced shutdown date: 2027-01-20. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_REALTIME_MINI("gpt-realtime-mini")

Deprecated. Announced shutdown date: 2027-01-20. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_REALTIME_MINI_2025_12_15("gpt-realtime-mini-2025-12-15")

Deprecated. Announced shutdown date: 2027-01-20. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_AUDIO_MINI("gpt-audio-mini")

Deprecated. Announced shutdown date: 2027-01-20. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_AUDIO_MINI_2025_12_15("gpt-audio-mini-2025-12-15")

Deprecated. Announced shutdown date: 2027-01-20. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

Optional<List<OutputModality>> outputModalities

The set of modalities the model can respond with. It defaults to ["audio"], indicating that the model will respond with audio plus a transcript. ["text"] can be used to make the model respond with text only. It is not possible to request both text and audio at the same time.

One of the following:
TEXT("text")
AUDIO("audio")
Optional<Boolean> parallelToolCalls

Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime models such as gpt-realtime-2.

Optional<ResponsePrompt> prompt

Reference to a prompt template and its variables. Learn more.

String id

The unique identifier of the prompt template to use.

Optional<Variables> variables

Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.

One of the following:
String
class ResponseInputText:

A text input to the model.

String text

The text input to the model.

JsonValue; type
constant
constant

The type of the input item. Always input_text.

Optional<PromptCacheBreakpoint> promptCacheBreakpoint

Marks the exact end of a reusable prompt prefix. When ttl is omitted, the breakpoint inherits the request’s prompt_cache_options.ttl; the boundary is not rounded to a token block.

JsonValue; mode
constant
constant

The breakpoint mode. Always explicit.

The minimum lifetime of this cache breakpoint. Defaults to the request TTL.

One of the following:
_30M("30m")
_12H("12h")
class ResponseInputImage:

An image input to the model. Learn about image inputs.

Detail detail

The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.

One of the following:
LOW("low")
HIGH("high")
AUTO("auto")
ORIGINAL("original")
JsonValue; type
constant
constant

The type of the input item. Always input_image.

Optional<String> fileId

The ID of the file to be sent to the model.

Optional<String> imageUrl

The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

formaturi
Optional<PromptCacheBreakpoint> promptCacheBreakpoint

Marks the exact end of a reusable prompt prefix. When ttl is omitted, the breakpoint inherits the request’s prompt_cache_options.ttl; the boundary is not rounded to a token block.

JsonValue; mode
constant
constant

The breakpoint mode. Always explicit.

The minimum lifetime of this cache breakpoint. Defaults to the request TTL.

One of the following:
_30M("30m")
_12H("12h")
class ResponseInputFile:

A file input to the model.

JsonValue; type
constant
constant

The type of the input item. Always input_file.

Optional<Detail> detail

The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.

One of the following:
AUTO("auto")
LOW("low")
HIGH("high")
Optional<String> fileData

The content of the file to be sent to the model.

Optional<String> fileId

The ID of the file to be sent to the model.

Optional<String> fileUrl

The URL of the file to be sent to the model.

formaturi
Optional<String> filename

The name of the file to be sent to the model.

Optional<PromptCacheBreakpoint> promptCacheBreakpoint

Marks the exact end of a reusable prompt prefix. When ttl is omitted, the breakpoint inherits the request’s prompt_cache_options.ttl; the boundary is not rounded to a token block.

JsonValue; mode
constant
constant

The breakpoint mode. Always explicit.

The minimum lifetime of this cache breakpoint. Defaults to the request TTL.

One of the following:
_30M("30m")
_12H("12h")
Optional<String> version

Optional version of the prompt template.

Optional<RealtimeReasoning> reasoning

Configuration for reasoning-capable Realtime models such as gpt-realtime-2.

Optional<RealtimeReasoningEffort> effort

Constrains effort on reasoning for reasoning-capable Realtime models such as gpt-realtime-2.

One of the following:
MINIMAL("minimal")
LOW("low")
MEDIUM("medium")
HIGH("high")
XHIGH("xhigh")
Optional<RealtimeToolChoiceConfig> toolChoice

How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.

One of the following:
enum ToolChoiceOptions:

Controls which (if any) tool is called by the model.

none means the model will not call any tool and instead generates a message.

auto means the model can pick between generating a message or calling one or more tools.

required means the model must call one or more tools.

NONE("none")
AUTO("auto")
REQUIRED("required")
class ToolChoiceFunction:

Use this option to force the model to call a specific function.

String name

The name of the function to call.

JsonValue; type
constant
constant

For function calling, the type is always function.

class ToolChoiceMcp:

Use this option to force the model to call a specific tool on a remote MCP server.

String serverLabel

The label of the MCP server to use.

JsonValue; type
constant
constant

For MCP tools, the type is always mcp.

Optional<String> name

The name of the tool to call on the server.

Optional<List<RealtimeToolsConfigUnion>> tools

Tools available to the model.

One of the following:
class RealtimeFunctionTool:
Optional<String> description

The description of the function, including guidance on when and how to call it, and guidance about what to tell the user when calling (if anything).

Optional<String> name

The name of the function.

Optional<JsonValue> parameters

Parameters of the function in JSON Schema.

Optional<Type> type

The type of the tool, i.e. function.

Mcp
This type repeats the enclosing schema.
Optional<RealtimeTracingConfig> tracing

Realtime API can write session traces to the Traces Dashboard. Set to null to disable tracing. Once tracing is enabled for a session, the configuration cannot be modified.

auto will create a trace for the session with default values for the workflow name, group id, and metadata.

One of the following:
JsonValue;
TracingConfiguration
This type repeats the enclosing schema.
Optional<RealtimeTruncation> truncation

When the number of tokens in a conversation exceeds the model’s input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model’s context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs.

Clients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.

Truncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate.

Truncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model’s input token limit.

One of the following:
RealtimeTruncationStrategy
This type repeats the enclosing schema.
class RealtimeTruncationRetentionRatio:

Retain a fraction of the conversation tokens when the conversation exceeds the input token limit. This allows you to amortize truncations across multiple turns, which can help improve cached token usage.

double retentionRatio

Fraction of post-instruction conversation tokens to retain (0.0 - 1.0) when the conversation exceeds the input token limit. Setting this to 0.8 means that messages will be dropped until 80% of the maximum allowed tokens are used. This helps reduce the frequency of truncations and improve cache rates.

minimum0
maximum1
JsonValue; type
constant
constant

Use retention ratio truncation.

Optional<TokenLimits> tokenLimits

Optional custom token limits for this truncation strategy. If not provided, the model’s default token limits will be used.

Optional<Long> postInstructions

Maximum tokens allowed in the conversation after instructions (which including tool definitions). For example, setting this to 5,000 would mean that truncation would occur when the conversation exceeds 5,000 tokens after instructions. This cannot be higher than the model’s context window size minus the maximum output tokens.

minimum0
class RealtimeTranscriptionSessionCreateRequest:

Realtime transcription session object configuration.

JsonValue; type
constant
constant

The type of session to create. Always transcription for transcription sessions.

Configuration for input and output audio.

Optional<RealtimeAudioFormats> format

The PCM audio format. Only a 24kHz sample rate is supported.

One of the following:
AudioPcm
This type repeats the enclosing schema.
AudioPcmu
This type repeats the enclosing schema.
AudioPcma
This type repeats the enclosing schema.
Optional<NoiseReduction> noiseReduction

Configuration for input audio noise reduction. This can be set to null to turn off. Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.

Optional<Double> strength

Input noise suppression strength. Higher values apply more suppression. Defaults to 1 when noise reduction is first enabled. Omitting strength from a session update preserves the current strength.

minimum0
maximum1
Optional<NoiseReductionType> type

Type of noise reduction. near_field is for close-talking microphones such as headphones, far_field is for far-field microphones such as laptop or conference room microphones.

One of the following:
NEAR_FIELD("near_field")
FAR_FIELD("far_field")
Optional<AudioTranscription> transcription

Configuration for input audio transcription, defaults to off and can be set to null to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through the /audio/transcriptions endpoint and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service.

Optional<Delay> delay

Controls how long the model waits before emitting transcription text. Higher values can improve transcription accuracy at the cost of latency. Only supported with gpt-realtime-whisper in GA Realtime sessions.

One of the following:
MINIMAL("minimal")
LOW("low")
MEDIUM("medium")
HIGH("high")
XHIGH("xhigh")
Optional<List<String>> keywords

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

Optional<String> language

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

Optional<List<String>> languages

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

minItems1
Optional<Model> model

The model to use for transcription. Current options are whisper-1, gpt-transcribe, gpt-live-transcribe, gpt-4o-mini-transcribe, gpt-4o-mini-transcribe-2025-12-15, gpt-4o-transcribe, gpt-4o-transcribe-diarize, and gpt-realtime-whisper. Use gpt-4o-transcribe-diarize when you need diarization with speaker labels.

One of the following:
GPT_TRANSCRIBE("gpt-transcribe")
GPT_LIVE_TRANSCRIBE("gpt-live-transcribe")
GPT_REALTIME_WHISPER("gpt-realtime-whisper")
WHISPER_1("whisper-1")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_4O_MINI_TRANSCRIBE("gpt-4o-mini-transcribe")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_4O_MINI_TRANSCRIBE_2025_12_15("gpt-4o-mini-transcribe-2025-12-15")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_4O_TRANSCRIBE("gpt-4o-transcribe")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

GPT_4O_TRANSCRIBE_DIARIZE("gpt-4o-transcribe-diarize")

Deprecated. Announced shutdown date: 2027-02-26. See https://developers.openai.com/api/docs/deprecations for details and recommended replacements.

Optional<String> prompt

An optional text to guide the model’s style or continue a previous audio segment. For whisper-1, the prompt is a list of keywords. For gpt-4o-transcribe models (excluding gpt-4o-transcribe-diarize), the prompt is a free text string, for example “expect words related to technology”. Prompt is not supported with gpt-realtime-whisper in GA Realtime sessions.

Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to null to turn off, in which case the client must manually trigger model response.

Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.

Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with “uhhm”, the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency.

For gpt-realtime-whisper transcription sessions, turn detection must be set to null; VAD is not supported.

One of the following:
ServerVad
This type repeats the enclosing schema.
SemanticVad
This type repeats the enclosing schema.
Optional<List<Include>> include

Additional fields to include in server outputs.

item.input_audio_transcription.logprobs: Include logprobs for input audio transcription.