---
title: Deploy Kokoro TTS with AI on Blossom
url: "/deploy/kokoro-tts/"
canonical_url: https://blossom88.com/deploy/kokoro-tts/
markdown_url: https://blossom88.com/deploy/kokoro-tts.md
summary: Generate your first MP3 file with Kokoro's text-to-speech API on Blossom.
categories:
- deployment
- ai
stack:
- Python
- FastAPI
- PyTorch
- Kokoro-82M
---

# Deploy Kokoro TTS with AI on Blossom

[Kokoro FastAPI](https://github.com/remsky/Kokoro-FastAPI) serves the
Kokoro-82M speech model. Use it to turn your own text into audio.

## Ask Your Agent

> **Ask your AI agent:** Deploy Kokoro TTS on Blossom and help me generate my first audio clip with its private API.
>
> Follow this guide: https://blossom88.com/deploy/kokoro-tts/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## How It Runs

| Part | Role | Where |
|---|---|---|
| Kokoro FastAPI | Runs the speech model and returns the generated audio | App Capacity |
| Kokoro-82M | Provides speech generation and preset voices | Bundled in the CPU image |

## Deploy Kokoro TTS

Run the official CPU image on port 8880 as a private Service. It
includes the model and voices. Set an `API_KEYS` runtime secret
and use `/health` for readiness.

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Set `API_KEYS` to a JSON array containing a generated key. Keep it
in runtime configuration. The bundled player in the tested release
doesn't send an API key. Use an API client to try a protected setup.
See the [upstream configuration guide](https://github.com/remsky/Kokoro-FastAPI/blob/master/docs/configuration.md).

</details>

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom app_plan:preview --data kokoro-plan.yml
    blossom service:create --data kokoro-service.yml
    blossom environment:deploy --id environment-100 --follow

</details>

## Generate Your First Clip

Send a sentence to `POST /v1/audio/speech` with a bundled voice,
such as `af_heart`. Use `response_format: mp3` and `stream: false`
to save a complete file. Send your API key as a bearer token.

![Generate an MP3 file from a short sentence.](/deploy/assets/images/kokoro-tts/first-mp3.webp)

> **Ask your AI agent:** Turn a short welcome message into an MP3 file and help me play it back.

> Follow this guide: https://blossom88.com/deploy/kokoro-tts/



## Generate More Audio After a Deploy

Keep the same runtime key when you replace the Container. Send
another sentence using the same client. Store audio files wherever
your app needs them.

![Generate a different clip after Container replacement.](/deploy/assets/images/kokoro-tts/mp3-after-replacement.webp)

## What You Get

- A private text-to-speech API on CPU
- An MP3 file from a short paragraph or sentence
- The same API key after a Container update

Tested on Blossom: The CPU image generated valid MP3 files before and after Container replacement using the same private API key.
