RealtimeClientSecretCreateRequest class

Request for creating a client secret with session configuration.

This allows creating a client secret with custom expiration and session configuration in a single API call.

Example

final response = await client.realtimeSessions.createClientSecret(
  RealtimeClientSecretCreateRequest(
    expiresAfter: ExpiresAfter(anchor: 'created_at', seconds: 3600),
    session: RealtimeSessionCreateRequest(
      model: 'gpt-realtime-1.5',
      voice: RealtimeVoice.alloy,
    ),
  ),
);

print('Secret expires at: ${response.expiresAt}');
Annotations
  • @immutable

Properties

expiresAfter ExpiresAfter?
Expiration configuration.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
session RealtimeSessionCreateRequest
The session configuration.
final

Methods

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