All Products
Search
Document Center

Alibaba Cloud Model Studio:Qwen-Omni-Realtime C# SDK

Last Updated:Nov 19, 2026

Use the C# SDK to call Qwen-Omni-Realtime over WebSocket. The examples use audio input and return text and audio.

Prerequisites

Get an API key and set DASHSCOPE_API_KEY. Use an API key from the same region as your workspace.

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.

Quick start

  1. Create a .NET 10 console project and install the SDK as described above. Copy the complete C# example into Program.cs.
  2. Place input.pcm in the project directory. Use 16 kHz, mono, 16-bit little-endian raw PCM. Convert WAV files to raw PCM first.

Set the Singapore workspace WebSocket endpoint. Replace WorkspaceId with your workspace ID. For supported regions and endpoints, see WebSocket access.

This example uses qwen3.8-omni-flash-realtime with the Tina voice.

export DASHSCOPE_REALTIME_URL="wss://WorkspaceId.ap-southeast-1.maas.aliyuncs.com/api-ws/v1/realtime"
dotnet run -- input.pcm qwen3.8-omni-flash-realtime Tina

The terminal displays the response text and writes the response audio to output.pcm.

API reference

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.