This guide introduces how to create an interactive messaging agent.
Before you begin, ensure you meet the following requirements:
Real-time Conversational AI is enabled. To enable the feature, go to the buy page.
Step 1: Create an interactive messaging workflow
Go to the Real-time Workflow Template page in the IMS console and click Create Workflow Template.
Set Workflow Type to Messaging and configure the workflow nodes as needed.
NoteTo use speech recognition and spoken response features, you must configure the following nodes:
Configure the Speech-to-text node to enable speech recognition.
Configure the Text-to-speech node to enable spoken responses.

Speech-to-Text (STT)
This node converts audio input into text and supports multiple languages.

Preset: The system's preset models support selecting a source language, setting the silence duration, and configuring custom hotwords.
Language Model: Select the source language as needed.
Silent Time: The duration the agent waits for a user's voice input before timing out.
Custom Hotword: To improve the recognition accuracy of domain-specific terms, configure hotwords. For more information, see Hotword detection in speech recognition.
Third-party Plug-in: Currently, only iFLYTEK plug-in is supported. Get the required parameters at iFLYTEK.
Text-to-Speech (TTS)
This node converts text to spoken audio, letting users hear the system's response.

You can select a TTS model that suits your application:
Preset Template: For a preset template, you need to configure the voice. For examples of different voice effects, see Intelligent voice samples.
Self-developed Template: Integrate your own model into the workflow by following a standardized protocol. For more information, see Access TTS models.
Third-party Plug-in: Currently, only the MiniMax Speech Model is supported. Multiple versions are available, and we recommend using the latest one. For more information, see MiniMax Speech Model.
Large Language Model (LLM)
The LLM node uses text from the STT node and a large language model to understand and generate natural language.

Real-time Conversational AI supports integration with Qwen (system preset), Alibaba Cloud Model Studio, Tongyi Xingchen, and self-developed models (OpenAI-compliant).
Alibaba Cloud Model Studio
Alibaba Cloud Model Studio is a one-stop platform for model development and application building. Select and integrate models and services from Alibaba Cloud Model Studio:
Model: In the Model section of Alibaba Cloud Model Studio, click a model that meets your requirements to obtain the ModelId. Click the settings icon in the upper-right corner, then click API-KEY to obtain an API Key.
Application: Create an agent application in Alibaba Cloud Model Studio. After the application is created, obtain the AppId.
Click the settings icon in the upper-right corner, then click API-KEY to obtain an API Key.
Tongyi Xingchen
Tongyi Xingchen enables you to create highly personalized agents, each with a unique persona and style. Combined with real-time voice interaction capabilities, these agents can deliver rich, interactive experiences in various scenarios.
ModelId: Tongyi Xingchen offers the following five models:
xingchen-lite,xingchen-base,xingchen-plus,xingchen-plus-v2, andxingchen-max.API-KEY: Visit the Tongyi Xingchen console to create and obtain an API Key.
Self-developed model (OpenAI-compliant)
Real-time Conversational AI supports self-developed LLMs that comply with the OpenAI specification.
OpenAI specification: To connect a model using the OpenAI specification, provide the following parameters:
Name
Description
Example
ModelId
The model name. This parameter corresponds to the model field in the OpenAI specification.
abc
API-KEY
The authentication information. This parameter corresponds to the api_key field in the OpenAPI specification.
AUJH-pfnTNMPBm6iWXcJAcWsrscb5KYaLitQhHBLKrI
Model URL (HTTPS)
The service request URL. This parameter corresponds to the base_url field in the OpenAPI specification.
http://www.abc.com
For more details on integrating custom LLMs, see Access LLMs.
Click Save to create the workflow.
Step 2: Create an interactive messaging agent
Go to the AI Agents page in the IMS console and click Create AI Agent.
Configure the basic information and bind the messaging workflow.

Create an interactive messaging application.
NoteThe interactive messaging application serves as a communication bridge for the conversational features.


Configure the application and click Submit to create the agent.
Step 3: Test the agent
After you create the agent, you can test it by scanning a QR code for demo.
On the AI Agents page, generate a QR code for the demo.

Scan the QR code with DingTalk, WeChat, or a browser, or copy the demo URL into your browser.

Step 4: Integrate the interactive messaging agent
The following parameters are required for integration. To learn how to integrate the interactive messaging agent into your project, see Integrate an interactive messaging agent.
Region ID: The region where your workflow and agent are located as shown in the IMS console.

Region Name
Region ID
China (Hangzhou)
cn-hangzhou
China (Shanghai)
cn-shanghai
China (Beijing)
cn-beijing
China (Shenzhen)
cn-shenzhen
Singapore
ap-southeast-1
The AppId and AppKey of the interactive messaging application:


AccessKey pair: To get the AccessKey ID and AccessKey secret, see Create an AccessKey pair.