Introduction
Dive into the Camb.ai APIs and learn how to programmatically access our powerful features.
Camb.ai’s APIs provide developers with the tools to integrate our cutting-edge voiceover and dubbing technology into their applications.
Understanding the API
The Camb.ai API is the backbone of our platform, powering both the website and programmatic access. It ensures consistent quality and performance across all interfaces. Here’s what you need to know to get started:
API Key
Our journey begins with an API key, which you can obtain from your Camb.ai dashboard. This key is essential for authenticating your requests. Click here to generate your API Key.
API Quota
The API shares its quota with the website, meaning any characters or duration of content generated will count towards your account’s limit, regardless of the interface used.
Getting Started with the API
Fetching Voice IDs
Before generating text-to-speech, you’ll need a voice_id
.
To list the voices available to your account, use the following Python code:
Example:
Response
Fetching Source and Target Languages
To retrieve the list of available source and target languages supported by the API, you can use the following Python examples. These examples demonstrate how to make GET requests to the respective endpoints and parse the response to list the languages.
Fetching Source Languages
Example Response:
Fetching Target Languages
Example response:
Specify Gender
All of the following are enums that can be passed as gender's
value in the API request as necessary. Do not pass a string wherever “gender” is mentioned, you need to pass gender as an integer.
Text-to-Speech (TTS) Endpoint
The TTS endpoint is your tool for converting text into speech. You’ll need to provide text, a voice_id
, and voice settings. For more details, refer to our TTS documentation.
Generating Speech
To generate speech using the TTS endpoint, you can use the following Python example. Make sure to replace "your_api_key_here"
with your actual API key and "voice_id_here"
with the voice_id
you obtained from the /list_voices
endpoint.
The response will provide you with a task_id
that you can use to retrieve the generated speech once it’s ready:
Advanced Features
For those looking to delve deeper, Camb.ai’s API offers advanced features such as voice customization and history retrieval. Explore our full API reference for detailed information on these capabilities.