Discussions

Ask a Question
Back to All

My API (Free trial is not working)

Here is the code:
API Request Details
Apply to .env
{
"source_url": "https://raw.githubusercontent.com/D-ID/public-assets/main/images/demo/demo1.jpg",
"script": {
"type": "text",
"input": "Hello, this is a test of the D-ID video generation API.",
"provider": {
"type": "microsoft",
"voice_id": "en-US-DavisNeural",
"voice_config": {
"style": "Cheerful"
}
}
}
}


HTTP Request Details
Endpoint: POST https://api.d-id.com/talks
Headers:
Apply to .env
Authorization: Basic [your_api_key]
Content-Type: application/json
Response: 500 Internal Server Error
Error Body: {"kind":"UnknownError","description":"Internal Server Error"}

  1. Code Snippet
    Apply to .env
    import requests

headers = {
"Authorization": f"Basic {api_key}",
"Content-Type": "application/json"
}

payload = {
"source_url": "https://raw.githubusercontent.com/D-ID/public-assets/main/images/demo/demo1.jpg",
"script": {
"type": "text",
"input": "Hello, this is a test of the D-ID video generation API.",
"provider": {
"type": "microsoft",
"voice_id": "en-US-DavisNeural",
"voice_config": {
"style": "Cheerful"
}
}
}
}

response = requests.post("https://api.d-id.com/talks", headers=headers, json=payload)
print(f"Status: {response.status_code}")
print(f"Response: {response.text}")