Repository navigation
Description
Summary
@tanstack/ai-grok is behind the current xAI Imagine / Voice catalog in three surfaces:
- Image — missing the recommended
grok-imagine-image-2.0model (and itsqualityparam). - Video — missing 3 of 5 official request modes, and still rejecting text-to-video on
grok-imagine-video-1.5. - Voice — realtime still lists deprecated 1.0 models; official current model is
grok-voice-think-fast-2.0.
Chat models (grok-4.6, 4.5, 4.20, 4.20-multi-agent, 4.3, build-0.1) are out of scope here.
Image
Upstream: Image generation, Image editing, grok-imagine-image-2.0.
| Official | Adapter today |
|---|---|
grok-imagine-image-2.0 — recommended T2I / I2I, $0.04/image, quality: low | medium (default medium) |
Missing. Not in GROK_IMAGE_MODELS or the Imagine options maps. |
grok-imagine-image ($0.02) and grok-imagine-image-quality ($0.05) |
Present. Aspect ratios + 1k/2k resolution match the docs. |
grok-2-image-1212 (legacy pixel sizes) |
Present. |
Image edit via /v1/images/edits (up to 3 source images) |
Present for Imagine models (isGrokImagineImageModel is a prefix check, so 2.0 would ride that path once listed). |
Batch n |
Present. |
Gap is the 2.0 model id + its quality option (low/medium). Our Imagine options still only expose resolution + service_tier.
Video
Upstream: Video generation, Image-to-video, Reference-to-video, Video editing, Video extension.
Both official models are listed (grok-imagine-video, grok-imagine-video-1.5). Generate knobs we already match: duration 1–15s; aspect 1:1 16:9 9:16 4:3 3:4 3:2 2:3; resolution 480p 720p 1080p.
| Mode | Official | Adapter today |
|---|---|---|
| Text-to-video | Both models. grok-imagine-video-1.5 is the documented default and has native 1080p T2V. |
Implemented for grok-imagine-video only. isImageToVideoOnlyModel('grok-imagine-video-1.5') still throws before the request. |
| Image-to-video | Start-frame image (URL, data URI, or file_id). 1.5 supports native 1080p. |
One image prompt part → image: { url }. No file_id. |
| Reference-to-video | reference_images and/or reference_audios (voice_id, max 3) on 1.5. Caps at 720p. |
Not implemented. Video/audio prompt parts are rejected. |
| Edit-video | POST /v1/videos/edits + source video. Duration / aspect / resolution inherited (capped at 720p). |
Not implemented. |
| Extend-video | POST /v1/videos/extensions + source video. duration is the added tail only. |
Not implemented. |
Stale 1.5 T2V guard
// packages/ai-grok/src/video/video-provider-options.ts
const GROK_VIDEO_IMAGE_TO_VIDEO_ONLY: ReadonlySet<string> = new Set([
'grok-imagine-video-1.5',
])That was true when 1.5 launched as image-to-video only. Current xAI generate docs use grok-imagine-video-1.5 as the text-to-video example.
Voice
Upstream: Voice overview, models.
| Official | Adapter today |
|---|---|
Speech-to-speech: grok-voice-think-fast-2.0 ($0.08/min) — current recommended |
Missing. Not in GROK_REALTIME_MODELS. Token/adapter defaults still grok-voice-fast-1.0. |
Speech-to-speech: grok-voice-think-fast-1.0 — deprecated |
Listed. |
Speech-to-speech: grok-voice-fast-1.0 |
Listed (and is the default). |
Alias grok-voice-latest (docs realtime examples) |
Not listed. |
TTS POST /v1/tts and STT POST /v1/stt (endpoint-addressed) |
Present (grok-tts / grok-stt synthetic ids). |
Custom voices POST /v1/custom-voices |
Not implemented (TTS still hard-codes the built-in roster eve/ara/rex/sal/leo). |
Suggested work
- Image: add
grok-imagine-image-2.0toGROK_IMAGE_MODELS+ size/options maps; add 2.0-onlyquality: 'low' | 'medium'. - Video: drop the 1.5-only T2V block and update comments/tests that claim 1.5 is image-to-video only.
- Video: add provider options + request mapping for
reference_images/reference_audioson/v1/videos/generations. - Video: add edit mode →
POST /v1/videos/editswith a source video part or URL. - Video: add extend mode →
POST /v1/videos/extensions(duration= extension length, not total). - Voice: add
grok-voice-think-fast-2.0(and considergrok-voice-latest); switch realtime defaults off the deprecated 1.0 ids. - Accept Files API
file_idinputs once feat(ai): native Files API support across providers (upload adapters +filecontent source) #909 lands (Imagine image + video endpoints already document it).
Related
- Models and pricing: https://docs.x.ai/developers/models
- feat(ai): native Files API support across providers (upload adapters +
filecontent source) #909 — native Files API /filecontent source (needed forfile_idImagine inputs)
Activity
[-]feat(ai-grok): expose remaining Grok Imagine video modes[/-][+]feat(ai-grok): catch up Grok Imagine image, video, and voice modes[/+]feat(ai-grok): catch up Grok Imagine image, video, and voice modes
feat(ai-grok): catch up Grok Imagine image, video, and voice modes
feat(ai-grok): catch up Grok Imagine image, video, and voice modes (#…