---
title: "Deploy deepseek-voice-api"
description: "Hosted TTS + 21-language ASR API on DeepSeek - two endpoints, no GPU"
category: "AI/ML"
url: https://railway.com/deploy/deepseek-voice-api
---

# Deploy deepseek-voice-api

Hosted TTS + 21-language ASR API on DeepSeek - two endpoints, no GPU

**[Deploy deepseek-voice-api on Railway](https://railway.com/template/deepseek-voice-api)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deepseek-voice-api/manifest.json

- **Creator:** Nameless 's Projects
- **Category:** AI/ML

## Template content

### deepseek-voice-api

- **Source:** https://github.com/lNamelessl/deepseek-voice-api
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# DeepSeek Voice API — hosted TTS + 21-language ASR

Two HTTP endpoints over [DeepSeek's voice tools](https://api-docs.deepseek.com/guides/tts):
`POST /tts` turns text into streamed audio (voices stella and tide, wav or pcm, language
auto-detected) and `POST /asr` turns a WAV or Ogg Opus clip into a transcript in any of
21 languages. The service is a stateless FastAPI pass-through — no GPU, no model downloads,
no volumes — running as one small container while audio work happens in DeepSeek's cloud
and bills directly to your DeepSeek account.

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/deepseek-voice-api)

## What you get

- **Text-to-speech**: `POST /tts {text, voice, format}` → streamed `audio/wav` (24 kHz
  16-bit mono) or raw PCM, with `X-Billed-Chars` surfacing exactly what the request bills
  (Chinese characters count as 2)
- **Speech-to-text in 21 languages**: `POST /asr` (multipart `file`) →
  `{request_id, text, duration_ms}` — language is auto-detected, no language parameter
- **Enforced upstream limits, caught before you pay**: 10k billed chars and 64 KiB body for
  TTS; 8 MiB and 120 s for ASR — oversize or malformed uploads fail locally with clear
  JSON errors instead of a round-trip
- **Honest error mapping**: upstream content-review rejections become `422`,
  the 50-concurrent limit becomes `429` with `Retry-After`, and even HTTP 200 responses
  are body-inspected so a JSON error object never masquerades as audio
- `GET /voices` reference and a `GET /health` endpoint that is healthy with or without a
  key configured (`401 missing_api_key` on voice endpoints until `DEEPSEEK_API_KEY` is set)

## Quick start after deploy

```bash
curl -X POST https://your-service.up.railway.app/tts \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from DeepSeek", "voice": "stella"}' --output hello.wav

curl -X POST https://your-service.up.railway.app/asr -F file=@hello.wav
```

## Configuration (one required variable)

| Variable | Required | Meaning |
|---|---|---|
| `DEEPSEEK_API_KEY` | yes | your DeepSeek API key — TTS $0.45/10k chars, ASR $0.116/audio-hr, billed to your account |

Costs (standard rates; limited-time 50% promo: TTS $0.225/10k chars, ASR $0.058/audio-hr —
time-limited, budget on the standard column): a 20-char TTS call ≈ $0.0009, one minute of
ASR ≈ $0.0019.

## Honest disclosures

- Audio and transcripts are processed in **DeepSeek's cloud** and billed per use to your
  DeepSeek account — this is a hosted-quality tier, not an on-device model.
- TTS offers exactly two voices (`stella`, `tide`), no speed control, and cannot resume
  interrupted synthesis; requests cap at 10,000 billed characters / 30 minutes of audio.
- ASR recognizes only 16-bit PCM WAV or Ogg Opus, 8–48 kHz, ≤8 MiB and ≤120 s (stereo
  files: only the left channel is recognized).
- Self-hosted alternatives on our profile cover the opposite niche:
  [Whistle STT API](https://railway.com/deploy/whistle-stt-api) is English-only and
  footprint-first (~17 MB), and [Paradee TTS API](https://railway.com/deploy/paradee-tts-api)
  is an 8.5 MB local model — use those for privacy and zero marginal cost, this one for
  multilingual coverage and quality.
- DeepSeek's WebSocket streaming TTS variant exists upstream but is intentionally not
  surfaced in this v1 HTTP wrapper.

# Deploy and Host

## About Hosting

Deploying this template provisions exactly one Railway service: a Docker container built
from the [public repo](https://github.com/lNamelessl/deepseek-voice-api)
(`python:3.12-slim` + pinned `fastapi`/`uvicorn`/`httpx`/`python-multipart`, non-root
user). Railway assigns a public domain automatically and health-checks `/health` (restart
on failure, up to 10 retries). The template ships exactly one required deploy-form
variable, `DEEPSEEK_API_KEY`; there are no databases, volumes, or other variables, and no
persistent state — a restart loses nothing. The container itself is tiny (pure-Python
dependencies only) and stays cheap because synthesis and recognition run upstream at
DeepSeek, not in your container.

## Why Deploy

DeepSeek's voice tools are plain HTTP APIs, but using them well means enforcing their size
and duration caps before an upload (so you never pay for a doomed request), streaming
audio responses without buffering 30-minute sessions, mapping content-review rejections
and concurrency errors to clean JSON shapes, watching for HTTP 200 responses that carry a
body-level error instead of audio, and probing WAV/Ogg headers for duration without an
ffmpeg dependency. This template does all of that and verifies it live: a real TTS call
returns a valid RIFF file, stella and tide produce different audio for the same text, a
clip generated by the TTS endpoint transcribes back correctly through ASR, Chinese text
surfaces 2x billing, oversize and malformed uploads fail with the documented shapes, and
a restart proves the service is fully stateless.

## Common Use Cases

- Adding voice output to apps in any of the auto-detected languages (Mandarin, Cantonese,
  English, Japanese, Korean, Arabic, Thai, Vietnamese and more) without hosting TTS models
- Transcribing multilingual voice notes, support calls, or voice commands (21 languages,
  auto-detected) into text for downstream processing
- Building voice agents that need both directions — speak a reply with stella or tide,
  then understand the user's answer — behind one small stateless service
- Prototypes and demos where paying DeepSeek per use beats reserving GPU capacity or
  downloading multi-GB models

## Dependencies for

The template needs exactly one external credential and nothing else at runtime.

### Deployment Dependencies

- A **DeepSeek API key** — create one at platform.deepseek.com and paste it into the
  `DEEPSEEK_API_KEY` deploy-form variable (the template is pre-filled to prompt for it);
  TTS and ASR usage bills directly to your DeepSeek account
- A Railway account (Hobby plan or trial works — the container is a small pure-Python service)
- That is all: no volumes, no databases, no other services, no model downloads

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/deepseek-voice-api
