DEVELOPER API
One API. Your choice of voice.
Buy credits and create an API key in the studio. API requests spend the same prepaid balance. There is no free generation allowance.
1. Start a recording
curl https://app.openspeech.dev/api/generate \
-H "Authorization: Bearer $OPENSPEECH_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: <a UUID unique to this recording>" \
-d '{"model":"kokoro-82m","text":"Every story starts with a voice."}'Send only a supported model ID and text. Prices and character limits are listed on the pricing page. Credits are reserved atomically before Replicate is called. Reusing the same UUID and input returns the original job without another charge. Reusing it with a different input returns 409.
2. Poll for the result
curl 'https://app.openspeech.dev/api/generate?id=<job-id>' \ -H "Authorization: Bearer $OPENSPEECH_API_KEY"
POST returns 200 or 202 with id, status, and credits. Poll every 3 seconds while status is processing. Succeeded jobs include an audio URL; failed jobs include an error and return their credits. Signed provider webhooks also settle jobs after the browser closes. Model cold starts can take several minutes.
3. Download your audio
curl -OJ 'https://app.openspeech.dev/api/audio?id=<job-id>' \ -H "Authorization: Bearer $OPENSPEECH_API_KEY"
The download endpoint checks workspace ownership and provides the correct WAV or MP3 filename. Download promptly: hosted audio is temporary. Key creation and revocation happen in the studio. Keys expire after 30 days; replacing a key revokes the previous one.
Available model IDs
kokoro-82mKokoro-82M · 2000 characterschatterbox-turboChatterbox Turbo · 1000 charactersorpheus-ttsOrpheus TTS · 300 charactersqwen3-ttsQwen3-TTS · 1000 characterschatterboxChatterbox · 1000 characterschatterbox-multilingualChatterbox Multilingual · 300 characterscsm-1bSesame CSM 1B · 200 charactersparler-ttsParler TTS · 300 charactersphemePheme · 300 charactersinworld-realtime-tts-2Inworld Realtime TTS 2 · 2000 charactersinworld-realtime-tts-1.5-miniInworld TTS 1.5 Mini · 2000 charactersinworld-realtime-tts-1.5-maxInworld TTS 1.5 Max · 2000 charactersminimax-speech-2.8-hdMiniMax Speech 2.8 HD · 2000 charactersminimax-speech-2.8-turboMiniMax Speech 2.8 Turbo · 2000 characterselevenlabs-v3ElevenLabs v3 · 2000 characterselevenlabs-flash-v2.5ElevenLabs Flash v2.5 · 2000 characterselevenlabs-turbo-v2.5ElevenLabs Turbo v2.5 · 2000 characterselevenlabs-v2-multilingualElevenLabs Multilingual v2 · 2000 charactersgemini-3.1-flash-ttsGemini 3.1 Flash TTS · 1000 characters
Errors and limits
- 400: invalid model, text, or request ID.
- 401: missing or expired session/API key.
- 402: insufficient purchased credits. No provider call is made.
- 403: payment review or invalid browser origin.
- 404: recording belongs to another workspace or does not exist.
- 409: another recording is running, or a request ID was reused with different input.
- 429: request rate or daily service capacity exceeded.
- 503: payments or generation paused, or a model temporarily unavailable.
One active recording per workspace. Models have 90–180 second provider deadlines. A failed model is temporarily paused after repeated errors. Keep API keys in server environments, never in public browser code.