Skip to main content

Class: OpenAIRealtimeTranscriptionSTT

Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:1874

Streaming STT provider for OpenAI's Realtime transcription sessions. Implements IStreamingSTT for use with VoicePipelineOrchestrator and StreamingSTTChain, both exported from @framers/agentos/io/voice-pipeline.

Example​

const stt = new OpenAIRealtimeTranscriptionSTT({
apiKey: process.env.OPENAI_API_KEY!,
model: 'gpt-4o-mini-transcribe',
usageIntervalMs: 15_000,
});
const session = await stt.startSession({ language: 'en-US' });
session.on('transcript', (event) => console.log(event.itemId, event.isFinal, event.text));
session.on('usage', (usage) => console.log(usage.connectionIndex, usage.audioSeconds));

Implements​

  • IStreamingSTT
  • HealthyProvider

Constructors​

Constructor​

new OpenAIRealtimeTranscriptionSTT(config): OpenAIRealtimeTranscriptionSTT

Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:1882

Parameters​

config​

OpenAIRealtimeTranscriptionSTTConfig

Returns​

OpenAIRealtimeTranscriptionSTT

Properties​

capabilities​

readonly capabilities: ProviderCapabilities

Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:1878

Implementation of​

HealthyProvider.capabilities


isStreaming​

readonly isStreaming: true = true

Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:1876

true when the provider has at least one active session open.

Implementation of​

IStreamingSTT.isStreaming


priority​

readonly priority: number

Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:1877

Lower = tried first. Apps may override via constructor option.

Implementation of​

HealthyProvider.priority


providerId​

readonly providerId: "openai-realtime-transcription" = 'openai-realtime-transcription'

Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:1875

Unique, stable identifier for this provider (e.g. 'deepgram', 'whisper-live').

Implementation of​

IStreamingSTT.providerId

Methods​

healthCheck()​

healthCheck(): Promise<HealthCheckResult>

Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:1895

Lightweight probe (should complete in under 1 second). Must NOT consume billable audio or synthesis during a health check — it exists to verify authentication and reachability, not to measure quality.

Returns​

Promise<HealthCheckResult>

Implementation of​

HealthyProvider.healthCheck


startSession()​

startSession(config?): Promise<StreamingSTTSession>

Defined in: packages/agentos/src/io/voice-pipeline/providers/OpenAIRealtimeTranscriptionSTT.ts:1927

Opens a transcription session on a fresh key from the pool. Resolves once OpenAI has confirmed the session update; rejects (with no retry) when the first connection cannot open, so a StreamingSTTChain (exported from @framers/agentos/io/voice-pipeline) falls back. A first connection that closes as its session update is confirmed is replaced by the retry rules first: this resolves once the replacement is open, and rejects with the error that ends the retries.

Parameters​

config?​

StreamingSTTConfig

Returns​

Promise<StreamingSTTSession>

Implementation of​

IStreamingSTT.startSession