Voice Clone API documentation
Clone a voice from a sample and synthesize given text in that voice.
Endpoints
| Contract item | Value |
|---|---|
| Capability | voice-clone |
| Submit | POST https://vidmage.ai/api/v1/voice-clone/submit |
| Query | POST https://vidmage.ai/api/v1/voice-clone/query |
| Task identifier | taskId |
| Result field | audioUrl |
Authenticate with Authorization: Bearer YOUR_API_KEY. Save the task identifier and query the same capability. Use a stable Idempotency-Key for submission retries.
Product guide: AI Voice Clone API for Reference-Based Speech
Parameters and input rules
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
audioUrl | string | Yes | Not specified | URL of the reference voice sample. |
textContent | string | Yes | Not specified | Text to synthesize (max 1000 chars). Maximum characters: 1000 |
Example request
{
"audioUrl": "https://vidmage.ai/templates/voices/alice.mp3",
"textContent": "Welcome to VidMage."
}# Set VIDMAGE_IDEMPOTENCY_KEY to a unique value for this task; preserve it for transport retries.
curl -X POST "https://vidmage.ai/api/v1/voice-clone/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ${VIDMAGE_IDEMPOTENCY_KEY}" \
-H "Content-Type: application/json" \
-d '{"audioUrl":"https://vidmage.ai/templates/voices/alice.mp3","textContent":"Welcome to VidMage."}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Task results and recovery
URL of the synthesized audio. Read audioUrl from the completed query response. Preserve taskId while the task is running.
curl -X POST "https://vidmage.ai/api/v1/voice-clone/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "taskId": "TASK_ID_FROM_SUBMIT" }'
# -> { "success": true, "data": { "status": "...", "audioUrl": "https://..." } }Submission and task queries report the available task and usage information. A timeout is not a confirmed failure. Recover the existing task instead of resubmitting.
For face selection and error recovery, follow Task lifecycle. MCP uses the normalized taskId argument in get_task_result, including capabilities whose REST identifier is requestId.
Credits
| Component / option | Rate | Minimum |
|---|---|---|
| Script length | 0.1 credits / character | 5 credits |
Character count × rate is rounded up to whole credits; the minimum charge applies.
Use the Playground or the MCP credit estimator for your exact inputs. Credits and billing.
