Voxa.Services.OpenAIRealtime 0.7.2-alpha

This is a prerelease version of Voxa.Services.OpenAIRealtime.
dotnet add package Voxa.Services.OpenAIRealtime --version 0.7.2-alpha
                    
NuGet\Install-Package Voxa.Services.OpenAIRealtime -Version 0.7.2-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Voxa.Services.OpenAIRealtime" Version="0.7.2-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Voxa.Services.OpenAIRealtime" Version="0.7.2-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Voxa.Services.OpenAIRealtime" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Voxa.Services.OpenAIRealtime --version 0.7.2-alpha
                    
#r "nuget: Voxa.Services.OpenAIRealtime, 0.7.2-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Voxa.Services.OpenAIRealtime@0.7.2-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Voxa.Services.OpenAIRealtime&version=0.7.2-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Voxa.Services.OpenAIRealtime&version=0.7.2-alpha&prerelease
                    
Install as a Cake Tool

Voxa.Services.OpenAIRealtime

OpenAIRealtimeProcessor — a single drop-in FrameProcessor that bridges your Voxa pipeline to the OpenAI Realtime API. Full-duplex streaming, server-side voice activity detection, native interruption, sub-400 ms turn-taking. The C# equivalent of Pipecat's OpenAIRealtimeBetaService.

Why use this instead of Whisper + TTS chained?

Chaining Whisper REST → LLM → TTS REST accumulates 1.3–1.9 s of latency per turn and Whisper hallucinates words from breath/silence. The Realtime API solves both at once:

Whisper REST + TTS REST chain OpenAIRealtimeProcessor
Time to first audio 1.3–1.9 s 250–400 ms
Hallucinations on silence Frequent None — server VAD gates speech
Interruption Manual gate, easy to mistime Native, server-driven
API calls per turn 2× HTTP 1× WebSocket session

Install

dotnet add package Voxa.Services.OpenAIRealtime

Quickstart

using Voxa.Pipelines;
using Voxa.Services.OpenAIRealtime;
using Voxa.Transports.WebSocket;

var pipeline = Pipeline.Build()
    .Source(new WebSocketAudioSource(clientWs))
    .Then(new OpenAIRealtimeProcessor(new OpenAIRealtimeOptions
    {
        ApiKey = builder.Configuration["OpenAI:ApiKey"]!,
        Model = "gpt-realtime-mini",
        Voice = "alloy",
        Instructions = "You are a friendly voice assistant. Keep responses brief.",
    }))
    .Sink(new WebSocketAudioSink(clientWs));

await using var runner = new PipelineRunner(pipeline);
await runner.StartAsync();
await runner.WaitAsync();

That's the whole thing. No SilenceGate, no separate STT, no separate TTS — the Realtime API handles all of it server-side.

Configuration

Option Default Notes
ApiKey (required) Sent as Authorization: Bearer <key>.
Endpoint wss://api.openai.com/v1/realtime Override only when proxying. The model is appended as ?model=... automatically.
Model gpt-realtime-mini Or gpt-realtime, gpt-4o-realtime-preview.
Voice alloy One of alloy, ash, ballad, coral, echo, sage, shimmer, verse.
Instructions null System prompt.
TurnDetection.Threshold 0.5 Server-VAD activation probability. Lower = more sensitive.
TurnDetection.PrefixPaddingMs 300 Audio prepended to detected speech for context.
TurnDetection.SilenceDurationMs 500 Sustained silence before turn-end.
Tools [] Function tools the model can invoke. Wire results back via ToolCallResultFrame.
InputSampleRate / OutputSampleRate 24000 The Realtime API expects pcm16 @ 24 kHz.

Tool calling

The processor emits a ToolCallRequestFrame when the model wants to invoke a tool. Your downstream processor handles it and pushes back a ToolCallResultFrame (e.g. via the MicrosoftAgentsProcessor adapter or your own dispatcher) — the processor forwards that back into the session and asks the model to continue.

Auth note

The transport sends both Authorization: Bearer <ApiKey> and OpenAI-Beta: realtime=v1. If you proxy through a gateway that strips the OpenAI-Beta header, the connection will fail.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.2-alpha 86 7/10/2026
0.7.1-alpha 71 7/10/2026
0.7.0-alpha 70 7/10/2026
0.6.0-alpha 85 6/22/2026
0.5.0-alpha 70 6/13/2026
0.4.0-alpha 1,125 5/10/2026