DeadNecromancer
02/26/2026, 6:32 AMAI Evy
02/26/2026, 6:32 AMAI Evy
02/26/2026, 6:33 AMfs.createReadStream(). Here's the documented approach:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const voiceResponse = await client.voice.clone({
files: [fs.createReadStream('path/to/file') ],
voice_name: 'x',
}) ;
console.log(voiceResponse.provider) ;
[(1) ]()
Key details:
- The files parameter expects an array of file streams created with fs.createReadStream()
- You can upload up to 25 files for ElevenLabs, but only 1 file is supported for Cartesia and MiniMax
- You can optionally specify a voice_provider (defaults to elevenlabs) , with available options: elevenlabs, cartesia, minimax
If you're receiving an HTML-based internal server error, a few things to check:
- Ensure you're using fs.createReadStream() with a valid file path (not a ReadableStream from another source)
- Verify your API key is correctly set in the Authorization header
- Confirm the audio file format is compatible with the voice provider you're using
The documentation doesn't specify exact audio format requirements, so if issues persist, I'd recommend reaching out via:
- Visit [Documentation]()
- Visit [Hire certified Retell partner]()AI Evy
02/26/2026, 6:33 AMAI Evy
02/26/2026, 6:33 AMDeadNecromancer
02/26/2026, 6:40 AMAI Evy
02/26/2026, 6:40 AMAI Evy
02/26/2026, 6:41 AMfs.createReadStream('path/to/file') expects the local file path on your system where the audio file is stored. [(1) ]()
For example, if your audio file is located at /Users/yourname/audio/voice-sample.mp3, you would use:
javascript
files: [fs.createReadStream('/Users/yourname/audio/voice-sample.mp3') ]
The fs module is Node.js's built-in file system module, and createReadStream reads the file from your local disk and streams it to the API.AI Evy
02/26/2026, 6:41 AMAI Evy
02/26/2026, 6:41 AMDeadNecromancer
02/26/2026, 6:42 AMAI Evy
02/26/2026, 6:42 AMAI Evy
02/26/2026, 6:42 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
[(2) ]()
The apiKey you provide during client initialization is automatically included as the Authorization header (in the format Bearer YOUR_API_KEY) for all subsequent API calls, including the client.voice.clone() method.
So your complete clone voice call would simply be:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const voiceResponse = await client.voice.clone({
files: [fs.createReadStream('path/to/file') ],
voice_name: 'x',
}) ;
console.log(voiceResponse.provider) ;
No additional header configuration is needed when using the SDK—that's one of its main benefits over using the REST API directly. [(1) ]()AI Evy
02/26/2026, 6:42 AMAI Evy
02/26/2026, 6:42 AM