StartAITranscription

1. API Description

Domain name for API request: trtc.tencentcloudapi.com.

Initiate the transcription bot. The backend will pull the stream through the bot to perform real-time speech recognition and deliver subtitles and transcription messages. The transcription bot supports two stream pulling modes, controlled by the TranscriptionMode field:

  • Pull the stream of the entire room.
  • Pull the stream of a specific user.

The server delivers subtitles and transcription messages in real-time through TRTC's custom messages, with CmdId fixed at 1. The client only needs to listen for the callback of custom messages. For example, see the C++ callback. Other clients, such as Android, Web, etc., can also be found at the same link.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: StartAITranscription.
VersionYesStringCommon Params. The value used for this API: 2019-07-22.
RegionYesStringCommon Params. For more information, please see the list of regions supported by the product. This API only supports: ap-guangzhou, ap-singapore, ap-tokyo, na-siliconvalley.
SdkAppIdYesIntegerTRTC's SdkAppId is the same as the SdkAppId used by the room that starts the transcription task.
RoomIdYesStringTRTC's RoomId, which indicates the room number where the transcription task is started.
TranscriptionParamsYesTranscriptionParamsParameters of the transcription robot.
SessionIdNoStringThe unique ID passed by the caller is used by the server to deduplicate. Note: If this parameter is passed, the server will use it first to deduplicate. If this parameter is not passed, the server's deduplication strategy is as follows:
- If the TranscriptionMode field is 0, only one task can be opened in a room
- If the TranscriptionMode field is 1, only one task can be opened in a TargetUserId
RoomIdTypeNoIntegerThe type of TRTC room number. 0 represents a numeric room number, and 1 represents a string room number. If not filled in, the default is a numeric room number.
RecognizeConfigNoRecognizeConfigSpeech recognition configuration.

3. Output Parameters

Parameter NameTypeDescription
TaskIdStringUsed to uniquely identify a transcription task.
RequestIdStringThe unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 example

Input Example

POST / HTTP/1.1
Host: trtc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: StartAITranscription
<Common request parameters>

{
    "SdkAppId": 1234,
    "RoomId": "1234",
    "RoomIdType": 1,
    "TranscriptionParams": {
        "UserId": "abc",
        "UserSig": "abc",
        "MaxIdleTime": 60,
        "TranscriptionMode": 1,
        "TargetUserId": "abc"
    }
}

Output Example

{
    "Response": {
        "TaskId": "abc",
        "RequestId": "abc"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error CodeDescription
FailedOperation.NotAbilityNeed to unlock the required ability
FailedOperation.NotAllowedThis operation is not allowed, please submit a ticket to contact us
FailedOperation.SdkAppIdNotUnderAppIdThere is no resource for this SdkAppId In this AppId
FailedOperation.TaskExistTask already exists
InvalidParameter.UserSigUserSig is expired or wrong
InvalidParameter.UserSigNotAdmin
ResourceInsufficient.RequestRejectionInsufficient resources.