tencent cloud

APIs

StartAITranscription

Download
Focus Mode
Font Size
Last updated: 2026-05-22 17:00:41

1. API Description

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

Start up the transcription bot. The backend will pass the robot stream pulling to perform real-time speech recognition and deliver subtitles and transcription messages.
The transcription bot supports two stream pulling methods, controlled by the TranscriptionMode field.

  • Pull the stream of all players in the room.
  • Pull the stream for a specific user.

The server delivers subtitles and transcription messages in real time through TRTC custom messages, with CmdId fixed to 1. Clients just need to listen to the custom message callback, such as the C++ callback (https://www.tencentcloud.com/document/product/647/79637?from_cn_redirect=1#4cd82f4edb24992a15a25187089e1565). Other clients such as Android and Web can likewise find it at the same link.

Note:
When TranscriptionMode is 0, ensure only one task is initiated in a room. If multiple tasks are initiated, robots will subscribe with each other. Unless the task is stopped proactively, it will timeout exit after 10 hours. In such cases, it is advisable to fill in SessionId to ensure subsequent repeated task failures.

A maximum of 50 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 Name Required Type Description
Action Yes String Common Params. The value used for this API: StartAITranscription.
Version Yes String Common Params. The value used for this API: 2019-07-22.
Region Yes String Common 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.
SdkAppId Yes Integer SdkAppId of TRTC, which is the same as the SdkAppId used by the room with transcription task enabled.
RoomId Yes String RoomId of TRTC refers to the room number that enables the transcription task.
TranscriptionParams Yes TranscriptionParams Transcription robot parameters.
SessionId No String Unique Id passed by the caller, used by the server for task deduplication. duplicate tasks will fail to initiate. the server uses SdkAppId+RoomId+RoomIdType+RobotUserId for deduplication by default. if SessionId is provided, it will also be used for deduplication.
Note:.
When TranscriptionMode is 0, ensure only one task is initiated in a room. if multiple tasks are initiated, robots will subscribe to each other. unless the task is stopped proactively, it will timeout exit after 10 hours. in such cases, it is advisable to fill in SessionId to ensure subsequent repeated tasks fail.
RoomIdType No Integer Type of the TRTC room number. 0 indicates digit room number, 1 indicates string room number. by default if left blank, it is digit room number.
RecognizeConfig No RecognizeConfig Speech recognition configuration.
TranslationConfig No TranslationConfig Translate configuration details.

3. Output Parameters

Parameter Name Type Description
TaskId String For unique identification of transcription task.
RequestId String The 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 Creating a Billing Resource Order

Input Example

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

{
    "SdkAppId": 1234,
    "RoomId": "500123",
    "RoomIdType": 1,
    "TranscriptionParams": {
        "UserId": "test_user",
        "UserSig": "your-usersig",
        "MaxIdleTime": 60,
        "TranscriptionMode": 1,
        "TargetUserId": "test_user"
    }
}

Output Example

{
    "Response": {
        "TaskId": "taskid",
        "RequestId": "requestid"
    }
}

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 Code Description
FailedOperation.NotAbility Unlock the required capability bit.
FailedOperation.NotAllowed This operation is not allowed. submit a ticket to contact us.
FailedOperation.SdkAppIdNotUnderAppId No resource belonging to this SdkAppId under the AppId.
FailedOperation.TaskExist Task already exists
InvalidParameter.UserSig UserSig is expired or wrong
InvalidParameter.UserSigNotAdmin UserSig is not a super administrator.
ResourceInsufficient.RequestRejection Insufficient resources.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback