request_id. Include it when you contact
support — it is what lets us find your call in our logs.
Retry only what retrying fixes
400 and 401 are deterministic — the same request will fail identically forever. Read the message instead of looping. 502 and 5xx are worth retrying, with backoff.A 403 that is not from us
Check the status before you write the body
On any error the body is JSON, not audio — andcurl --output, wget -O or
a naive open(f,"wb").write(r.content) will happily write that JSON into your
.pcm file. Converting it yields a silent 0-second clip, so a 400 shows up as
“the audio came back empty” and sends you debugging the wrong thing.