---
agentTools:
  projectIndex: https://odio-api.readme.io/llms.txt
---

# Introduction

Explore the odio.ai APIs and discover how to programmatically access a range of powerful voiceover features.

Odio.ai's APIs equip developers with powerful tools to seamlessly integrate advanced voiceover technology into their applications.

This is where you show your users how to set it up. You can use code samples, like this

## API Key

To use the HTTP API, an API key is required. You can generate one easily through your account dashboard. [Get your api key](https://odio.ai/user/api/).

## Rate Limits

The maximum number of requests allowed per day is 1,000, with a rate limit of 40 requests per minute. Each request can generate up to 3,000 characters.

## Custom Rate Limits

If you require higher rate limits or have specific usage needs, please contact us. We offer customisable plans tailored to your requirements, ensuring that you get the resources you need for optimal performance.

## Getting Started with the API

### Fetching voice list

Before generating text-to-speech, you'll need a voice\_id. To see the voices available to your account, use the following example.

```curl cURL
curl --location 'https://odio.ai/api/v1/voices' \
--header 'X-API-KEY: YOUR-API-KEY'
```
```javascript
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "YOUR-API-KEY"); 

const formdata = new FormData();

const requestOptions = {
  method: "GET",
  headers: myHeaders,
  body: formdata,
  redirect: "follow"
};

fetch("https://odio.ai/api/v1/voices", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
```
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://odio.ai/api/v1/voices',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'X-API-KEY: YOUR-API-KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
```python
import requests

url = "https://odio.ai/api/v1/voices"

payload = {}
files={}
headers = {
  'X-API-KEY': 'YOUR-API-KEY'
}

response = requests.request("GET", url, headers=headers, data=payload, files=files)

print(response.text)

```
```typescript NodeJs
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://odio.ai/api/v1/voices',
  'headers': {
    'X-API-KEY': 'YOUR-API-KEY'
  },
  formData: {

  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

Response

[block:html]
{
  "html": "<pre><code class=\"language-json\">\n{\n  \"status\": true,\n  \"message\": \"OK\",\n  \"data\": [\n    {\n      \"voice_id\": \"8526acc8081fc79e\",\n      \"name\": \"Bruce\",\n      \"gender\": \"Male\",\n      \"language_name\": \"English (US)\",\n      \"emotion\": [],\n      \"language_code\": \"en-US\",\n      \"voice_type\": \"Premium\"\n    },\n    {\n      \"voice_id\": \"73598de20059283d\",\n      \"name\": \"Bruce\",\n      \"gender\": \"Male\",\n      \"language_name\": \"English (US)\",\n      \"emotion\": [],\n      \"language_code\": \"en-US\",\n      \"voice_type\": \"Standard\"\n    }\n  }\n</code><pre>"
}
[/block]

<br />

***

## Generate Audio From Text

This endpoint is used to convert text to speech.

To generate speech using the TTS endpoint, you can use the following example. Make sure to replace "YOUR-API-KEY" with your actual API key and "voice\_id\_here" with the voice\_id you obtained from the /voices endpoint.

```curl
curl --location 'https://odio.ai/api/v1/text-to-speech' \
--header 'X-API-KEY: YOUR-API-KEY' \
--form 'voice_id="voice_id_here"' \
--form 'text="Hello, nice to meet you!"'
```
```javascript
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "YOUR-API-KEY");
myHeaders.append("", "");

const formdata = new FormData();
formdata.append("voice_id", "voice_id_here");
formdata.append("text", "Hello, nice to meet you!");

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: formdata,
  redirect: "follow"
};

fetch("https://odio.ai/api/v1/text-to-speech", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
```
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://odio.ai/api/v1/text-to-speech',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('voice_id' => 'voice_id_here','text' => 'Hello, nice to meet you!'),
  CURLOPT_HTTPHEADER => array(
    'X-API-KEY: YOUR-API-KEY', 
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
```python
import requests

url = "https://odio.ai/api/v1/text-to-speech"

payload = {'voice_id': 'voice_id_here',
'text': 'Hello, nice to meet you!'}
files=[

]
headers = {
  'X-API-KEY': 'YOUR-API-KEY'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

```
```typescript NodeJs
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://odio.ai/api/v1/text-to-speech',
  'headers': {
    'X-API-KEY': 'YOUR-API-KEY', 
  },
  formData: {
    'voice_id': 'voice_id_here',
    'text': 'Hello, nice to meet you!'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

Response

Response code: 200 - audio/mpeg

The response is of type `file`.

***

<br />

Response code: 422

[block:html]
{
  "html": "<pre><code class=\"language-json\">\n{\n  \"status\": boolean,\n  \"error\": 'string'\n}\n</code><pre>"
}
[/block]