KeyoAPI

IndexTTS-2 API — Text to Speech and Voice Cloning

IndexTTS-2 synthesizes text using a required reference audio URL. Choose text or audio emotion mode and keep its fields together.

IndexTTS-2 is a speech / audio model on KeyoAPI, a prepaid AI API gateway: call it at POST /v1/audio/speech, billed at $1.37 / 10K characters from the same balance that covers chat, vision, OCR and video models.

Listed price: $1.37 / 10K characters · Live catalog: Model Square · Static list: pricing list.

Get API key Open Model Square Compare API prices

Overview

IndexTTS-2 synthesizes text using a reference audio file. A text string and a model name alone are not a complete request. The synchronous endpoint is POST /v1/audio/speech with model=IndexTTS-2, input and a required prompt_audio_url. This model shares the account key and wallet with chat, but its reference and emotion fields are specific to speech.

Replace https://replace-me.invalid/your-reference.wav in the example with a real audio URL the server can download directly without signing in. A local file path or base64 prompt_audio does not replace that URL field. Optional prompt_text must match the exact words in the reference file. Do not use voice=alloy or an unrelated service’s speaker ID as a substitute for reference audio.

The example uses text emotion mode: use_emo_text is true, and optional emo_text can describe the intended delivery. Audio emotion mode is a separate branch requiring emo_audio_prompt_url, with emo_alpha between zero and one. Choose the appropriate mode instead of combining examples blindly. These controls guide synthesis; they do not guarantee a particular gender, emotion, accent or voice quality.

A successful synchronous response contains audio bytes. Check the HTTP status and Content-Type before naming the file. Do not save a JSON error as an audio file or assume an unknown format is MP3 because of the filename. A request timeout does not prove that no processing occurred; keep the request identifier and error details instead of submitting repeated replacements automatically.

For asynchronous IndexTTS-2, POST /v1/async/audio/speech with a string inputs instead of input, preserving the reference and emotion-mode fields. Save id or task_id, then poll the singular GET /v1/task/{id} with the same API key. On completed, inspect the actual output and use url or output.file_url only when present. Process batch results item by item; if the output shape is unexpected, keep the complete response for support instead of automatically submitting again. Stop on failed or cancelled. Retry a temporary task_query_unavailable GET according to Retry-After without creating another task.

Read the API endpoint reference for synchronous fields and the API endpoint reference for asynchronous examples. Compare current model rates on the pricing page before integrating. The reference-based request does not define an enrollment system or reusable voice-ID lifecycle; confirm those separate workflows before building them.

How to call it

Base URL: https://www.keyoapi.xyz/v1

Endpoint: POST /v1/audio/speech

Model: model=IndexTTS-2

# Replace the URL with your own downloadable reference audio.
curl https://www.keyoapi.xyz/v1/audio/speech \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"IndexTTS-2","input":"Hello from KeyoAPI TTS.","prompt_audio_url":"https://replace-me.invalid/your-reference.wav","use_emo_text":true}' \
  --output speech.audio
# Use the response Content-Type to choose the audio extension.

Auth uses the same Bearer API key as chat. Full notes: Keyo docs.

FAQ

Is there a hosted IndexTTS-2 API?

Yes. POST /v1/audio/speech with model=IndexTTS-2, input and required prompt_audio_url. Text alone is incomplete; follow the model-specific reference and emotion-mode fields.

Sync or async?

Sync: /v1/audio/speech returns audio bytes. Async: /v1/async/audio/speech uses inputs instead of input with the same reference fields, then GET /v1/task/{id}.

How do I try it?

Create a key at the sign-up page, then open the full pricing list for interactive try/buy. Gift-credit LLM IDs (separate from TTS; billed from your $10 welcome credit, fair-use) are listed at the gift-credit models page.

Price?

About $1.37 per 10,000 characters — confirm live rates on the full pricing list.

Related models

CosyVoice3 API Qwen3-TTS API Whisper Large V3 API InfiniteTalk API

Guide for IndexTTS-2. Catalog: the pricing page · Rates: the full pricing list.