From 9f44a7cfa4bbad18e1be957899312a8cc6ef576b Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Thu, 13 Feb 2025 22:47:01 +0700 Subject: [PATCH] First commit --- synthesai.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 synthesai.py 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 +