Voices/Clone voice
Clone voice
POST/api/v1/voice
Clone a voice from a clean audio sample (AVI/MP3/MP4/M4A/WAV, up to 30MB) and get a reusable voice_id. Cloning runs synchronously and can take a while, so set a generous request timeout. The number of active cloned voices allowed depends on your plan.
Headers
X-API-KeystringRequired
Your VisionStory API key (
sk-vs-...), kept server-side. Create one at OpenApi (Pro plan and up).Request body
audio_urlstring | nullOptional
Publicly reachable URL of a clean voice sample. Provide either this or
inline_data. Formats: AVI/MP3/MP4/M4A/WAV, up to 30MB.inline_dataInlineDataModel | nullOptional
Voice sample as inline base64 data. Provide either this or
audio_url.preview_textstring | nullOptional
Text spoken in the generated preview clip for the cloned voice. Defaults to a built-in phrase. Max 100 characters.
Response
200Successful Response
Successful calls return a standard envelope: the endpoint payload under data (its fields are documented below), plus a message string ("success") and an ISO 8601 server_time.
Response fields (
data)voice_idstringRequired
Unique identifier of the cloned voice. Pass it as
voice_id in a text script to speak with this voice.localestringOptionalDefault
""BCP 47 locale detected for the clone (e.g.
en-US), same vocabulary as the locale field of GET /api/v1/voices and the locale parameter of POST /api/v1/tts; empty if detection was unavailable.languagestringOptionalDefault
""Primary language detected from the audio sample, e.g.
english; empty if detection is still pending.genderstringOptionalDefault
""Voice gender detected from the audio sample; empty if detection is still pending.
preview_audio_urlstringOptionalDefault
""URL of a short sample clip synthesized with the cloned voice; empty if not ready yet.
Errors
All error responses share one JSON envelope: an error object with a numeric code, a human-readable message, an optional details string, and an optional hint giving an actionable next step (handy for AI agents).
errorErrorDetailRequired
Error payload returned with every non-2xx response. Present only on failure; successful calls use the standard success envelope instead.