Conversation
This was
linked to
issues
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add native xAI/Grok media generation support across provider routing, backend adapters, model capabilities, and chat configuration.
This change:
xai_videoprotocol support for:POST /v1/videos/generationsGET /v1/videos/{request_id}pending,done, andfailedresult pollingaspect_ratio,resolution,n, andresponse_formatimage/imagespayload fields for image editingfile_output.public_urlresponsesRetry-Afteris missing, invalid, zero, or negative:xai_videowithout overwriting administrator-customized allowlists.Actual upstream-result duration billing is intentionally outside the scope of this pull request.
Change type
Affected areas
Verification
go test ./internal/infra/llm -run XAIVideogo test ./...pnpm checkgit diff --checkNo browser testing or paid xAI generation requests were performed.
Screenshots, API examples, or logs
No screenshots are included. The new controls reuse the existing model capability and chat configuration components.
Example video generation request:
{ "model": "grok-imagine-video", "prompt": "A cinematic view of waves at sunset", "aspect_ratio": "16:9", "duration": 8, "resolution": "720p" }Example asynchronous submission response:
{ "request_id": "request-id" }The adapter polls:
until the result is
doneorfailed.Supported video controls:
1:1,16:9,9:16,4:3,3:4,3:2,2:31to15seconds480p,720p,1080pSupported image controls:
auto1k,2k1–10url,b64_jsonConfiguration, migration, and compatibility notes
xai_videoprotocol andvideo_generationsendpoint identifier.aspect_ratio,duration, andresolutionto the defaultxai_videomodel-option allowlist.xai_videopaths if needed.Documentation
The supported options and constraints are exposed through the existing admin capability presets and chat configuration UI.
Security and privacy
Checklist
.pycfiles,.envfiles, and local storage data are not committed.