Connect your agent
After publishing your agent, you can integrate it into your applications using the Conversational AI Engine API. The Embed option in Studio provides a pre-configured API call with your agent's identifiers already populated.
Prerequisites
- A published agent
- Agora Customer ID and Customer secret for API authentication
Get the embed code
To get the API call for your agent:
- In Agent Studio, select Agents from the sidebar.
- From the agent list, open the Actions menu for your agent and select Embed Agent.
- Copy the generated code snippet. It includes your agent's
name,pipeline_id, channel settings, and a valid RTCtoken.
Use this as the starting point for integrating the agent into your backend service. For full API reference, see Start a conversational AI agent.
This endpoint requires Basic Auth. Generate a Base64-encoded credential with your Customer ID and Customer Secret. The generated code snippet includes an RTC token under properties which is valid for 24 hours.
Sample code
The following examples show how to start an agent call using your embed credentials. Replace <BASE64_ENCODED_CREDENTIALS> with your Base64-encoded Agora Customer ID and Customer secret.
- curl
- Python
- Node.js
The pipeline_id in the embed code is the internal identifier for your published agent configuration. It is automatically populated when you copy the embed code from the Embed Agent option in Studio.