import json
import os
import requests
payload = json.loads(r'''
{
"model": "seedance-1-0-pro-fast-251015",
"prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
"asset": false,
"metadata": {
"content": [
{
"type": "text",
"text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
}
],
"duration": 4,
"resolution": "480p",
"ratio": "1:1",
"watermark": false
}
}
''')
response = requests.post(
"https://api.mixroute.ai/v1/video/generations",
headers={"Authorization": "Bearer " + os.environ["MIXROUTE_API_KEY"]},
json=payload,
timeout=60,
)
response.raise_for_status()
result = response.json()
if result.get("code") not in (None, 0, 200, "0", "200", "success"):
raise RuntimeError(result.get("message") or result)
print(result)