All Products
Search
Document Center

Intelligent Media Services:GenerateAIAgentCall

Last Updated:Jun 13, 2025

Creates an AI agent. This operation returns the channel in which the AI agent resides, the username of the AI agent in the channel, and the token that you can use to join the channel.

Operation description

Request description

You can call this operation to create an AI agent based on the provided ID. You can join the channel based on the returned information and talk to the agent.

Note: Make sure that the provided AI agent ID is valid and configure optional parameters based on your business requirements.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ice:GenerateAIAgentCallnone
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
AIAgentIdstringYes

The ID of the AI agent.

39f8e0bc005e4f309379701645f4****
ExpirelongNo

The time when the token expires. Unit: seconds. Default value: 3600. Valid values: 0 to 604800.

3600
UserIdstringNo

The username of the AI agent in the channel. If you do not specify this parameter, the system automatically generates a username. The value can be up to 64 characters in length.

877ae632caae49b1afc81c2e8194ffb4
TemplateConfigAIAgentTemplateConfigNo

The template configurations of the AI agent. The specified configurations are merged with the template configurations that are specified in the console. If you do not specify this parameter, the system uses the default configurations for an AI agent created in the console.

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

AIAgentUserIdstring

The username of the AI agent in the Alibaba Real-Time Communication (ARTC) channel.

877ae632caae49b1afc81c2e8194ffb4
ChannelIdstring

The ARTC channel ID.

70f22d5784194938a7e387052f2b3208
InstanceIdstring

The ID of the AI agent.

39f8e0bc005e4f309379701645f4****
RequestIdstring

The request ID.

7B117AF5-2A16-412C-B127-FA6175ED1AD0
Tokenstring

The ARTC token of the client.

eyJhcHBpZCI6ICIxMjM0MTIzNxxxxx
UserIdstring

The username in the ARTC channel.

user123

Examples

Sample success responses

JSONformat

{
  "AIAgentUserId": "877ae632caae49b1afc81c2e8194ffb4",
  "ChannelId": "70f22d5784194938a7e387052f2b3208",
  "InstanceId": "39f8e0bc005e4f309379701645f4****",
  "RequestId": "7B117AF5-2A16-412C-B127-FA6175ED1AD0",
  "Token": "eyJhcHBpZCI6ICIxMjM0MTIzNxxxxx",
  "UserId": "user123"
}

Error codes

For a list of error codes, visit the Service error codes.