Discussions
Error without any status code
3 months ago by null
API endpoint to generate the video
generate_video_url = "https://api.heygen.com/v2/video/generate"
Payload for the POST request
payload = {
"video_inputs": [
{
"character": {
"type": "avatar",
"avatar_id": selected_avatar, # Use the selected avatar ID
"avatar_style": "normal"
},
"voice": {
"type": "audio",
"audio_url": "https://engagexai.com/...."
},
"background": {
"type": "color",
"value": "#008000"
}
}
],
"test": True,
"aspect_ratio": aspect_ratio
}
Headers for the POST request
headers = {
"X-Api-Key": api_key,
"Content-Type": "application/json"
}
Make the POST request to generate the video
response = requests.post(generate_video_url, json=payload, headers=headers)
This is giving me an error
{'error': None, 'data': {'video_id': 'ac4f222bc7134fea99a0d1f783e032e5'}}
How can I fix this?