POST
/v1/voices/pvc/{voice_id}/samples/{sample_id}
ElevenLabs APIUpdate Pvc Voice Sample
- Base URL
- https://api.elevenlabs.io
- Auth
- xi-api-key: <ELEVENLABS_API_KEY>
- Last verified
- 2026-09-03 · upstream hash matched
Actions
Agents: curl -H "Accept: text/markdown" this URL
→ 216 tokens · Vary: Accept
→ 216 tokens · Vary: Accept
Critical gotchas
Authentication uses the non-standard xi-api-key header, not Authorization: Bearer. Sending a Bearer token returns HTTP 401.
Text-to-speech responses are raw binary audio, not JSON. Write the body to a file (--output speech.mp3) rather than parsing it.
cURL
curl -X POST 'https://api.elevenlabs.io/v1/voices/pvc/voice-id/samples/sample-id' \ -H "xi-api-key: $ELEVENLABS_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "remove_background_noise": false, "selected_speaker_ids": [ "string" ], "trim_start_time": 0, "trim_end_time": 0, "file_name": "string"}'Get a free ElevenLabs API key → sponsored
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| voice_id | path | string | Yes | Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices. |
| sample_id | path | string | Yes | Sample ID to be used |
| remove_background_noise | body | boolean | No | If set will remove background noise for voice samples using our audio isolation model. If the samples do not include background noise, it can make the quality worse. |
| selected_speaker_ids | body | string[] | No | Speaker IDs to be used for PVC training. Make sure you send all the speaker IDs you want to use for PVC training in one request because the last request will override the previous ones. |
| trim_start_time | body | integer | No | The start time of the audio to be used for PVC training. Time should be in milliseconds |
| trim_end_time | body | integer | No | The end time of the audio to be used for PVC training. Time should be in milliseconds |
| file_name | body | string | No | The name of the audio file to be used for PVC training. |
Response 200 OK
{
"voice_id": "b38kUX8pkfYO2kHyqfFy"
}