Skip to content
OOpenSpeech

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

Errors and limits

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.