File size: 2,202 Bytes
250a93c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | # DRAMA API quickstart
Full reference: https://docs.drama.syncmonster.ai/
## Authentication
Send your key in the `x-api-key` header on every request. Never put it in browser code.
Base URL: `https://studio.syncmonster.ai/neuralgarage/saas/api/v1/clients`
## One-step flow (single-face videos)
1. `POST /generate` with `skip_find_face=1`, `is_drama=true`, the video, the audio and `drama_params`. Returns a `request_id`.
2. `GET /get-status?request_id=...` every few seconds until `data.status` is `Success`.
3. `GET /get-file?request_id=...` returns the MP4.
~~~python
import json, time, requests
BASE = "https://studio.syncmonster.ai/neuralgarage/saas/api/v1/clients"
H = {"x-api-key": "YOUR_API_KEY"}
with open("clip.mp4", "rb") as v, open("clip.mp3", "rb") as a:
r = requests.post(f"{BASE}/generate", headers=H,
data={"skip_find_face": 1, "is_drama": "true",
"drama_params": json.dumps({"happy": 0.8})},
files={"video": v, "audio": a})
rid = r.json()["data"]["request_id"]
while True:
s = requests.get(f"{BASE}/get-status", headers=H,
params={"request_id": rid}).json()["data"]["status"]
if str(s).lower() == "success":
break
if str(s).lower() == "failed":
raise RuntimeError("DRAMA job failed")
time.sleep(5)
out = requests.get(f"{BASE}/get-file", headers=H, params={"request_id": rid})
open("drama.mp4", "wb").write(out.content)
~~~
## Multi-face videos
Run `POST /v2/find-face`, poll `GET /v2/find-face/status`, list faces with `GET /v2/get-face` (each has a `global_face_id` and a preview image), then call `POST /generate` with `find_face_id` and the chosen `global_face_id`.
## Emotions
`happy`, `sad`, `excited`, `angry`, each 0–1. `happy` and `sad` share one axis.
## Credits
Face detection 0.5 credits per second of video, drama 1 credit per second. Check your balance with `GET /get-credits`.
## Errors
| Code | Meaning |
| --- | --- |
| ERR_004 | No face detected |
| ERR_006 | Not enough credits |
| ERR_007 | File corrupted |
| ERR_008 | Unsupported format (use .mp4, .mov, .mp3, .wav) |
| ERR_009 | Video too long |
## Getting a key
[How to get access, and the support link.] |