RealtimeSessionCreateResponse class

Response from creating a Realtime session via HTTP.

Contains the session configuration. The client secret is not nested on this response — the /realtime/client_secrets endpoint returns a RealtimeClientSecretCreateResponse wrapping this RealtimeSessionCreateResponse alongside the secret.

Annotations
  • @immutable

Constructors

RealtimeSessionCreateResponse({required String id, required String object, required String type, String? model, int? expiresAt, RealtimeAudioConfig? audio, List<String>? outputModalities, String? instructions, List<RealtimeTool>? tools, RealtimeToolChoice? toolChoice, InfOrInt? maxOutputTokens, bool? parallelToolCalls, RealtimeReasoning? reasoning, RealtimeTracingConfig? tracing, RealtimeTruncation? truncation, List<String>? include})
Creates a RealtimeSessionCreateResponse.
const
RealtimeSessionCreateResponse.fromJson(Map<String, dynamic> json)
Creates a RealtimeSessionCreateResponse from JSON.
factory

Properties

audio RealtimeAudioConfig?
Nested audio configuration.
final
expiresAt int?
Expiration timestamp (Unix epoch seconds). May be null on partial or transient frames.
final
hashCode int
The hash code for this object.
no setteroverride
id String
The session identifier.
final
include List<String>?
Additional fields to include in server outputs.
final
instructions String?
System instructions.
final
maxOutputTokens InfOrInt?
Maximum output tokens.
final
model String?
The model identifier. Always present for realtime sessions; omitted from transcription session responses (which carry the model on the nested audio.input.transcription instead).
final
object String
The object type (e.g. 'realtime.session' / 'realtime.transcription_session').
final
outputModalities List<String>?
Output modalities.
final
parallelToolCalls bool?
Whether the model may call multiple tools in parallel.
final
reasoning RealtimeReasoning?
Reasoning configuration.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toolChoice RealtimeToolChoice?
Tool choice setting.
final
tools List<RealtimeTool>?
Tools available to the model.
final
tracing RealtimeTracingConfig?
Tracing configuration.
final
truncation RealtimeTruncation?
Truncation configuration.
final
type String
The session type ('realtime' or 'transcription').
final

Methods

copyWith({String? id, String? object, String? type, Object? model = unsetCopyWithValue, Object? expiresAt = unsetCopyWithValue, Object? audio = unsetCopyWithValue, Object? outputModalities = unsetCopyWithValue, Object? instructions = unsetCopyWithValue, Object? tools = unsetCopyWithValue, Object? toolChoice = unsetCopyWithValue, Object? maxOutputTokens = unsetCopyWithValue, Object? parallelToolCalls = unsetCopyWithValue, Object? reasoning = unsetCopyWithValue, Object? tracing = unsetCopyWithValue, Object? truncation = unsetCopyWithValue, Object? include = unsetCopyWithValue}) RealtimeSessionCreateResponse
Returns a copy of this RealtimeSessionCreateResponse with the given fields replaced. Pass null for any nullable field to clear the existing value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override