# sandbase-ai Index TTS 2.0 API

> Index TTS 2.0 from bilibili's IndexTeam speaks text in the voice of a reference recording (zero-shot cloning) and controls emotion separately through a second reference clip, per-emotion strengths, or a text description.

Source: https://www.sandbase.ai/models/sandbase-ai/index-tts-2
API reference: https://www.sandbase.ai/models/sandbase-ai/index-tts-2#api

## Facts

- Provider: sandbase-ai
- Type: Audio model
- Model ID: `sandbase-ai/index-tts-2`
- Price: From $0.02 per run
- Capabilities: text to speech
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "sandbase-ai/index-tts-2",
  "text": "Hide! He'"'"'s coming! He'"'"'s coming to get us!",
  "audio": "https://storage.googleapis.com/falserverless/example_inputs/index-tts-2/tts_in.mp3",
  "strength": 1,
  "emotion_prompt": "You scared me to death! What are you, a ghost?",
  "should_use_prompt_for_emotion": false
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call sandbase-ai Index TTS 2.0 through SandBase?

Create a SandBase API key, then send requests with the model ID "sandbase-ai/index-tts-2" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate sandbase-ai account?

No. One SandBase API key and balance gives you access to sandbase-ai Index TTS 2.0 and the other models in the catalog; you do not need to sign up with sandbase-ai separately.

## README

### Index TTS 2.0

Index TTS 2.0 clones the voice in a reference clip and speaks new text with it. Emotion is controlled separately: from a second reference clip, eight per-emotion strengths, or the emotion inferred from text.

#### Fields

| Field | Type | Default | Notes |
|---|---|---|---|
| `text` | string, required | — | Text to speak. |
| `audio` | audio file or URL, required | — | Voice to clone. |
| `emotional_audio` | audio file or URL | — | Clip whose emotional style is transferred. |
| `strength` | number 0–1 | 1 | Strength of the emotional style transfer. |
| `emotional_strengths` | object of numbers 0–1 | — | `happy`, `angry`, `sad`, `afraid`, `disgusted`, `melancholic`, `surprised`, `calm`. |
| `should_use_prompt_for_emotion` | boolean | false | Infer emotion from the text or `emotion_prompt`; overrides `emotional_strengths`. |
| `emotion_prompt` | string | — | Text describing the emotion; used when `should_use_prompt_for_emotion` is true. |

#### Billing

$0.002 per second of generated audio. The quote before submission assumes 10 seconds; the final charge uses the measured output length.

| Output | Price |
|---|---|
| 10 seconds | $0.02 |
| 30 seconds | $0.06 |
| 1 minute | $0.12 |

Failed runs are not charged.

#### Prompting

- Use a clean 5–15 second reference clip of a single speaker.
- Pick one emotion control: a reference clip, `emotional_strengths`, or `should_use_prompt_for_emotion`.
