Package-level declarations

Types

Link copied to clipboard
@Serializable
data class RealtimeAudioConfig(val input: RealtimeAudioInput? = null, val output: RealtimeAudioOutput? = null)

Audio configuration for GA Realtime sessions.

Link copied to clipboard
@Serializable
data class RealtimeAudioFormat(val type: String = "audio/pcm", val rate: Int? = null)

Audio media type; PCM uses 24000 Hz.

Link copied to clipboard
@Serializable
data class RealtimeAudioInput(val format: RealtimeAudioFormat? = null, val noiseReduction: JsonElement? = null, val transcription: JsonElement? = null, val turnDetection: JsonElement? = null)

Incoming audio format, transcription and detection.

Link copied to clipboard
@Serializable
data class RealtimeAudioOutput(val format: RealtimeAudioFormat? = null, val voice: JsonElement? = null, val speed: Double? = null)

Outgoing voice and format configuration.

Link copied to clipboard
data class RealtimeCall(val sdp: String, val location: String? = null)

WebRTC SDP answer with the call location used for later control operations.

Link copied to clipboard
@Serializable
class RealtimeClientSecret(val value: String, val expiresAt: Long, val session: JsonObject)

Ephemeral credential. Do not log or persist its value.

Link copied to clipboard
@Serializable
data class RealtimeClientSecretRequest(val session: RealtimeSessionConfig? = null, val expiresAfter: RealtimeSecretExpiry? = null)

Creates an ephemeral GA Realtime credential.

Link copied to clipboard
@Serializable(with = RealtimeEvent.Serializer::class)
data class RealtimeEvent(val payload: JsonObject)

A client or server protocol event. The full JSON payload retains unknown and tool-specific fields.

Link copied to clipboard
@Serializable
data class RealtimeFunctionTool(val name: String, val parameters: Parameters? = null, val description: String? = null, val type: String = "function")

Function declaration for a Realtime session.

Link copied to clipboard
@Serializable
data class RealtimeSecretExpiry(val seconds: Int = 600, val anchor: String = "created_at")

Short-lived client-secret expiry.

Link copied to clipboard
@Serializable
data class RealtimeSessionConfig(val type: String = "realtime", val model: ModelId? = null, val instructions: String? = null, val audio: RealtimeAudioConfig? = null, val outputModalities: List<String>? = null, val maxOutputTokens: JsonElement? = null, val tools: List<JsonObject>? = null, val toolChoice: JsonElement? = null, val parallelToolCalls: Boolean? = null, val include: List<String>? = null, val reasoning: JsonObject? = null, val tracing: JsonElement? = null, val prompt: JsonObject? = null, val truncation: JsonElement? = null)

GA Realtime or transcription session configuration. Model-dependent controls remain optional.

Link copied to clipboard
@Serializable
data class RealtimeTranslationSecretRequest(val session: RealtimeTranslationSessionConfig, val expiresAfter: RealtimeSecretExpiry? = null)

Creates an ephemeral translation credential.

Link copied to clipboard
@Serializable
data class RealtimeTranslationSessionConfig(val model: ModelId, val audio: JsonObject? = null)

Continuous translation configuration. Input is PCM16 mono little-endian audio at 24kHz over WebSocket.