Discussions

Ask a Question
Back to All

Unauthorized

import requests

url = "https://api.d-id.com/talks"

payload = {
"script": {
"type": "text",
"subtitles": "false",
"provider": {
"type": "elevenlabs",
"voice_id": "21m00Tcm4TlvDq8ikWAM"
},
"input": "This is an AI prompt that works using python"
},
"config": {
"fluent": "false",
"pad_audio": "0.0"
},
"source_url": "https://img.freepik.com/free-photo/handsome-bearded-guy-posing-against-white-wall_273609-20597.jpg?t=st=1714185052~exp=1714185652~hmac=383a21b3bb15d52279d7caa61d64112ec02ff373e4036e14c3c65288ab05935f"
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": f"Basic (My API key" # Replace YOUR_API_KEY_HERE with your actual API key
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)


I am unsure how to implement the API key or username and password, I am getting a link to visit but I am receiving a "Unauthorized" message on that link.

{"id":"tlk_arJeT_tnWlwWwBv9S91E6","created_at":"2024-04-27T03:09:41.261Z","created_by":"google-oauth2|118274173746624624115","status":"created","object":"talk"}