Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
import time import requests BASE = "https://api.cloudsome-inc.ai/v1" HEADERS = {"Authorization": "Bearer sk_live_your_key_here"} response = requests.post(f"{BASE}/videos", headers=HEADERS, json={ "model": "dreamina-seedance-2.5", "prompt": "A golden retriever running on the beach at sunset", "duration": 5, "resolution": "720p", }, timeout=60) response.raise_for_status() task_id = response.json()["tasks"][0]["id"] print("Task ID:", task_id) for _ in range(120): response = requests.get(f"{BASE}/videos/{task_id}", headers=HEADERS, timeout=30) response.raise_for_status() task = response.json() if task["status"] == "completed": url = task.get("download_url") or task.get("url") if not url: raise RuntimeError(f"Video URL unavailable; query task {task_id} again.") print(url) break if task["status"] in ("failed", "cancelled", "expired"): raise RuntimeError(task.get("error") or task["status"]) time.sleep(5) else: raise TimeoutError(f"Keep querying task {task_id}; do not create it again.")
const BASE = "https://api.cloudsome-inc.ai/v1"; const headers = { Authorization: "Bearer sk_live_your_key_here", "Content-Type": "application/json", }; async function request(path, options = {}) { const response = await fetch(BASE + path, { ...options, headers, signal: AbortSignal.timeout(60_000), }); if (!response.ok) throw new Error(await response.text()); return response.json(); } const batch = await request("/videos", { method: "POST", body: JSON.stringify({ model: "dreamina-seedance-2.5", prompt: "A golden retriever running on the beach at sunset", duration: 5, resolution: "720p", }), }); const taskId = batch.tasks[0].id; console.log("Task ID:", taskId); for (let attempt = 0; ; attempt++) { if (attempt === 120) throw new Error("Keep querying task " + taskId + "; do not create it again."); const task = await request("/videos/" + taskId); if (task.status === "completed") { const url = task.download_url || task.url; if (!url) throw new Error("Video URL unavailable; query task " + taskId + " again."); console.log(url); break; } if (["failed", "cancelled", "expired"].includes(task.status)) { throw new Error(JSON.stringify(task.error || task.status)); } await new Promise((resolve) => setTimeout(resolve, 5000)); }
curl --fail-with-body -sS https://api.cloudsome-inc.ai/v1/videos \ -H "Authorization: Bearer sk_live_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "model": "dreamina-seedance-2.5", "prompt": "A golden retriever running on the beach at sunset", "duration": 5, "resolution": "720p" }' curl --fail-with-body -sS https://api.cloudsome-inc.ai/v1/videos/VIDEO_ID \ -H "Authorization: Bearer sk_live_your_key_here"