Deploy deepseek-voice-api
Hosted TTS + 21-language ASR API on DeepSeek - two endpoints, no GPU
deepseek-voice-api
Just deployed
DeepSeek Voice API — hosted TTS + 21-language ASR
Two HTTP endpoints over DeepSeek's voice tools:
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.
What you get
- Text-to-speech:
POST /tts {text, voice, format}→ streamedaudio/wav(24 kHz 16-bit mono) or raw PCM, withX-Billed-Charssurfacing exactly what the request bills (Chinese characters count as 2) - Speech-to-text in 21 languages:
POST /asr(multipartfile) →{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 becomes429withRetry-After, and even HTTP 200 responses are body-inspected so a JSON error object never masquerades as audio GET /voicesreference and aGET /healthendpoint that is healthy with or without a key configured (401 missing_api_keyon voice endpoints untilDEEPSEEK_API_KEYis set)
Quick start after deploy
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 is English-only and footprint-first (~17 MB), and 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
(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_KEYdeploy-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
Template Content
deepseek-voice-api
lNamelessl/deepseek-voice-apiDEEPSEEK_API_KEY

