kernl

Interface: RealtimeModel

Defined in: packages/protocol/src/realtime/model.ts:28

A realtime model that can establish bidirectional streaming connections.

Models are reusable - each call to connect() creates a new connection. Providers implement this interface.

Properties

PropertyModifierTypeDescriptionDefined in
modelIdreadonlystringModel ID (e.g., "gpt-4o-realtime", "gemini-2.0-flash").packages/protocol/src/realtime/model.ts:42
providerreadonlystringProvider ID (e.g., "openai", "google", "elevenlabs").packages/protocol/src/realtime/model.ts:37
specreadonly"1.0"The realtime model spec version.packages/protocol/src/realtime/model.ts:32

Methods

authenticate()

authenticate(options?: RealtimeAuthenticateOptions): Promise<ClientCredential>;

Defined in: packages/protocol/src/realtime/model.ts:57

Create ephemeral credential for client-side connections.

Call server-side where API key is available, pass result to client. Client then uses credential in connect() options.

Parameters

ParameterTypeDescription
options?RealtimeAuthenticateOptionsProvider-specific options (e.g., agentId for ElevenLabs)

Returns

Promise<ClientCredential>


connect()

connect(options?: RealtimeConnectOptions): Promise<RealtimeConnection>;

Defined in: packages/protocol/src/realtime/model.ts:47

Establish a connection and return a connection instance.

Parameters

ParameterType
options?RealtimeConnectOptions

Returns

Promise<RealtimeConnection>

On this page