x-ai/grok-imagine-video-1.5Grok Imagine Video 1.5 is a video generation model from SpaceXAI. It creates videos from text prompts, with an optional starting image to guide the scene. It can direct subject...
Tiers are reference prices. Submission reserves by duration, settings and inputs; unspecified tiers may reserve conservatively. Completion uses trusted upstream cost when available, otherwise it may settle the reservation as an estimate. Ledger seconds describe the requested duration, not a measured output duration.
Video is asynchronous: POST /v1/videos submits a job and returns 202 with a job id straight away. Submitting reserves against your balance by duration and resolution but does **not** charge; the charge happens once the job completes, and failed, cancelled or expired jobs are never charged.
curl https://macdecloud.com/v1/videos \
-H "Authorization: Bearer dcld-sk-..." \
-H "Content-Type: application/json" \
-d "{\"model\":\"x-ai/grok-imagine-video-1.5\",\"prompt\":\"a cat surfing\",\"duration\":1,\"resolution\":\"720p\"}"
# => {"id":"vid_...","status":"pending","polling_url":"https://macdecloud.com/v1/videos/vid_..."}Poll polling_url every 5–10 seconds. The status is one of pending, in_progress, completed, failed, cancelled or expired. Polling counts against the same per-minute rate limit as any other request, so don't poll faster. Once it completes, unsigned_urls carries the download links.
curl https://macdecloud.com/v1/videos/vid_... \
-H "Authorization: Bearer dcld-sk-..."
# => {"id":"vid_...","model":"x-ai/grok-imagine-video-1.5","status":"completed",
# "unsigned_urls":["https://macdecloud.com/v1/videos/vid_.../content?index=0"]}unsigned_urls point at deCloud's own endpoint; download with the same API key. deCloud forwards Range, but resume and playback seeking depend on the upstream. Confirm a 206 response with a valid Content-Range. A 200 response contains the whole file: save it in full for local playback, without appending it to an existing file.
curl -L -o out.mp4 "https://macdecloud.com/v1/videos/vid_.../content?index=0" \
-H "Authorization: Bearer dcld-sk-..."This example uses httpx for submission, polling and download. Parameters follow this model’s capabilities; set VIDEO_DURATION_SECONDS first if no duration is declared.
import time, httpx, os
h = {"Authorization": "Bearer dcld-sk-..."}
job = httpx.post("https://macdecloud.com/v1/videos", headers=h, json={
"model": "x-ai/grok-imagine-video-1.5", "prompt": "a cat surfing",
"duration": 1,
"resolution": "720p",
}).json()
while True:
state = httpx.get(job["polling_url"], headers=h).json()
if state["status"] in ("completed", "failed", "cancelled", "expired"):
break
time.sleep(5)
assert state["status"] == "completed", state["error"]
with open("out.mp4", "wb") as f:
f.write(httpx.get(state["unsigned_urls"][0], headers=h, follow_redirects=True).content)