Build on the supported package contract
Use @absolutejs/voice-openai through its supported public entry points.
@absolutejs/voice-openaiv0.0.7-beta.45betaVoice & MediaOpenAI realtime adapter for @absolutejs/voice
bun add @absolutejs/voice-openaiInput transcription log probabilities are requested by default and normalized as Transcript.tokens, with aggregate transcript confidence available for provider-neutral routing and calibration. Set inputTranscriptionLogprobs: false to omit the optional Realtime field.
OpenAI realtime adapter for @absolutejs/voice.
This adapter uses OpenAI's official Realtime WebSocket API and normalizes it into the core RealtimeAdapter contract.
conversation.item.input_audio_transcription.delta -> partial
conversation.item.input_audio_transcription.completed -> final
completed input transcription -> normalized endOfTurn
response.output_audio.delta -> audio
realtime error events -> normalized error
websocket close -> normalized close
For string input, the adapter emits a local final transcript immediately and then requests an OpenAI response. For audio input, it buffers PCM audio and commits the turn after a short inactivity window.
The response transcript events (response.audio_transcript., response.output_audio_transcript., response.output_text.) are disabled by default to keep the adapter focused on user-input STT. Enable them only if your application intentionally consumes assistant output transcripts.
OpenAI Realtime currently expects pcm16 audio at 24kHz mono for streaming audio input. This adapter enforces that requirement when you call send(audio).
Output audio is normalized as raw pcm_s16le at 24kHz mono.
Supported options include:
apiKey
model
emitResponseTranscripts
voice
instructions
inputTranscriptionModel
inputTranscriptionLanguage
inputTranscriptionPrompt
maxOutputTokens
autoCommitSilenceMs
noiseReduction
responseMode
Set OPENAI_API_KEY in your runtime environment, or pass the key explicitly in the adapter config.
OpenAI references used for this adapter design:
https://developers.openai.com/api/reference/resources/realtime
https://developers.openai.com/api/docs/models
Outcomes
Use @absolutejs/voice-openai through its supported public entry points.
Hardening checklist
Follow in order
Working example for Setup.
import { openai } from "@absolutejs/voice-openai";
const realtime = openai({
apiKey: process.env.OPENAI_API_KEY!,
model: "gpt-realtime-mini",
voice: "marin",
instructions: "Be concise and clear.",
inputTranscriptionModel: "gpt-4o-mini-transcribe",
});Supported entry points declared by this package manifest.
Package entry point declared in package.json.
Scripts declared by this package manifest.
Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.