# inworld/tts-1-max

{% columns %}
{% column width="66.66666666666666%" %}
{% hint style="info" %}
This documentation is valid for the following list of our models:

* `inworld/tts-1-max`
  {% endhint %}
  {% endcolumn %}

{% column width="33.33333333333334%" %} <a href="https://aimlapi.com/app/inworld/tts-1-max" class="button primary">Try in Playground</a>
{% endcolumn %}
{% endcolumns %}

This model is designed for realtime text-to-speech generation. A larger, more expressive variant of [inworld/tts-1](/api-references/speech-models/text-to-speech/inworld/tts-1.md).

## Setup your API Key

If you don’t have an API key for the AI/ML API yet, feel free to use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).

## API Schema

## POST /v1/tts

>

```json
{"openapi":"3.0.0","info":{"title":"AIML API","version":"1.0.0"},"servers":[{"url":"https://api.aimlapi.com"}],"paths":{"/v1/tts":{"post":{"operationId":"_v1_tts","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","enum":["inworld/tts-1-max"]},"text":{"type":"string","minLength":1,"maxLength":500000,"description":"The text content to be converted to speech."},"voice":{"type":"string","enum":["Alex","Ashley","Craig","Deborah","Dennis","Dominus","Edward","Elizabeth","Hades","Heitor","Julia","Maitê","Mark","Olivia","Pixie","Priya","Ronald","Sarah","Shaun","Theodore","Timothy","Wendy"],"default":"Alex","description":"Name of the voice to be used."},"format":{"type":"string","enum":["wav","mp3"],"default":"wav","description":"Audio output format. WAV delivers uncompressed audio in a widely supported container format, while MP3 provides good compression and compatibility."},"stream":{"type":"boolean","enum":[false],"default":false}},"required":["model","text"],"title":"inworld/tts-1-max"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"audio":{"type":"string","format":"uri"},"meta":{"type":"object","nullable":true,"properties":{"usage":{"type":"object","nullable":true,"properties":{"credits_used":{"type":"number","description":"The number of tokens consumed during generation."},"usd_spent":{"type":"number","description":"The total amount of money spent by the user in USD."}},"required":["credits_used","usd_spent"]}},"description":"Additional details about the generation."}},"required":["audio"]}},"audio/wav":{"schema":{"type":"string","format":"binary","description":"Audio stream"}}}}}}}}}
```

## Code Example

{% tabs %}
{% tab title="Python" %}
{% code overflow="wrap" %}

```python
import requests

# Insert your AI/ML API key instead of <YOUR_AIMLAPI_KEY>:
api_key = "<YOUR_AIMLAPI_KEY>" 
base_url = "https://api.aimlapi.com/v1"

headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json",
}

data = {
    "model": "inworld/tts-1-max",
    "text": "It is a fast and powerful language model. Use it to convert text to natural sounding spoken text.",
    "voice": "Timothy",
}

response = requests.post(f"{base_url}/tts", headers=headers, json=data)
response.raise_for_status()

result = response.json()

print("Audio URL:", result["audio"]["url"])
```

{% endcode %}
{% endtab %}

{% tab title="JaveScript" %}
{% code overflow="wrap" %}

```javascript
import axios from "axios";

// Insert your AI/ML API key instead of <YOUR_AIMLAPI_KEY>:
const apiKey = "<YOUR_API_KEY>";
const baseURL = "https://api.aimlapi.com/v1";

const headers = {
  Authorization: `Bearer ${apiKey}`,
  "Content-Type": "application/json",
};

const data = {
  model: "inworld/tts-1-max",
  text: "It is a fast and powerful language model. Use it to convert text to natural sounding spoken text.",
  voice: "Timothy",
};

const main = async () => {
  const response = await axios.post(`${baseURL}/tts`, data, { headers });
  console.log("Audio URL:", response.data.audio.url);
};

main().catch(console.error);
```

{% endcode %}
{% endtab %}
{% endtabs %}

<details>

<summary>Response</summary>

{% code overflow="wrap" %}

```
Audio URL: https://cdn.aimlapi.com/generations/tts/inworld-tts-fc718c97-12b3-42dc-919c-518c48ace59a.mp3/1764327592881-89e9ea63-935c-42d0-b769-8290ad769b7c.mp3
```

{% endcode %}

</details>

Listen to the audio sample we generated (\~ 3.2 s):

{% embed url="<https://drive.google.com/file/d/1qPJZfzsvqsEliyVS9SZsjT-R6B_KFhNE/view>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aimlapi.com/api-references/speech-models/text-to-speech/inworld/tts-1-max.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
