# GPT-4o mini TTS

Generate speech, music and audio with GPT-4o mini TTS from OpenAI through one Spiral API key. Turns up to 4,096 characters of text into speech in a built-in voice, with written instructions to steer its tone and style. It runs in the background and returns audio. Pay as you go, with no subscription.

- Provider: OpenAI
- Category: Audio
- Runs: In the background
- Returns: audio
- Released: 2025-03-20
- Deprecated, retires 2027-01-06
- Tool id: `openai` / `gpt-4o-mini-tts`
- Page: https://spiral.ai/tools/openai/gpt-4o-mini-tts

## Pricing

Input text: $0.78 per 1M tokens. Output speech: $15.60 per 1M audio tokens.

## Limits

- Longest queue wait: 1 hour
- Run deadline: 30 minutes
- Longest run, end to end: 255 minutes
- Largest inline input: 1 MB
- Largest input file: 2 GB
- Largest output: 5 GB

## Input

| Field | Kind | Allowed | Default | Description |
| --- | --- | --- | --- | --- |
| `input` (required) | text |  | — | The text to generate audio for. The maximum length is 4096 characters. |
| `voice` (required) | JSON |  | — | The voice to use when generating the audio. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the voices are available in the [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options). Custom voices must be created from audio samples. Voices created from text prompts are supported only in Live. |
| `speed` | number | 0.25 to 4 | 1 | The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. |
| `instructions` | text |  | — | Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. |
| `response_format` | one of | mp3, opus, aac, flac, wav, pcm | mp3 | The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. |

## Example

```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": "openai",
    "model": "gpt-4o-mini-tts",
    "input": {
      "input": "<input>",
      "voice": "ash"
    }
  }'
```

Try it in the Playground: https://spiral.ai/start?provider=openai&model=gpt-4o-mini-tts

## Common questions

### GPT-4o mini TTS

**How much does GPT-4o mini TTS cost?**

Input text: $0.78 per 1M tokens. Output speech: $15.60 per 1M audio tokens. You pay as you go from one Spiral balance, with no subscription, and a failed run is not charged.

**How do I use GPT-4o mini TTS through an API?**

Send `POST /v1/runs` with `"provider": "openai"`, `"model": "gpt-4o-mini-tts"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.

**Do I need an account with OpenAI to use GPT-4o mini TTS?**

No. Spiral runs it on its own OpenAI account and charges your Spiral balance.

**Can my AI agent use GPT-4o mini TTS?**

Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.

