Skip to content

Index TTS 2.0

Integrate

Model id index-tts-2/text-to-speech
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/index-tts-2/text-to-speech?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "prompt": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Up to $0.06 per run charged by actual usage, the rest is refunded Run it on this page

Get API key
bilibili Text to Speech #text-to-speech

Speech synthesis from a reference voice clip and text, with emotion control via audio, prompt or per-emotion strengths

bilibili · Audio

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

•required

Prompt for the speech to be generated.

•required audio_url
Drop a file, or

Source audio file used to generate speech.

Advanced emotion_prompt · emotional_audio_url · strength · should_use_prompt_for_emotion · enable_safety_checker · emotional_strengths

Emotional-style instructions that require `should_use_prompt_for_emotion` to be used as well.

Drop a file, or

Reference audio file used to extract emotional style.

default 1

Emotional influence applied during style transfer increases with this strength setting.

Per-emotion intensity values for fine-grained adjustment.

POST /run/index-tts-2/text-to-speech?wait=20 quote → $0.06
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/index-tts-2/text-to-speech?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "prompt": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Index TTS 2.0

Generates speech for the text in `prompt`, using the voice from the reference clip given as `audio_url`. Emotional style can be borrowed from a second clip with `emotional_audio_url`, scaled by `strength` (0 to 1), or set through `emotional_strengths`. Alternatively, enable `should_use_prompt_for_emotion`, optionally with a separate `emotion_prompt`. The audio comes back as a base64 object.

Parameters

Send either the canonical name or the native name, not both. Canonical names

NameType DefaultAllowed Description
audio_urlrequired audio
Typeurl · audio
Source audio file used to generate speech.
promptrequired
Typestring
Prompt for the speech to be generated.
emotional_audio_urloptional
Typeurl · audio
Reference audio file used to extract emotional style.
strengthoptional
Typenumber
Default1
0 – 1
Emotional influence applied during style transfer increases with this strength setting.
emotional_strengthsoptional
Typeobject
Per-emotion intensity values for fine-grained adjustment.
emotional_strengths.happyoptional
Typenumber
Default0
0 – 1
Intensity of the happiness emotion.
emotional_strengths.angryoptional
Typenumber
Default0
0 – 1
Intensity of anger.
emotional_strengths.sadoptional
Typenumber
Default0
0 – 1
Intensity of sadness.
emotional_strengths.afraidoptional
Typenumber
Default0
0 – 1
Intensity of fear.
emotional_strengths.disgustedoptional
Typenumber
Default0
0 – 1
Intensity of disgust.
emotional_strengths.melancholicoptional
Typenumber
Default0
0 – 1
Intensity of melancholy.
emotional_strengths.surprisedoptional
Typenumber
Default0
0 – 1
Intensity of surprise.
emotional_strengths.calmoptional
Typenumber
Default0
0 – 1
Intensity of calmness.
should_use_prompt_for_emotionoptional
Typeboolean | null
Defaultfalse
Prompt-based emotion calculation replaces explicit `emotional_strengths` when enabled. The emotional style comes from `emotion_prompt` if supplied, otherwise from `prompt`.
emotion_promptoptional
Typestring | null
Emotional-style instructions that require `should_use_prompt_for_emotion` to be used as well.
enable_safety_checkeroptional
Typeboolean
Defaulttrue
Screening can be relaxed by setting false, provided the caller is authorized.
required Canonical name, also accepted

File parameters take a public https:// URL, a data: URI up to 10 MB, or the file_url of an upload. Files

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "index-tts-2/text-to-speech",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 60,
    "usd": "0.06",
    "charged": 60,
    "refunded": 0
  },
  "input": {
    "audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "prompt": "Hello from Doitong. This is a short test sentence."
  },
  "output": {
    "audio": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_name": "0-output.mp3",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "audio",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_size": 1843200,
      "duration": 12,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
audio
object {url, content_type, file_name, file_size}Generated audio encoded in base64 format.

For AI agents: this page as Markdown is at https://doitong.com/developers/models/index-tts-2/text-to-speech.md. All models and guides: https://doitong.com/developers/llms.txt