StartRealtimeASRTask
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
Possible values: [StartRealtimeASRTask]
Interface prototype parameters
https://cloud-realtime-asr-api.zegotech.cn?Action=StartRealtimeASRTask
💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.
Common parameter. 16-bit hexadecimal random string (hex encoding of 8 bytes of random number). For generation algorithm, refer to Signature Example.
Common parameter. Current Unix timestamp, in seconds. For generation algorithm, refer to Signature Example, maximum allowed deviation of 10 minutes.
Possible values: [2.0]
Default value: 2.0
💡Public parameter. Signature version number.
Common parameter. Signature, used to verify the legitimacy of the request. Please refer to Signature Mechanism to generate.
- application/json
Body
required
- Array[
- DoubaoSeedTranslation: Doubao translation
- QwenMT: Tongyi Qianwen translation
- GoogleTranslateV2: Google Translate
- 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.
- 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.
- 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.
- ]
- DoubaoSeedTranslation: Doubao translation
- QwenMT: Tongyi Qianwen translation
- GoogleTranslateV2: Google Translate
- 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.
- 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.
- 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.
RTC room ID
Possible values: [0, 1]
Recognition range. 0: all streams in the room, 1: specified StreamList.
ASR object
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.
Vendor parameters. For specific usage, refer to the Params parameter description in Configure ASR.
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.
This parameter is deprecated. Please set it through Params vendor parameters.
StreamList object[]
Stream ID to be recognized.
ASR object
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.
Vendor parameters. For specific usage, refer to the Params parameter description in Configure ASR.
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.
This parameter is deprecated. Please set it through Params vendor parameters.
Whether to enable translation.
Translation object
Possible values: [DoubaoSeedTranslation, QwenMT, GoogleTranslateV2]
Translation service vendor:
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.
Target language
LLM objectrequired
LLM endpoint to call. It varies by Vendor:
API key for LLM verification. It is empty by default. Make sure to fill in the corresponding API key in production environments.
The LLM model name to call. It varies by Vendor:
LLM or application platform request parameters, optional.
AdvancedConfig object
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.
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.
Whether to enable translation. Disabled by default.
Translation object
Possible values: [DoubaoSeedTranslation, QwenMT, GoogleTranslateV2]
Translation service vendor:
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.
Target language
LLM objectrequired
LLM endpoint to call. It varies by Vendor:
API key for LLM verification. It is empty by default. Make sure to fill in the corresponding API key in production environments.
The LLM model name to call. It varies by Vendor:
LLM or application platform request parameters, optional.
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
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.
Possible values: [0, 1]
Default value: 0
Whether to enable server callbacks for ASR recognition results. 0: Disabled (default); 1: Enabled.
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.
Possible values: [0, 1]
Default value: 1
Whether to enable server callbacks for exception events. 0: Disabled; 1: Enabled (default).
Responses
- 200
- application/json
- Schema
- Example (from schema)
Schema
Return code, 0 means success, other values mean failure. For details, refer to Return Codes.
Request result description
Request ID
Data object
Unique identifier of the task.
{
"Code": 0,
"Message": "Success",
"RequestId": "3151527792559699732",
"Data": {
"TaskId": "1920370518175780864"
}
}{
"Code": 0,
"Message": "Success",
"RequestId": "3151527792559699732",
"Data": {
"TaskId": "1920370518175780864"
}
}