Use the C# SDK to call Qwen-Omni-Realtime over WebSocket. The examples use audio input and return text and audio.
Install the SDK
Download and extract Bailian.DashScope-1.1.0.zip. To use the SDK in a C# project, install it from the local NuGet source.
Quickstart
- Get an API key and set the
DASHSCOPE_API_KEYenvironment variable. - Create a .NET 10 console project, install the SDK, and copy the complete C# example into
Program.cs. - Place
input.pcmin the project directory. Use 16 kHz, mono, 16-bit little-endian raw PCM. Convert WAV files to raw PCM first.
qwen3.8-omni-flash-realtime uses a workspace-specific domain. Replace WorkspaceId with the workspace ID for your API key. This example uses China (Beijing) and the Tina voice. For endpoint details, see WebSocket access.
output.pcm.
Model configuration and session lifecycle
See the C# SDK API reference for options, methods, and events. Call FinishAsync after the final ResponseCompleted event. The SDK chooses CloseOnly for Omni Realtime and ends the session by closing the connection.
To send image frames, use SendRawEventAsync to send complete events. For configuration, input formats, and event order, see Omni Realtime WebSocket access.