StartAgent

更新时间:
复制 MD 格式

Start AI Agent

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rtc:StartAgent

create

*App

acs:rtc::{#accountId}:app/{#AppId}

None None

Request parameters

Parameter

Type

Required

Description

Example

AppId

string

Yes

The application ID. You can create and query this ID in the console. Only one application ID is supported.

aoe****

ChannelId

string

Yes

The ID of the channel to join. Only one channel ID is supported.

yourChannelId

TaskId

string

Yes

The task ID.

yourTaskId

TemplateId

string

Yes

The template ID.

76dasgb****

RtcConfig

object

Yes

The configuration for the agent to join an RTC channel.

2

UserId

string

Yes

The user ID for the agent in the RTC channel.

423341

TargetUserIds

array

No

A list of user IDs that the agent subscribes to. Currently, only a single user ID is supported.

string

No

A user ID.

41411

UserInactivityTimeout

integer

No

The maximum duration of user inactivity, in seconds. The agent automatically stops and leaves the channel if either of the following conditions is met for this duration:

  1. All users in the targetUserIds list have left the channel.

  2. No users from the targetUserIds list have joined the channel.

Default: 30.
Range: [5, 180].

30

VoiceChatConfig

object

No

The configuration for AI voice chat.

ChatMode

integer

No

1: Natural conversation mode (default).
2: Walkie-talkie mode.

1

InterruptMode

integer

No

1: Enables voice interruption (default).
2: Disables voice interruption.

1

Greeting

string

No

The agent's initial greeting.

早上好,我的朋友

ASRConfig

object

No

Configuration for Automatic Speech Recognition (ASR).

SourceLanguage

string

No

The language is automatically detected, so this parameter is not required.

zh

SemanticPunctuationEnabled

boolean

No

Enables semantic punctuation for sentence segmentation. If false, segmentation is based on Voice Activity Detection (VAD).

false

MaxSentenceSilence

integer

No

The silence duration threshold, in milliseconds, for VAD-based sentence segmentation.
Default: 800.
Recommended range: [200, 6000].

800

VocabularyId

string

No

The ID of the custom vocabulary to use.

vocab-xxx-24ee19fa8cfb4d52902170a0xxxxxxxx

LanguageHints

array

No

If this parameter is not set, the model automatically detects the language.
Supported language codes:
zh: Chinese (supports dialects including Shanghainese, Wu, Minnan, Northeastern Mandarin, Gansu, Guizhou, Henan, Hubei, Hunan, Jiangxi, Ningxia, Shanxi, Shaanxi, Shandong, Sichuan, Tianjin, Yunnan, and Cantonese)
en: English
ja: Japanese
yue: Cantonese
ko: Korean





string

No

A language code.

zh

VadConfig

object

No

Configuration for Voice Activity Detection (VAD).

InterruptSpeechDuration

integer

No

The minimum duration, in milliseconds (ms), of continuous human speech required to trigger an interruption. This helps prevent false interruptions.
Default: 300.
Range: [0, 3000].

300

LLMConfig

object

No

Configuration for the Large Language Model (LLM).

Vendor

string

No

The name of the cloud service provider. Examples: aliyun (for Model Studio), thirdparty.

aliyun

Model

string

No

The name of the model.
For the aliyun vendor, supported models include qwen-plus, deepseek-r1, and qwen-omni-turbo.

qwen-plus

ApiKey

string

No

The API key from the cloud service provider.

xxxxxxxxxxx

Temperature

number

No

The sampling temperature, which controls the randomness of the generated text. A higher value increases randomness.
Range: [0, 2).
Default: 0.7.
Note: This parameter is not supported for the deepseek-r1 model.


0.7

TopP

number

No

Controls output diversity via nucleus sampling. The model samples from the smallest set of tokens whose cumulative probability mass exceeds this value. A higher value results in a more diverse output.
Range: (0, 1].
Default: 0.8.

0.8

MaxToken

integer

No

The maximum number of tokens for the generated response. For deepseek and qwen models, the upper limit is 8192.
Default: 8192.

500

HistoryDepth

integer

No

The number of previous conversation turns to include as context for the model.
Default: 3.

3

Prompt

string

No

A system prompt that instructs the model on its role, behavior, or persona.

xxxx

Url

string

No

The access URL for a third-party LLM.

https://xxxxx

Params

object

No

A key-value map for custom parameters. This parameter is deprecated; use BizParams instead.

{\"verification_code\": \"xxx\"}

BizParams

any

No

Custom parameters.

AppId

string

No

The agent application ID. You can specify either Model or AppId. If both are provided, AppId takes precedence.

e****

ToolExecutionConfig

any

No

Tools

array

No

any

No

TTSConfig

object

No

Configuration for Text-to-Speech (TTS).

Vendor

string

No

The cloud service provider. Example: aliyun (for Model Studio).

aliyun

Model

string

No

The name of the TTS model. Example: cosyvoice-v1.

cosyvoice-v1

ApiKey

string

No

The API key from the cloud service provider.

xxxxxx

Voice

string

No

The voice for the synthesized speech. If you use the cosyvoice-v1 model from Alibaba Cloud, the default voice is longxiaoxia.
Available voices: longwan, longcheng, longhua, longxiaochun, longxiaoxia, longxiaocheng, longxiaobai, longlaotie, longshu, longshuo, longjing, longmiao, longyue, longyuan, longfei, longjielidou, longtong, longxiang, loongstella, loongbella.

longxiaoxia

Volume

integer

No

The volume of the synthesized speech.
Range: [0, 100].
Default: 50.

50

Rate

number

No

The speech rate.
Range: [0.5, 2.0].
Default: 1.0.

1

Pitch

number

No

The pitch of the synthesized speech.
Range: [0.5, 2.0].
Default: 1.0.

1

FilterBrackets

array

No

Specifies bracket types whose enclosed content should be excluded from speech synthesis.

integer

No

An integer representing the bracket type to filter.
1: Chinese parentheses()
2: English parentheses ()
3: Chinese square brackets【】
4: English square brackets []
5: English curly braces {}




[1,2]

AgentSilenceConfig

object

No

Configures how the agent responds to silence, such as when a user is in the channel but not speaking. You can configure the agent to play an audio prompt or send a webhook notification.

Enable

boolean

No

Specifies whether to enable the silence configuration.

false

AlertTimeout

integer

No

The timeout in seconds before triggering a silence alert. The alert can be re-triggered if the silence continues.
Range: [5, 600].
Default: 0 (disabled).

0

Strategy

integer

No

The strategy for the silence alert:
1 (default): Plays the message specified in Content.
2: Sends the Content message and conversation history to the LLM, and then plays the generated response.

1

Content

string

No

The content of the silence alert message.

**

WebhookTriggerTimeout

integer

No

The timeout in seconds before triggering a silence webhook. The webhook can be re-triggered if the silence continues.
Range: [10, 600].
Default: 0 (disabled).

0

AmbientSoundConfig

object

No

Configuration for ambient sound.

SoundId

string

No

Specifies the ambient sound to play.

  • If this parameter is not provided, ambient sound is disabled.

  • Built-in sounds: Set to white_noise or office.

  • For custom sounds, provide a soundId that you have configured in the console with a corresponding download URL. (This feature is planned for a future release).

white_noise

Volume

integer

No

The volume of the ambient sound.
Range: [0, 100].
Default: 50.

50

InterruptConfig

object

No

Configuration for interruption handling.

SemanticsInterrupt

boolean

No

Specifies whether to enable semantic interruption.
Default: true.

true

BackChannelConfig

object

No

Configuration for back-channeling.

UserTurnEnd

boolean

No

Specifies whether to enable back-channeling after the user finishes speaking.
Default: false.

false

Version

integer

No

EnableVideoUnderstanding

boolean

No

Specifies whether to enable video understanding. If enabled, the LLM must support multimodal inputs.

preferVideo

integer

No

When video understanding is enabled, specifies which video stream to prioritize if both camera and screen sharing streams are active. The agent can process only one stream at a time.

  1. 1: Prioritize the camera stream.

  2. 2: Prioritize the screen sharing stream.

Default: 1.

Response elements

Element

Type

Description

Example

object

The response data.

RequestId

string

The unique ID of the request.

6159ba01-6687-4fb2-a831-f0cd8d188648

Examples

Success response

JSON format

{
  "RequestId": "6159ba01-6687-4fb2-a831-f0cd8d188648"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.