Discussions

Ask a Question
Back to All

Cannot generate a video using audio_file as source using curl and api key

I have the following curl command:

curl -v -X POST https://api.heygen.com/v2/video/generate
-H 'X-Api-Key: <my_api_key>'
-H 'Content-Type: application/json'
-d '{
"video_inputs": [
{
"character": {
"type": "avatar",
"avatar_id": "nik_expressive_20240910",
"avatar_style": "normal"
},
"voice": {
"type": "audio",
"audio_url": "https://drive.google.com/uc?export=download&id=MY_VID_ID"
}
}
]
}'

my_api_key and MY_VID_ID are set, the file format is .mp3, the link pointing to Google Drive has public access set and the cURL command returns the following:

{"error": null, "data": {"video_id": "VID_ID"}}

The projects page https://app.heygen.com/projects however shows the video as an error.

The audio_url is 30 seconds in length and 435KB in size. My API usage history says I have 10 credits left.

Could you please help me understand what I am missing?