[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [Index TTS 2.0](https://spiral.ai/integrations/opencode/index-tts-2-0)

# How to Use Index TTS 2.0 in opencode

Index TTS 2.0 turns scripts into expressive speech with separate control over voice identity and emotion. Use it for character dialogue and narration when the same voice needs different deliveries.

|  |  |
| --- | --- |
| Model | Index TTS 2.0 |
| Available through | fal |
| Category | Audio |
| Price | Up to $0.156 per run at the default inputs for 60 seconds of input. |
| Returns | audio |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Index TTS 2.0 in opencode

- Use Index TTS 2.0 to narrate the project's onboarding script with the provided voice reference and a calm delivery.
- Use Index TTS 2.0 to generate calm, angry, and sad takes of the first game dialogue line, keeping its voice reference fixed.
- Use Index TTS 2.0 for the tutorial script, taking voice identity from the narrator recording and emotion from the performance reference.
- Use Index TTS 2.0 to read the project's Chinese lesson examples. Keep each example separate for pronunciation review.
- Use Index TTS 2.0 to narrate the demo script, then measure the audio duration before placing it on the video timeline.

## How to set up Index TTS 2.0 in opencode

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Index TTS 2.0**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "fal",
    "model": "fal-ai/index-tts-2/text-to-speech",
    "input": {
      "audio_url": "https://storage.googleapis.com/falserverless/example_inputs/index-tts-2/tts_in.mp3",
      "prompt": "Hide! He'\''s coming! He'\''s coming to get us!"
    }
  }'
```

Then paste one of the prompts above: opencode finds Index TTS 2.0 on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## Index TTS 2.0 tools and prices

- [Index TTS 2.0](https://spiral.ai/tools/fal/fal-ai/index-tts-2/text-to-speech) (fal): $0.0026 per second.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| emotional_audio_url |  | — | The emotional reference audio file to extract the style from. |
| strength | 0 to 1 | 1 | The strength of the emotional style transfer. Higher values result in stronger emotional influence. |
| emotional_strengths |  | — | The strengths of individual emotions for fine-grained control. |
| should_use_prompt_for_emotion |  | false | Whether to use the `prompt` to calculate emotional strengths, if enabled it will overwrite the `emotional_strengths` values. If `emotion_prompt` is provided, it will be used to instead of `prompt` to extract the emotional style. |
| emotion_prompt |  | — | The emotional prompt to influence the emotional style. Must be used together with should_use_prompt_for_emotion. |

## What can you do with Index TTS 2.0 in opencode?

Create spoken dialogue and narration from scripts in your project with Index TTS 2.0. Your coding agent can prepare separate takes for each emotional direction and keep them organized for review.

### Character dialogue

Give one character calm, angry, and sad readings while keeping the same voice reference.

### Explainer narration

Turn an English explainer script into a calm spoken guide using a chosen voice reference.

### Chinese lesson narration

Create spoken Chinese examples for lessons, then review pronunciation before publishing.

### Dialogue rehearsal

Compare several emotional readings of a line before directing a recording session.

### Performance-guided voiceovers

Use one recording for voice identity and another speaker's performance for emotional direction.

### Recurring audio briefings

Read each day's prepared summary with the same voice reference and a calm delivery direction.

## Overview

- [fal](https://spiral.ai/providers/fal)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## Index TTS 2.0 in other agents

- [Amp](https://spiral.ai/integrations/amp/index-tts-2-0)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/index-tts-2-0)
- [Claude](https://spiral.ai/integrations/claude-desktop/index-tts-2-0)
- [Claude Code](https://spiral.ai/integrations/claude-code/index-tts-2-0)
- [Cline](https://spiral.ai/integrations/cline/index-tts-2-0)
- [Codex](https://spiral.ai/integrations/codex/index-tts-2-0)
- [Cursor](https://spiral.ai/integrations/cursor/index-tts-2-0)
- [Devin](https://spiral.ai/integrations/devin/index-tts-2-0)
- [dots](https://spiral.ai/integrations/dots/index-tts-2-0)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/index-tts-2-0)
- [Gemini](https://spiral.ai/integrations/gemini/index-tts-2-0)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/index-tts-2-0)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/index-tts-2-0)
- [goose](https://spiral.ai/integrations/goose/index-tts-2-0)
- [Grok](https://spiral.ai/integrations/grok/index-tts-2-0)
- [Grok Build](https://spiral.ai/integrations/grok-build/index-tts-2-0)
- [Hermes](https://spiral.ai/integrations/hermes/index-tts-2-0)
- [Instinct](https://spiral.ai/integrations/instinct/index-tts-2-0)
- [Manus](https://spiral.ai/integrations/manus/index-tts-2-0)
- [Muse](https://spiral.ai/integrations/muse/index-tts-2-0)
- [Muse Code](https://spiral.ai/integrations/muse-code/index-tts-2-0)
- [n8n](https://spiral.ai/integrations/n8n/index-tts-2-0)
- [Notion](https://spiral.ai/integrations/notion/index-tts-2-0)
- [OpenClaw](https://spiral.ai/integrations/openclaw/index-tts-2-0)
- [Perplexity](https://spiral.ai/integrations/perplexity/index-tts-2-0)
- [Raycast](https://spiral.ai/integrations/raycast/index-tts-2-0)
- [VS Code](https://spiral.ai/integrations/vscode/index-tts-2-0)
- [Windsurf](https://spiral.ai/integrations/windsurf/index-tts-2-0)
- [Zapier](https://spiral.ai/integrations/zapier/index-tts-2-0)

## More opencode guides

- [HeyGen Voice Turbo](https://spiral.ai/integrations/opencode/heygen-voice-turbo)
- [Insanely Fast Whisper with video](https://spiral.ai/integrations/opencode/insanely-fast-whisper-with-video)
- [HeyGen Voice](https://spiral.ai/integrations/opencode/heygen-voice)
- [Inworld TTS-1.5 Max](https://spiral.ai/integrations/opencode/inworld-tts-1-5-max)
- [Grok Voice](https://spiral.ai/integrations/opencode/grok-voice)
- [Kling Create Voice](https://spiral.ai/integrations/opencode/kling-create-voice)

## Questions about Index TTS 2.0 in opencode

**Can opencode use Index TTS 2.0?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Index TTS 2.0 like any built-in tool.

**How much does Index TTS 2.0 cost in opencode?**

Up to $0.156 per run at the default inputs for 60 seconds of input. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

**Do I need a fal account to use Index TTS 2.0 in opencode?**

No. Spiral runs Index TTS 2.0 on its own fal account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Index TTS 2.0 in opencode?**

About two minutes: add the server, then sign in, then check it.

**Does opencode wait while Index TTS 2.0 runs?**

Index TTS 2.0 runs in the background. opencode starts the run, checks on it and gives you the audio when it's ready.

**What is Index TTS 2.0 useful for?**

Use it for narration or character lines that need a recognizable voice with different emotional deliveries. You can guide emotion with a separate performance reference or a written description.

**Can the voice and emotion references come from different people?**

Yes. Index TTS 2.0 separates voice identity from emotional expression, so a second speaker's performance can guide the delivery.

**How should I describe the emotion?**

Give a specific delivery direction, such as calm reassurance or sadness after a disappointment. Keep that direction separate from the words you want spoken.

**Which languages should I use?**

Chinese and English are the documented languages in the training description. The Index TTS 2.0 paper reports training data in both.

**Can I request an exact clip length?**

Do not rely on an exact duration. Although the research demonstrates duration control, the maker's release notes say that capability was not enabled in the IndexTTS-2 public release.

