[Integrations](https://spiral.ai/integrations) › [VS Code](https://spiral.ai/integrations/vscode) › [F5-TTS](https://spiral.ai/integrations/vscode/f5-tts)

# How to Use F5-TTS in VS Code

F5-TTS turns written scripts into speech guided by a reference voice. Use it for English or Chinese narration, including scripts that switch between the two languages.

|  |  |
| --- | --- |
| Model | F5-TTS |
| Available through | fal |
| Category | Audio |
| Price | Each item in `gen_text` adds $0.065. |
| Returns | audio |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with F5-TTS in VS Code

- Read the onboarding guide in this project and write three short narration passages. Generate each with F5-TTS using my reference recording, keeping each passage around 10 seconds.
- Use F5-TTS to create spoken drafts of the game's first five dialogue lines. Use the supplied character reference recordings and generate each line separately.
- Turn the latest release notes in this repository into a two-sentence spoken announcement with F5-TTS. Use my reference recording and keep the script around 10 seconds.
- Create English and Chinese readings of the project's welcome message with F5-TTS. Use my reference recording, keep each reading short, and save them as separate audio assets.
- Use F5-TTS to audition two readings of the tutorial introduction: one with a comma before the final phrase and one with a period. Keep the words and reference recording identical.

## How to set up F5-TTS in VS Code

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

### Use Spiral's MCP server

1. **Add the hosted server**: Use Add to VS Code on the console's Agents & MCP page, or run:

```bash
code --add-mcp '{"name":"spiral","type":"http","url":"https://api.spiral.ai/mcp"}'
```

2. **Sign in**: VS Code asks you to sign in when it first starts the server: sign in to Spiral and click Authorize. No API key. Run MCP: List Servers from the Command Palette to check that Spiral is running.

### Use the Spiral skill

1. **Send VS Code 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 F5-TTS**: 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/f5-tts",
    "input": {
      "gen_text": "I don'\''t really care what you call me. I'\''ve been a silent spectator, watching species evolve, empires rise and fall. But always remember, I am mighty and…",
      "ref_audio_url": "https://storage.googleapis.com/falserverless/example_inputs/reference_audio.wav",
      "model_type": "F5-TTS"
    }
  }'
```

Then paste one of the prompts above: VS Code finds F5-TTS on Spiral, shows the price and runs it.

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

## F5-TTS tools and prices

- [F5 TTS](https://spiral.ai/tools/fal/fal-ai/f5-tts) (fal): $0.065 per 1,000 characters of `gen_text`. Rounded up to the next 1,000 characters.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| ref_text |  |  | The reference text to be used for TTS. If not provided, an ASR (Automatic Speech Recognition) model will be used to generate the reference text. |
| remove_silence |  | true | Whether to remove the silence from the audio file. |

## What can you do with F5-TTS in VS Code?

Add spoken tutorials, demo narration, and dialogue drafts to your project with F5-TTS. A coding agent can turn project text into short spoken passages and reuse a reference recording across them.

### Tutorial narration

Turn short tutorial scripts into spoken instructions with F5-TTS, using the same reference voice for each passage.

### English and Chinese lesson audio

Create separate spoken examples in English and Chinese with F5-TTS. Include mixed-language examples when a lesson needs both languages in one passage.

### Daily spoken briefings

Read a short daily summary with F5-TTS in a recurring reference voice. Divide longer summaries into separate passages.

### Game dialogue drafts

Audition short character lines with F5-TTS using reference recordings chosen for each character's voice and emotional delivery.

### Narration revisions

Generate revised sentences with F5-TTS using the original reference voice, then review them alongside the surrounding narration.

### Spoken product announcements

Create short announcement readings with F5-TTS. Use punctuation to test where the speaker pauses between the news and the next action.

### Story readings

Prepare short story passages for F5-TTS and select reference speech that matches the intended mood. Review each passage before assembling a longer reading.

## Overview

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

## F5-TTS in other agents

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

## More VS Code guides

- [Elevenlabs Tts Eleven V3](https://spiral.ai/integrations/vscode/elevenlabs-tts-eleven-v3)
- [GPT-4o mini TTS](https://spiral.ai/integrations/vscode/gpt-4o-mini-tts)
- [Elevenlabs Music v2.5](https://spiral.ai/integrations/vscode/elevenlabs-music-v2-5)
- [GPT-4o mini Transcribe](https://spiral.ai/integrations/vscode/gpt-4o-mini-transcribe)
- [ElevenLabs v4 Turbo Text to Speech](https://spiral.ai/integrations/vscode/elevenlabs-v4-turbo-text-to-speech)
- [Gemini 2.5 Flash TTS](https://spiral.ai/integrations/vscode/gemini-2-5-flash-tts)

## Questions about F5-TTS in VS Code

**Can VS Code use F5-TTS?**

Yes. Add Spiral to VS Code as an MCP server, and VS Code can find and run F5-TTS like any built-in tool.

**How much does F5-TTS cost in VS Code?**

Each item in `gen_text` adds $0.065. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your VS Code plan is separate.

**Do I need a fal account to use F5-TTS in VS Code?**

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

**How long does it take to set up F5-TTS in VS Code?**

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

**Does VS Code wait while F5-TTS runs?**

F5-TTS runs in the background. VS Code starts the run, checks on it and gives you the audio when it's ready.

**What is F5-TTS useful for?**

F5-TTS suits spoken scripts that should follow a reference voice, such as tutorial narration, lesson audio, and short announcements. The reference guides the speaker characteristics; your script supplies the words.

**Which languages does F5-TTS support?**

The official checkpoints support English and Chinese. The maker also demonstrates switching between those languages within speech.

**How long should the reference recording be?**

The maker recommends a reference clip shorter than 12 seconds. Choose a short excerpt that represents the voice you want to hear.

**Can F5-TTS narrate a long script?**

Plan longer narration as separate passages. The official inference documentation gives a 30-second limit for one generation, including reference audio, so that is not a full 30 seconds of new speech.

**How do I add pauses to F5-TTS speech?**

Use punctuation and spaces in the spoken script to mark pauses. Start with short sentences, then listen to the result before adjusting the punctuation.

