# CosyVoice3-API

CosyVoice3-API is a self-hosted ai app. OpenAI-compatible text-to-speech (TTS) API that wraps Alibaba FunAudioLLM's CosyVoice 3 to provide a self-hosted, NVIDIA-GPU TTS service with zero-shot voice cloning, voice registration, streaming, 9 languages, and 18... It is open source and self-hosted, installable on Unraid.

Canonical page: https://ourlocalhost.com/app/2735/cosyvoice3-api

## Description

OpenAI-compatible text-to-speech (TTS) API that wraps Alibaba FunAudioLLM's CosyVoice 3 to provide a self-hosted, NVIDIA-GPU TTS service with zero-shot voice cloning, voice registration, streaming, 9 languages, and 18 Chinese dialects for homelab users integrating OpenAI-compatible clients.

## Platform availability

Available on 1 of 10 platforms: Unraid.

## Health score

34/100 (Low), based on 4 of 4 factors.
- Maintained: 59 (last commit 164 days ago)
- Popular: 6 (1 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)
- Light to run: 10 (16 GB minimum RAM)

## Links

- Unraid: https://ca.unraid.net/apps/cosyvoice3-api-14qbg1t0agu57p?q=CosyVoice3-API
- GitHub: https://github.com/hsiang-han/CosyVoice3-API
- Official website: https://hf-mirror.com

## Common questions

### How do I create and keep a reusable voice in CosyVoice3-API?

Register a 3-second reference audio with its prompt text using the voice registration endpoint. Registered voices persist across container restarts.

### What does streaming output from the speech endpoint contain?

Setting stream to true returns raw PCM audio. The audio is 16-bit, mono, 24000 Hz, and the headers include sample rate, channel, and bit-depth metadata.

### How should I handle the initial model download for the Docker container?

Bind a persistent host directory to /root/.cache/models in the Docker run command. The first start downloads about 10 GB of model files, and China users can set HF_ENDPOINT to the Hugging Face mirror for faster downloads.

### Which port does the Docker example expose for API requests?

The quick-start command exposes port 8080. Use that port to reach the API endpoints.

---
Source: Our Local Host (https://ourlocalhost.com/app/2735/cosyvoice3-api), the self-hosted and open-source app directory.
