xAI video status done/expired vs Sume completed/failed

xAI's Grok Imagine video status values are pending, done, expired and failed. Sume uses pending, in_progress, completed, failed and cancelled. Port a poll loop.

4 min readSume
All posts

If you port an xAI Grok Imagine poll loop to Sume, change the success check from done to completed, and handle cancelled. xAI's docs list pending, done, expired and failed; Sume's video docs list pending, in_progress, completed, failed and cancelled.

xAI's values are from its video generation docs, read 2026-09-30. Sume's are from its Video generation docs.

How do the status vocabularies differ?

Only pending and failed appear in both lists. xAI's done maps to Sume's completed; xAI's expired has no counterpart in the Sume table, and Sume adds in_progress and cancelled.

From xAI's docs and Sume's catalog and docs, read 2026-09-30: job status values.
xAI docsSume docs
pendingpending (queued)
(not listed)in_progress (video being generated)
donecompleted (ready to download)
failedfailed (check the error field)
expired(not listed)
(not listed)cancelled (canceled before finishing)

What does the Sume loop look like?

The docs poll polling_url, branch on completed, and read error on failed. This version also stops on cancelled.

import os
import time

import requests

headers = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}


def wait(polling_url: str) -> dict:
    while True:
        time.sleep(30)
        status = requests.get(polling_url, headers=headers).json()
        if status["status"] == "completed":
            return status
        if status["status"] in ("failed", "cancelled"):
            raise RuntimeError(status.get("error", status["status"]))

What about xAI's error codes?

xAI lists invalid_argument, permission_denied, failed_precondition, service_unavailable and internal_error. Sume's docs show failure through the error field on a failed job, so do not match on xAI's code names.

What should I do?

Put the status names in one mapping at the edge of your code. For polling cadence and timeouts see polling an AI video job.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume