Skip to content

MurfTTS

Convert text to speech using Murf AI's Gen2 model via a simple REST API.

Use MurfTTS when you want natural, studio-quality speech synthesis from Murf AI’s Gen2 model via a simple REST call. Each synthesize() request returns the complete audio as a Blob — no WebSocket management required. Murf’s voice library spans 20+ languages, and many voices offer multiple speaking styles (e.g. Conversational, Promo) through the style option.

Prerequisites

  • A Murf API key or a CompositeVoice proxy server
  • No additional dependencies required. MurfTTS uses native fetch internally.

Basic setup

import { CompositeVoice, NativeSTT, AnthropicLLM, MurfTTS, BrowserAudioOutput } from 'composite-voice';

const voice = new CompositeVoice({
  providers: [
    new NativeSTT(),
    new AnthropicLLM({
      proxyUrl: '/api/proxy/anthropic',
      model: 'claude-haiku-4-5',
    }),
    new MurfTTS({
      proxyUrl: '/api/proxy/murf',
      voiceId: 'en-US-natalie',
      format: 'mp3',
      style: 'Conversational',
    }),
    new BrowserAudioOutput(),
  ],
});

await voice.initialize();
await voice.startListening();

Configuration options

OptionTypeDefaultDescription
apiKeystringMurf API key (direct mode)
proxyUrlstringProxy server URL (recommended for production)
voiceIdstringrequiredVoice identifier (e.g. en-US-natalie) from GET /v1/speech/voices
modelVersionstring'GEN2'Murf model generation
formatstring'mp3'Output format: mp3, wav, flac, alaw, ulaw
sampleRatenumber44100 (server default)8000, 24000, 44100, or 48000 Hz
channelTypestring'MONO' (server default)MONO or STEREO
stylestringvoice defaultSpeaking style (varies per voice, e.g. Conversational)
ratenumber0Speech rate, -50 (slowest) to 50 (fastest)
pitchnumber0Voice pitch, -50 (lowest) to 50 (highest)
variationnumber1 (server default)Pause/pitch/speed variation, 0 to 5
localestringvoice native localeLanguage code for native multilingual voices (e.g. es-ES)
endpointstringCustom API endpoint URL
maxRetriesnumber3Retry count for failed requests

Available voices

List voices with Murf’s GET /v1/speech/voices endpoint. Voice IDs follow a {locale}-{name} pattern — en-US-natalie is a good starting point. Each voice lists its supported styles and locales.

Output formats

FormatUse case
mp3Good compression, wide browser support (default)
wavUncompressed, highest quality
flacLossless compression
alawTelephony (A-law)
ulawTelephony (u-law)

Complete example

import { CompositeVoice, MicrophoneInput, DeepgramSTT, AnthropicLLM, MurfTTS, BrowserAudioOutput } from 'composite-voice';

const tts = new MurfTTS({
  proxyUrl: '/api/proxy/murf',
  voiceId: 'en-US-natalie',
  format: 'mp3',
  style: 'Conversational',
  rate: 5,
  variation: 2,
});

const voice = new CompositeVoice({
  providers: [
    new MicrophoneInput(),
    new DeepgramSTT({ proxyUrl: '/api/proxy/deepgram' }),
    new AnthropicLLM({
      proxyUrl: '/api/proxy/anthropic',
      model: 'claude-haiku-4-5',
    }),
    tts,
    new BrowserAudioOutput(),
  ],
});

voice.on('tts.start', () => console.log('Speaking...'));
voice.on('tts.end', () => console.log('Done speaking'));

await voice.initialize();
await voice.startListening();

Voice controls

  • style — Many Murf voices ship multiple speaking styles (e.g. Conversational, Promo, Narration). Pick one that matches your agent’s tone; omit it to use the voice’s default.
  • rate / pitch — Integers from -50 to 50 on Murf’s own scale; 0 is the voice’s natural delivery.
  • variation — Adds natural variation in pauses, pitch, and speed (0–5). Higher values sound less monotone on long responses.
  • locale — Murf’s multilingual voices can speak several languages natively; set locale to switch (e.g. 'es-ES').

Tips

  • MurfTTS is REST-based, not streaming. The full audio Blob is returned after the API processes the entire input. For real-time streaming, consider DeepgramTTS.
  • MurfTTS requests base64-encoded audio (encodeAsBase64: true), so the audio arrives inline in the JSON response and no second download request is needed. If Murf returns an audioFile URL instead, the provider fetches it automatically.
  • Use proxyUrl in production so your API key stays server-side — set murfApiKey in your proxy config.

Further reading

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency