synthesisgen/scripts/synthesai.py

15 lines
520 B
Python

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