Skip to content

feat(ai-grok): video generation adapter for the grok-imagine video models #705

Description

@tombeckenham

Problem

xAI's Imagine API ships video generation models, but @tanstack/ai-grok has no video adapter — generateVideo() currently supports OpenAI Sora and fal only.

Available models (per docs.x.ai/developers/models):

  • grok-imagine-video — text-to-video, $0.05/second
  • grok-imagine-video-1.5-preview — text-to-video (preview), $0.08/second

Proposal

Add a grokVideo adapter following the existing jobs/polling pattern (BaseVideoAdapter, like the OpenAI Sora and fal video adapters):

Notes

  • The Imagine API plumbing landed in feat: multimodal prompt for generateImage/generateVideo (image-to-image, image-to-video) #624 for the image models (grok-imagine-image, grok-imagine-image-quality): JSON endpoints called directly (the OpenAI SDK's multipart paths are rejected by xAI), aspect-ratio size template, and /v1/images/edits image conditioning. The video adapter can build on the same utilities.
  • E2E: aimock doesn't mock the Imagine video endpoints, so coverage would follow the same unit-test approach as the image-to-image / image-to-video features (see testing/e2e/src/lib/feature-support.ts).

Related: #618, #624.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions