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 a supported model ID and text, plus an optional voice ID from the public capability catalog. Omitting voice uses that model’s default. Kokoro supports eight English voices at normal speed; other models use their listed preset. 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.
For example, add "voice":"bf_emma" to select Emma. Optional catalogVersion must match the catalog when creating a new recording; a stale version returns 409 before spending. Unknown controls, including speed or language overrides, are rejected. Saved requests retain their original voice, provider settings and charge when replayed after a catalog change. Requests created before voice selection must be retried in their original model/text shape.
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. New recordings include an expiresAt timestamp and remain privately downloadable for seven days from delivery. Both playback and download URLs require your workspace cookie or API key. Older recordings use temporary provider links. Download a copy to keep it. Key creation and revocation happen in the studio. Keys expire after 30 days. Rotate before expiry: the previous key remains valid for up to 24 hours, bounded by its original expiry. Update your server and revoke the previous key when the change is complete. The studio shows both expiry times; creating a further replacement ends any older rotation window.
Available model IDs
kokoro-82mKokoro-82M · 2000 characterschatterbox-turboChatterbox Turbo · 500 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, or an explicitly supplied catalog version is stale.
- 429: request rate or daily service capacity exceeded.
- 410 from the audio endpoint: the recording’s download window has expired. Creating another recording requires a new paid request.
- 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.