deCloud
MA CHAIN · 20260131
← All models

SpaceXAI: Grok Imagine Video

Origin
x-ai/grok-imagine-video

Grok Imagine Video is SpaceXAI's fast, text-, image-, and reference-conditioned video generation model. It produces short videos (1–15 seconds, 24 fps) at 480p or 720p across seven aspect ratios -...

Pricing
480p · 0.06 MA / second
720p · 0.084 MA / second

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.

Capabilities

Vision

Submit a job

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\",\"prompt\":\"a cat surfing\",\"duration\":1,\"resolution\":\"720p\"}"
# => {"id":"vid_...","status":"pending","polling_url":"https://macdecloud.com/v1/videos/vid_..."}

Poll for status

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","status":"completed",
#     "unsigned_urls":["https://macdecloud.com/v1/videos/vid_.../content?index=0"]}

Download

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-..."

Python

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", "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)
SpaceXAI: Grok Imagine Video (ORIGIN) · deCloud