commit 9f44a7cfa4bbad18e1be957899312a8cc6ef576b Author: Dita Aji Pratama Date: Thu Feb 13 22:47:01 2025 +0700 First commit diff --git a/synthesai.py b/synthesai.py new file mode 100644 index 0000000..53fcde1 --- /dev/null +++ b/synthesai.py @@ -0,0 +1,14 @@ +import requests + +def generate(auth, payload): + url = "https://api.synthesia.io/v2/videos" + headers = { "Authorization" : auth, "accept" : "application/json", "content-type" : "application/json" } + response = requests.post(url, json=payload, headers=headers) + return response + +def retrieve(auth, video_id): + url = f"https://api.synthesia.io/v2/videos/{video_id}" + headers = { "Authorization": auth, "accept": "application/json" } + response = requests.get(url, headers=headers) + return response +