{"openapi":"3.0.2","info":{"title":"xai/grok-imagine-video-1.5","description":"The request body Comfy Router accepts for the model \"xai/grok-imagine-video-1.5\", and the response body it returns. The INPUT schema is the same schema the server validates a call against before it reaches the provider, so what is published and what is enforced cannot differ. `x-comfy-router-input-modalities` records the media kinds the model is documented to accept; the request schema is shared across sibling models and may admit media kinds this model ignores. The OUTPUT schema describes the provider's native result document exactly as Router returns it: Router does not validate, narrow or re-envelope the response, so the output schema is descriptive rather than enforced, and Comfy owns no output shape of its own.","version":"dc9596926447"},"paths":{"/v2/models/xai/grok-imagine-video-1.5":{"post":{"operationId":"runRouterModel","summary":"Run xai/grok-imagine-video-1.5 synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Request body for xAI Grok Imagine video generation.\nSupports three modes: text-to-video (prompt only), image-to-video (prompt + image),\nand reference-to-video (prompt + reference_images).\nThe fields image, reference_images, and video are mutually exclusive.\n","example":{"duration":4,"prompt":"a single red maple leaf falling onto still water, slow motion"},"not":{"required":["image","reference_images"]},"properties":{"aspect_ratio":{"default":"16:9","description":"Aspect ratio of the generated video","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"],"type":"string"},"duration":{"default":8,"description":"Video duration in seconds. Range [1, 15]. Default 8.","maximum":15,"minimum":1,"nullable":true,"type":"integer"},"image":{"$ref":"#/components/schemas/XAIImageObject"},"model":{"description":"Model to be used. Supported: grok-imagine-video (default), grok-imagine-video-1.5-preview, grok-imagine-video-1.5, grok-imagine-video-1.5-lite. The deprecated grok-imagine-video-beta id is aliased to grok-imagine-video.","nullable":true,"type":"string"},"output":{"description":"Optional output destination for generated video","nullable":true,"type":"object"},"prompt":{"description":"Prompt for video generation. Maximum 4,096 characters.","maxLength":4096,"type":"string"},"reference_images":{"description":"One or more reference images to guide the video generation (reference-to-video mode). Mutually exclusive with image. Router forwards application/json only and neither this object nor XAIImageObject accepts a file_id, so file-backed image inputs are not supported on this route.","items":{"$ref":"#/components/schemas/XAIReferenceImageObject"},"minItems":1,"type":"array"},"resolution":{"description":"Resolution of the output video","nullable":true,"type":"string"},"size":{"description":"Size of the output video","nullable":true,"type":"string"},"user":{"description":"A unique identifier representing your end-user","nullable":true,"type":"string"}},"required":["prompt"],"type":"object"}}}},"responses":{"200":{"description":"OK - the model's native JSON output, returned unchanged; the schema describes the provider's terminal result document as Router returns it.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/XAIVideoResultResponse"},{"properties":{"block_reason":{"description":"Never carries a reason on this document: a non-empty block reason is an input-moderation refusal, which Router answers as a Comfy Router error rather than with this body. Absent, null or empty here.","maxLength":0,"nullable":true,"type":"string"},"status":{"description":"Absent or `done` on this document. `pending` is the body of a poll Router has not finished and is never returned as a `200`; Router accepts a missing status when `video.url` is populated, so a caller must not require it.","enum":["done"],"type":"string"},"video":{"description":"The finished generation. Required here, unlike on the poll document: a terminal result with no `video.url` is answered as a Comfy Router error, so a `200` always carries it.","properties":{"duration":{"description":"Duration of the generated video in seconds","type":"integer"},"respect_moderation":{"description":"Whether the video generated by the model respects moderation rules","type":"boolean"},"url":{"description":"Non-empty on this document. Router reports success only when this leaf is populated; it is the re-hosted Comfy-signed URL described above, or xAI's own short-lived URL when the re-host could not be performed.","minLength":1,"type":"string"}},"required":["url"],"type":"object"}},"required":["video"],"type":"object"}],"description":"Comfy Router output schema for the xAI Grok Imagine video models: the terminal `GET /v1/videos/{request_id}` document, forwarded unchanged EXCEPT for the re-hosted `video.url` described below - every other field is xAI's own. This family is SUBMIT-AND-POLL — the submit answers with an `XAIVideoAsyncResponse` handle carrying `request_id`, and Router polls `GET /v1/videos/{request_id}` on the caller's behalf, so the body a caller receives is the finished result rather than that handle.\nThe generated video is in `video`. On the poll document its `url` is NULLABLE, and Router treats a success whose `video.url` is empty as `success_without_output` rather than as a completed generation.\nThat `url` is RE-HOSTED: Router copies the finished video onto Comfy storage and answers a Comfy-signed URL valid for up to 24 hours in place of xAI's own, so it is a Comfy link and not the partner's. Durability is per entry, not per response, exactly as it is on the image family: a video whose re-host could not be performed keeps xAI's own short-lived URL rather than a Comfy one, so a caller that stores or replays this document should not assume the URL outlives the call. 24 hours is the CEILING, not a guarantee: the Comfy link is signed for 24 hours from the moment it is minted, and Router memoises it for 23 hours, so a later poll or an `Idempotency-Key` replay can hand back a link with as little as an hour left. Either way the link expires, so download the video rather than storing it.\n`status` is xAI's own two-value vocabulary — `pending` or `done`, NOT `completed` — and `status`, `model` and `usage` are all populated on a PENDING poll and on an input-moderation refusal alike. A caller must therefore key completion off `video.url`, NOT off `video`: on the poll document the `video` object can be present with a null `url`, which is the `success_without_output` case above, so the container test reports a generation that produced nothing as finished. It is the same rule Router applies when it decides a poll SUCCEEDED: `video.url` must be non-empty.\nThe composition NARROWS `XAIVideoResultResponse` rather than republishing it, because `XAIVideoResultResponse` describes every poll of the request — including the pending and refused ones a caller never sees — while this document describes only the body a `200` carries. Router reports success on one shape: `video.url` non-empty, no non-empty `block_reason`, and `status` absent or `done`. A `pending` poll is polled again rather than returned, a non-empty `block_reason` is an input-moderation refusal answered as a Comfy Router error, and a terminal result with no `video.url` is the `success_without_output` error above, so `video` and its `url` are required here and `block_reason` is at most empty. `status` is narrowed to the single terminal spelling `done` because Router compares it WITHOUT a case fold, so no other spelling can reach a `200`; it stays optional, because Router also reports success when `status` is missing and `video.url` is populated.","example":{"model":"grok-imagine-video","status":"done","usage":{"cost_in_usd_ticks":3500000000},"video":{"duration":4,"respect_moderation":true,"url":"https://example.invalid/xai/grok-imagine-video/generated.mp4"}}}}}}}}}},"components":{"schemas":{"XAIGeneratedVideo":{"description":"A generated video from xAI","properties":{"duration":{"description":"Duration of the generated video in seconds","type":"integer"},"respect_moderation":{"description":"Whether the video generated by the model respects moderation rules","type":"boolean"},"url":{"description":"Download URL for the generated video. Router re-hosts the video onto Comfy storage and rewrites this field, so it is normally a Comfy-signed URL valid for up to 24 hours - signed for 24 hours when minted and replayed from a 23-hour memo, so a later poll can hand back one with as little as an hour left. When the re-host could not be performed the field keeps xAI's own short-lived URL instead. NULLABLE: a success whose `url` is empty is not a completed generation. Either way the link expires, so download the video rather than storing the URL.","nullable":true,"type":"string"}},"type":"object"},"XAIImageObject":{"description":"Input image object for xAI endpoints","properties":{"type":{"description":"Type of the image input","enum":["image_url"],"type":"string"},"url":{"description":"URL of the input image (public URL or base64-encoded data URI)","type":"string"}},"required":["url"],"type":"object"},"XAIReferenceImageObject":{"description":"A reference image used to guide video generation in R2V mode","properties":{"url":{"description":"URL of the reference image. Supports HTTPS URLs (public) or base64-encoded data URLs (e.g., data:image/jpeg;base64,...).","type":"string"}},"required":["url"],"type":"object"},"XAIVideoResultResponse":{"description":"Response from getting video generation result","properties":{"block_reason":{"description":"If the request was blocked by input moderation, contains the block reason","nullable":true,"type":"string"},"model":{"description":"The model used to generate the video","type":"string"},"status":{"description":"Status of the deferred request: \"pending\" or \"done\"","enum":["pending","done"],"type":"string"},"usage":{"$ref":"#/components/schemas/XAIVideoUsage"},"video":{"$ref":"#/components/schemas/XAIGeneratedVideo"}},"type":"object"},"XAIVideoUsage":{"description":"Usage information for the video generation request","properties":{"cost_in_usd_ticks":{"description":"The cost of this request expressed in USD ticks. One USD cent equals 100,000,000 ticks, so one US dollar equals 10,000,000,000 ticks.\n","type":"integer"}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"xai/grok-imagine-video-1.5","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text","image"],"x-comfy-router-output-modalities":["video"]}
