On this page

StartRealtimeASRTask

2026-11-16
POST

https://cloud-realtime-asr-api.zegotech.cn/

Start cloud real-time speech recognition task and add the speech recognition instance to the RTC conversation.

Request

Query Parameters

    Action stringrequired

    Possible values: [StartRealtimeASRTask]

    Interface prototype parameters

    https://cloud-realtime-asr-api.zegotech.cn?Action=StartRealtimeASRTask

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    Common parameter. 16-bit hexadecimal random string (hex encoding of 8 bytes of random number). For generation algorithm, refer to Signature Example.

    Timestamp int64required

    Common parameter. Current Unix timestamp, in seconds. For generation algorithm, refer to Signature Example, maximum allowed deviation of 10 minutes.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    Signature stringrequired

    Common parameter. Signature, used to verify the legitimacy of the request. Please refer to Signature Mechanism to generate.

Body

required
    RoomId stringrequired

    RTC room ID

    RecognitionRange integer

    Possible values: [0, 1]

    Recognition range. 0: all streams in the room, 1: specified StreamList.

    ASR object
    ASR parameters
    Vendor string

    Possible values: [Tencent, AliyunParaformer, AliyunFunASR, AliyunQwenAudioASR, VolcSeedASR, Microsoft]

    Default value: Tencent

    ASR vendor. Refer to Configure ASR parameter description. If you need Alibaba, Microsoft recognition vendors, please contact ZEGOCLOUD business support to enable.

    Params object

    Vendor parameters. For specific usage, refer to the Params parameter description in Configure ASR.

    VADSilenceSegmentation number

    Possible values: >= 200 and <= 2000

    Default value: 500

    Used to set how many milliseconds after the user stops speaking, two sentences will no longer be considered as one. Unit is ms, range [200, 2000], default is 500. For detailed explanation, refer to Configure ASR - Speech Segmentation Control.

    HotWord stringdeprecated

    This parameter is deprecated. Please set it through Params vendor parameters.

    StreamList object[]
    List of streams to be recognized, takes effect when RecognitionRange parameter is 1. When RecognitionRange parameter is 1, this parameter cannot be empty.
  • Array[
  • StreamId stringrequired

    Stream ID to be recognized.

    ASR object
    ASR parameters
    Vendor string

    Possible values: [Tencent, AliyunParaformer, AliyunFunASR, AliyunQwenAudioASR, VolcSeedASR, Microsoft]

    Default value: Tencent

    ASR vendor. Refer to Configure ASR parameter description. If you need Alibaba, Microsoft recognition vendors, please contact ZEGOCLOUD business support to enable.

    Params object

    Vendor parameters. For specific usage, refer to the Params parameter description in Configure ASR.

    VADSilenceSegmentation number

    Possible values: >= 200 and <= 2000

    Default value: 500

    Used to set how many milliseconds after the user stops speaking, two sentences will no longer be considered as one. Unit is ms, range [200, 2000], default is 500. For detailed explanation, refer to Configure ASR - Speech Segmentation Control.

    HotWord stringdeprecated

    This parameter is deprecated. Please set it through Params vendor parameters.

    EnableTranslation boolean

    Whether to enable translation.

    Translation object
    Translation LLM configuration item
    Vendor stringrequired

    Possible values: [DoubaoSeedTranslation, QwenMT, GoogleTranslateV2]

    Translation service vendor:

    • DoubaoSeedTranslation: Doubao translation
    • QwenMT: Tongyi Qianwen translation
    • GoogleTranslateV2: Google Translate
    SourceLanguage string

    Source language. Optional. The value must be an enum value of the corresponding translation vendor. When Vendor is GoogleTranslateV2, you can omit it or set it to an empty string for automatic source language detection.

    TargetLanguage stringrequired

    Target language

    LLM objectrequired
    LLM parameters for translation.
    Url string

    LLM endpoint to call. It varies by Vendor:

    • When Vendor is DoubaoSeedTranslation: required, e.g., https://ark.cn-beijing.volces.com/api/v3/responses
    • When Vendor is QwenMT: required, e.g., https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions (China site) or https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 (International site)
    • When Vendor is GoogleTranslateV2: optional. If not passed, the server default endpoint https://translation.googleapis.com/language/translate/v2 is used.
    ApiKey string

    API key for LLM verification. It is empty by default. Make sure to fill in the corresponding API key in production environments.

    Model string

    The LLM model name to call. It varies by Vendor:

    • When Vendor is DoubaoSeedTranslation: required, e.g., doubao-seed-translation-250915
    • When Vendor is QwenMT: required, e.g., qwen-mt-lite
    • When Vendor is GoogleTranslateV2: optional. If not passed, nmt is used by default.
    Params object

    LLM or application platform request parameters, optional.

    • For OpenAI protocol, you can configure parameters such as max_tokens, temperature, stream, etc.
    • For other application platforms, you can fill in the parameters supported by the platform.
    • When Vendor is GoogleTranslateV2, passing through parameters is not supported.
  • ]
  • AdvancedConfig object
    Advanced configuration parameters.
    MaxIdleTime integer

    Possible values: >= 30 and <= 1800

    Default value: 120

    If no one is publishing streams in the RTC room for more than MaxIdleTime, the background automatically stops the recognition task, in seconds.

    TranslationRoomMessageMode integer

    Possible values: [0, 1, 2]

    Default value: 0

    The delivery mode of RTC room messages for translated text. 0: Deliver incremental text only, with Cmd being 202; 1: Deliver complete text only, with Cmd being 203; 2: Deliver both incremental and complete text. The default value is 0. It takes effect only when SubtitleType is 2 or 3, and does not affect ASR subtitles or HTTP callbacks.

    EnableTranslation boolean

    Whether to enable translation. Disabled by default.

    Translation object
    Translation LLM configuration item
    Vendor stringrequired

    Possible values: [DoubaoSeedTranslation, QwenMT, GoogleTranslateV2]

    Translation service vendor:

    • DoubaoSeedTranslation: Doubao translation
    • QwenMT: Tongyi Qianwen translation
    • GoogleTranslateV2: Google Translate
    SourceLanguage string

    Source language. Optional. The value must be an enum value of the corresponding translation vendor. When Vendor is GoogleTranslateV2, you can omit it or set it to an empty string for automatic source language detection.

    TargetLanguage stringrequired

    Target language

    LLM objectrequired
    LLM parameters for translation.
    Url string

    LLM endpoint to call. It varies by Vendor:

    • When Vendor is DoubaoSeedTranslation: required, e.g., https://ark.cn-beijing.volces.com/api/v3/responses
    • When Vendor is QwenMT: required, e.g., https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions (China site) or https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 (International site)
    • When Vendor is GoogleTranslateV2: optional. If not passed, the server default endpoint https://translation.googleapis.com/language/translate/v2 is used.
    ApiKey string

    API key for LLM verification. It is empty by default. Make sure to fill in the corresponding API key in production environments.

    Model string

    The LLM model name to call. It varies by Vendor:

    • When Vendor is DoubaoSeedTranslation: required, e.g., doubao-seed-translation-250915
    • When Vendor is QwenMT: required, e.g., qwen-mt-lite
    • When Vendor is GoogleTranslateV2: optional. If not passed, nmt is used by default.
    Params object

    LLM or application platform request parameters, optional.

    • For OpenAI protocol, you can configure parameters such as max_tokens, temperature, stream, etc.
    • For other application platforms, you can fill in the parameters supported by the platform.
    • When Vendor is GoogleTranslateV2, passing through parameters is not supported.
    SubtitleType integer

    Subtitle delivery type, default is 0.
    0: No delivery;
    1: Recognition results only (e.g., when a user says "你好" in Chinese, delivers "你好");
    2: Translation results only (e.g., when a user says "你好" in Chinese, delivers the translated "Hello");
    3: Both recognition and translation results (e.g., when a user says "你好" in Chinese, delivers both "你好" and "Hello").
    If you need to display subtitles on the client, it is recommended to set this to 1, 2, or 3. For details, see Display Subtitles.

    CallbackConfig object
    Callback configuration.
    HostTag string

    You can set up to two callback addresses to monitor events that occur during the task. Use this parameter to specify which callback address the task's events should be routed to. Contact ZEGO technical support to configure the specific tag values in advance. Currently, Custom1 and Custom2 are supported.

    ASRResult integer

    Possible values: [0, 1]

    Default value: 0

    Whether to enable server callbacks for ASR recognition results. 0: Disabled (default); 1: Enabled.

    TranslationResult integer

    Possible values: [0, 1]

    Default value: 0

    Whether to enable server callbacks for translation results. If enabled, translation results are returned sentence by sentence. 0: Disabled (default); 1: Enabled.

    Exception integer

    Possible values: [0, 1]

    Default value: 1

    Whether to enable server callbacks for exception events. 0: Disabled; 1: Enabled (default).

Responses​

Task started successfully
Schema
    Code integer

    Return code, 0 means success, other values mean failure. For details, refer to Return Codes.

    Message string

    Request result description

    RequestId string

    Request ID

    Data object
    TaskId string

    Unique identifier of the task.

Previous

Return Codes

Next

Stop Cloud Real-Time ASR

On this page

Back to top