Agora and Murf

Use Murf TTS with Agora’s Conversational AI Engine

Murf is available as a text-to-speech (TTS) provider for Agora’s Conversational AI Engine. You start voice agents through Agora’s REST API and choose Murf for TTS so the agent speaks with Murf voices in your Agora channel sessions.

Introduction to Agora

Agora’s Conversational AI Engine runs AI voice agents in real time inside Agora channels: end users and agents join the same session, with configurable automatic speech recognition (ASR), large language models (LLMs), and TTS. Agora handles low-latency audio transport; your backend uses Agora’s REST APIs to create agents and pass third-party credentials (including for TTS).

With Murf as your TTS provider, set vendor to murf in the agent’s tts configuration and supply the params documented by Agora for Murf. The sections below cover prerequisites, REST examples, and those parameters in more detail.

Setup & requirements

Requirements

  • Conversational AI enabled for your Agora project
  • From Agora Console: App ID, Customer ID and Customer secret (for REST auth), and an RTC token for the agent to join a channel
  • API keys for a supported LLM (e.g. OpenAI) and Murf (for TTS)
  • A client app that can join a voice or video call on Agora (the user side of the conversation)

Client SDKs

To build that client, use Agora’s Voice or Video SDKs for your platform. Install the package for Android, iOS, Web, Windows, macOS, or other targets from Agora’s SDK documentation.

API keys and authentication

  • Murf API key: from the Murf API Dashboard
  • Agora REST auth: use Customer ID and Customer secret as a Basic auth credential; see the REST quickstart for how to form base64-encoded credentials for the join call

Start a conversational AI agent

Call the join endpoint to create an agent that joins an Agora channel. Use Murf in the tts block as follows.

Sample tts configuration (Murf)

1"tts": {
2 "vendor": "murf",
3 "params": {
4 "api_key": "<murf_api_key>",
5 "base_url": "wss://global.api.murf.ai/v1/speech/stream-input",
6 "voiceId": "Matthew",
7 "locale": "en-US",
8 "rate": 0,
9 "pitch": 0,
10 "model": "FALCON",
11 "sample_rate": 24000
12 }
13}

The examples below follow the REST quickstart.

1const fetch = require("node-fetch");
2
3const url = "https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/join";
4
5const headers = {
6 Authorization: "Basic <your_base64_encoded_credentials>",
7 "Content-Type": "application/json",
8};
9
10const data = {
11 name: "unique_name",
12 properties: {
13 channel: "<your_channel_name>",
14 token: "<your_rtc_token>",
15 agent_rtc_uid: "0",
16 remote_rtc_uids: ["1002"],
17 enable_string_uid: false,
18 idle_timeout: 120,
19 llm: {
20 url: "https://api.openai.com/v1/chat/completions",
21 api_key: "<your_llm_api_key>",
22 system_messages: [
23 {
24 role: "system",
25 content: "You are a helpful chatbot.",
26 },
27 ],
28 greeting_message: "Hello, how can I help you?",
29 failure_message: "Sorry, I don't know how to answer this question.",
30 max_history: 10,
31 params: {
32 model: "gpt-4o-mini",
33 },
34 },
35 asr: {
36 language: "en-US",
37 },
38 tts: {
39 vendor: "murf",
40 params: {
41 api_key: "<murf_api_key>",
42 base_url: "wss://global.api.murf.ai/v1/speech/stream-input",
43 voiceId: "Matthew",
44 locale: "en-US",
45 rate: 0,
46 pitch: 0,
47 model: "FALCON",
48 sample_rate: 24000,
49 },
50 },
51 },
52};
53
54fetch(url, {
55 method: "POST",
56 headers: headers,
57 body: JSON.stringify(data),
58})
59 .then((response) => response.json())
60 .then((json) => console.log(json))
61 .catch((error) => console.error("Error:", error));

A successful response (200 OK) includes agent_id, create_ts, and status.

TTS params reference (Murf)

These fields are described in the Agora Murf documentation as validated for the Conversational AI Engine.

ParameterTypeDescription
api_keystring (required)Murf API key for authentication.
base_urlstring (nullable)WebSocket endpoint for streaming TTS (e.g. wss://global.api.murf.ai/v1/speech/stream-input).
voiceIdstring (nullable)Voice id (e.g. Matthew).
localestring (nullable)Locale for the voice (e.g. en-US).
ratenumber (nullable)Speech rate; 0 is default.
pitchnumber (nullable)Pitch; 0 is default.
modelstring (nullable)TTS model (e.g. FALCON).
sample_ratenumber (nullable)Audio sample rate in Hz (e.g. 24000).

Features

  • Enterprise-grade TTS: Murf models for natural agent speech in Agora channels
  • Streaming: Murf WebSocket output aligned with Agora’s real-time stack when configured with the documented base_url
  • Voice and audio controls: voiceId, locale, rate, pitch, model, and sample_rate in params

Available voices

Support