Upstream contribution · #676
Zero-shot voice cloning on /v1/audio/speech
Accepts base64 only, never a URL. That is a security tradeoff; the reason is in the notes.
Voice cloning needs a reference clip. An earlier implementation took a URL and had the server fetch it; in review I flagged that as SSRF — the server would issue requests to any address given to it, including cloud metadata endpoints and internal hosts.
So this version accepts base64 audio inline, with a size cap. The cost is that callers must read the file themselves and requests get larger. What it buys is that one request field cannot turn the server into a proxy into the private network.
Requiring the reference text is the same kind of decision: omitting it does not raise an error, it just produces noticeably worse audio — and a bad result that does not raise is harder to diagnose than one that does.