tencent cloud

APIs

ControlVoiceConversation

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-11-20 11:53:22

1. API Description

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

After a conversation task starts successfully, use this API to control it.

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 Name Required Type Description
Action Yes String Common Params. The value used for this API: ControlVoiceConversation.
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-hongkong, ap-singapore.
SdkAppId Yes Integer The TRTC SdkAppId. It must be the same SdkAppId as the conversation room.
TaskId Yes String Unique ID of the conversation task. Returned when the conversation task starts successfully.
Command Yes String Control command.
Valid values:

- Interrupt: Force-interrupt the AI bot's current speech.
- invokellm: Inject text into the current conversation context to trigger one LLM response. Not supported in S2S mode.
- invoketts: Inject text into the current TTS so the AI bot broadcasts it. Not supported in S2S mode.
InvokeLLM No VoiceConversationInvokeLLM Configuration for injecting text into the LLM. Required when Command is invokellm.
InvokeTTS No VoiceConversationInvokeTTS Configuration for injecting text into TTS. Required when Command is invoketts.

3. Output Parameters

Parameter Name Type Description
TaskId String Unique ID of the conversation 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 Interrupt a dialogue

Input Example

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

{
    "SdkAppId": 1400704311,
    "TaskId": "-m9jX35U7ginppW8rcCa0K3L6C*************************b7SjBmnozma7Gfq2Tbb5htQE.",
    "Command": "interrupt"
}

Output Example

{
    "Response": {
        "TaskId": "-m9jX35U7ginppW8rcCa0K3L6C*************************b7SjBmnozma7Gfq2Tbb5htQE.",
        "RequestId": "13bd15e4-70b3-42e3-a7d6-3b2b3f26ff53"
    }
}

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
AuthFailure CAM signature/authentication error.
AuthFailure.UnauthorizedOperation CAM authentication failed.
AuthFailure.UnsupportedOperation Unsupported operation.
FailedOperation Operation failed.
InternalError Internal error.
InvalidParameter Parameter error.
InvalidParameter.OutOfRange Parameter value is out of range.
InvalidParameter.SdkAppId SdkAppId is incorrect.
MissingParameter Missing parameter.
MissingParameter.Region Region parameter missing.
MissingParameter.SdkAppId SdkAppId is missing.
MissingParameter.UserId Missing UserId parameter.
ResourceNotFound The resource does not exist.
UnsupportedOperation Unsupported operation.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan