This topic describes how to quickly test your AI agent by using a trial token generated in the Intelligent Media Services (IMS) console without deploying a server.
This solution is intended for testing purposes only and is not recommended for official release, as it may lead to abuse of shareToken.
Generate a trial token
Go to the AI Agents page and find the agent you want to test. If no agents are available, create one first. For information about how to create an agent, see Create and manage AI agents.
Click QR Code for Demo in the Actions column and select the validity period for the QR code.
Click Generate and save the QR codes generated.

Integrate the AI agent
Web
You only need to add the installation code to the <body> section of the webpage.
<script src="https://g.alicdn.com/apsara-media-aui/amaui-web-aicall/1.6.2/aicall-ui.js"></script>
<script>
new ARTCAICallUI({
userId: '123', // The ID of the user who joins the real-time communication (RTC). It is recommended to use the user ID used for business login.
root: document.getElementById('root'), // The node where the UI is rendered. The interface fills the entire area.
shareToken: 'xxxx', // The token copied from the console.
}).render();
</script>Android
Download and integrate the source code
Go to the GitHub repository to download the source code.
After you download the source code from the repository, open Android Studio, choose File > New > Import Module to import the AUIAICall folder.
Modify the following dependencies in the build.gradle file of the AUIAICall folder:
dependencies { implementation 'androidx.appcompat:appcompat:x.x.x' // Replace x.x.x with a version that is adapted to your project. implementation 'com.google.android.material:material:x.x.x' // Replace x.x.x with a version that is adapted to your project. androidTestImplementation 'androidx.test.espresso:espresso-core:x.x.x' // Replace x.x.x with a version that is adapted to your project. implementation 'com.aliyun.aio:AliVCSDK_ARTC:7.1.0' implementation 'com.aliyun.auikits.android:ARTCAICallKit:2.3.0' }NoteFor the latest compatible version of ARTC SDK, see Release history.
Wait until the synchronization is complete.
Test the integration
Context currentActivity = AUIAICallEntranceActivity.this;
// The ID of the user who joins the real-time communication (RTC). It is recommended to use the user ID used for business login.
String loginUserId = "123";
// shareToken is the token copied from the console.
String shareToken = "xxxxx";
ARTCAICallController.launchCallActivity(currentActivity, shareToken, loginUserId, "");iOS
Download and integrate the source code
Go to the GitHub repository to download the source code.
After you download the source code from the repository, copy the iOS folder to the code directory of your app and rename the folder AUIAICall. Make sure that the folder is placed at the same directory level as your Podfile. You can delete the Example and AICallKit directories.
Modify your Podfile to import the following modules:
AliVCSDK_ARTC: ApsaraVideo MediaBox SDK for Alibaba Real-Time Communication (ARTC). You can also import AliVCSDK_Standard or AliVCSDK_InteractiveLive. For more information, see Integrate ApsaraVideo MediaBox SDK for iOS.
ARTCAICallKit: an SDK for AI-powered real-time interactive calls.
AUIFoundation: the basic UI components.
AUIAICall: the source code of UI components for AI-powered calls.
# iOS 11.0 or later is required. platform :ios, '11.0' target' Your app target' do # Integrate ApsaraVideo MediaBox SDK based on your business requirements. AliVCSDK_ARTC, AliVCSDK_Standard, and AliVCSDK_InteractiveLive are supported. pod 'AliVCSDK_ARTC', '~> 7.1.0' # An SDK for AI-powered real-time interactive calls. pod 'ARTCAICallKit', '~> 2.3.0' # The source code of the basic UI components. pod 'AUIFoundation', :path => "./AUIAICall/AUIBaseKits/AUIFoundation/", :modular_headers => true # The source code of UI components for AI-powered calls. pod 'AUIAICall', :path => "./AUIAICall/" endNoteFor the latest compatible version of ARTC SDK, see Release history.
Run the
pod install --repo-updatecommand.Open the
info.Plistfile of your project and add the NSMicrophoneUsageDescription, NSCameraUsageDescription, and NSPhotoLibraryUsageDescription permissions.In the project settings, enable Background Modes on the Signing & Capabilities tab. If you do not do so, you must develop code to end calls when the app is switched to the background.
Test the integration
import AUIFoundation
import AUIAICall
// The following code can initiate a conversation with the agent. You can add the code snippet to your button click event.
AUIAICallManager.defaultManager.checkDeviceAuth(agentType: .VisionAgent) {
let topVC = viewController ?? UIViewController.av_top()
let controller = AUIAICallStandardController(userId: "123") // The ID of the user who joins the real-time communication (RTC). It is recommended to use the user ID used for business login.
controller.agentShareInfo = "xxxxx" // The token copied from the console.
let vc = AUIAICallViewController(controller)
vc.enableVoiceIdSwitch = false
topVC.av_presentFullScreenViewController(vc, animated: true)
}