The Video Bridge lets you use xAI’s Grok Imagine Video generation through any non-OpenAI model
routed by opencodex. When enabled, a synthetic video_gen tool is injected into the conversation.
The model calls it like any function tool; opencodex intercepts the call, submits a video generation
job to xAI, polls until completion, and downloads the result.
If you onboarded via ocx login xai (OAuth), the provider stays in authMode: "oauth"
and the bridge silently won’t activate. Set XAI_API_KEY in the environment or
hard-code the key as shown above.
xAI only: Video generation is only available through xAI’s Grok Imagine Video API
Asynchronous: Video generation takes 30-120 seconds
Cost: Video generation is a paid xAI feature (~$0.05/sec @480p, ~$0.07/sec @720p)
One video per call: Each video_gen call produces one video
Coexists with Image Bridge: Both bridges can be enabled simultaneously
Web search priority: When a web search sidecar is active for a turn (non-runTurn adapter), the video bridge is skipped — the two cannot run concurrently. A console.warn is emitted so you can detect this in logs.
Timeout covers submit + poll: The videoTimeoutMs budget starts before job submission, so the submit call (60 s) and subsequent polling share the same deadline.