Quickstart
This guide will help you get started with the Murf API. You’ll learn how to get your API key, make your first text-to-speech request, and transcribe audio with speech-to-text.
Generate an API Key
To use the Murf API, you need an API key. If you don’t have one yet, you can create your API Key here. Store the key in a secure location, as you’ll need it to authenticate your requests. Then, save the key as an environment variable in your terminal.
Make Your First API Request (Streaming) - Falcon 2.1 Model
To use Murf’s streaming API, you can either use the REST API using an HTTP client to receive audio data in real-time, or use one of our official SDKs.
Murf offers a variety of voice IDs for different languages and accents. You can choose a voice ID that best suits your application’s needs. You can see the full list of available voice IDs here, or fetch the list programmatically using the List Voices endpoint.
The following code snippets assume that you have exported the MURF_API_KEY system environment variable as shown above.
Python SDK
REST API
Install the Python SDK and PyAudio
pyaudio depends on PortAudio, you may need to install it first.
Installing PortAudio (for PyAudio)
PyAudio depends on PortAudio, a cross-platform audio I/O library. You may need to install PortAudio separately if it’s not already on your system.
macOS
Linux (Debian/Ubuntu)
Windows
Once you have installed PortAudio, you can install the required Python packages using the following command:
Speech to Text (Beta): Streaming
Text to Speech streaming sends text and receives audio. Speech to Text streaming is the reverse: it sends audio over a WebSocket and returns partial transcripts while the caller speaks, then a final transcript when you end the turn. This example streams a WAV file and prints the transcripts.
Speech to Text (Beta) is available in the India region only. Connect to wss://in.api.murf.ai/v1/transcription/stream-input.
To stream from a microphone or handle multi-turn conversations, see Streaming.
Next Steps
Explore the API Reference for text-to-speech, or the Speech to Text (Beta) guide for transcription.