Getting Started

The basics of the Replica API

API access is available on all paid subscription tiers.

Welcome to the Replica API documentation! This guide will help you get started quickly, from obtaining your API Key to generating speech with your chosen voice.

Obtain Your API Key Copied!

To start using the Replica API, you'll need an API Key. You can find your API Key in your account settings.

While the API Key is the most straightforward way to authenticate, there are other methods available. For more details, check out our Authentication Guide .

Choose a Voice (and Style) Copied!

With your API Key in hand, you can explore and select from a range of available Replica voices by querying the /library/voices endpoint. Each voice can have different styles. For this example, we will use Freya's "Serious" style, identified by the speaker_id :

  • Voice Name : Freya

  • Style : Serious

  • Speaker ID : 9b1f5c24-a18b-4b9e-a785-b3a3b3b8751a

Generate Text-to-Speech Copied!

The main endpoint for generating speech is /speech/tts . This endpoint returns an audio file link based on the input text. While there are several parameters available to customize the output (see the API Reference for more details), here’s a minimal example to get you started:

Below is a Python example that demonstrates how to make a request to the Replica API to generate speech using Freya's "Serious" style:

import requests

# Endpoint for Text-to-Speech
url = "https://api.replicastudios.com/v2/speech/tts"

# Request payload
payload = {
    "speaker_id": "9b1f5c24-a18b-4b9e-a785-b3a3b3b8751a",  # Freya - Serious
    "text": "Welcome to Replica Studios.",
    "model_chain": "latest",
    "language_code": "en",
}

# Request headers, including your API Key
headers = {
    "Content-Type": "application/json",
    "X-Api-Key": "..."  # Replace with your API key
}

# Sending the request
response = requests.post(url, json=payload, headers=headers)

# Extracting the generated audio URL from the response
response_payload = response.json()
print("Generated Audio URL:", response_payload["url"])

This code snippet sends a POST request to the API, generating speech and returning a URL to the audio file. Replace "X-Api-Key" with your actual API Key to run the example.

This documentation refers to the latest version of the Replica API. For details on our legacy API, please visit Legacy API Documentation .

What’s Next? Copied!

  • Explore additional parameters and advanced usage in the API Reference .

  • Experiment with different voices and styles to find the perfect fit for your needs.