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.

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.
| xAI docs | Sume docs |
|---|---|
pending | pending (queued) |
| (not listed) | in_progress (video being generated) |
done | completed (ready to download) |
failed | failed (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
- Zapier Catch Hook test trigger with Sume Send test
Zapier lists the three most recent webhooks from the past hour. Use Sume's Send test to put a signed webhook.test sample there before a real run exists.
- Will a 100-item Sume bulk run hit Zapier's webhook rate limit?
A Sume bulk queue holds up to 100 items, each with its own webhook. Compare that with Zapier's per-Zap webhook limit and know what Sume does on a 429.
- Zapier accepted my Sume webhook but the Zap ran minutes later
Zapier says it may return 200 and delay webhook processing by minutes. Sume sees a delivered 200, so keep a status poll as the backup for run and job results.
- Captions misspell your brand name: fix it with authored cues
Sume video captions have no custom dictionary field. Pass cues with your own spelling and speech-to-text is skipped, so the brand name prints as written.
Written by Sume