Service unavailable
service_unavailable
VoiceLabs cannot serve the request right now and knows it. This is reported instead of a guess: when the credential store cannot be read, the honest answer is “we cannot tell yet”, not “your key is bad” — which would send you rotating a key that was fine.
Why it happens
A dependency was briefly unreachable — the credential store, the idempotency ledger, or the generation service while it restarts (a deploy or a health restart takes it away for up to about half a minute, and the API has already retried it for you before answering this). When an idempotent write cannot be recorded, the request is refused rather than executed without the guarantee you asked for, so a retry can never double-charge. The connection to the generation service can also be cut AFTER a request was sent (POST /v1/speech, POST /v1/transcriptions, POST /v1/audio/speech, POST /v1/voices/clone, POST /v1/voices/default); the API retries that once where a retry is safe, and answers this code when the retry did not recover it. That request MAY have run: the detail says so and says whether a resend is recognised.
How to fix it
Honour Retry-After (a few seconds, or 30 when the generation service is restarting) and send the same request again. Unless the detail says the connection was cut after the request was sent, nothing was executed and there is nothing to reconcile. After such a cut, resend with the SAME Idempotency-Key on POST /v1/speech and POST /v1/transcriptions: a generation service that recognises the key answers with the generation or the capture the first attempt made, if it made one.
Safe to retry?
Yes. Safe to send as-is when nothing was executed. After a cut connection, resend with the same Idempotency-Key only on POST /v1/speech and POST /v1/transcriptions (a generation service that recognises it does not generate or transcribe twice); POST /v1/audio/speech cannot recognise a resend and starts a new take, billed again, and POST /v1/voices/clone and POST /v1/voices/default should be checked with GET /v1/voices before sending them again.
What it looks like on the wire
{
"type": "https://voicelabs.now/errors/service_unavailable",
"title": "Service unavailable",
"status": 503,
"detail": "A human-readable explanation of this particular occurrence.",
"instance": "/v1/speech",
"code": "service_unavailable"
}
Branch on code, never on status or on the prose in detail: two different problems can share a status, and detail is written for humans and may be reworded. Problems a settings page can resolve also carry settings_url, and a scope failure carries required_scope.
Every VoiceLabs API error is an RFC 9457 problem document with a stable code.