Grok Imagine
Grok Imagine-Modelle werden über eine einheitliche, asynchrone Job-API aufgerufen. Starte einen Task mit POST /api/generate und frage dann GET /api/generate/{taskId} ab, bis er fertig ist. Diese Familie stellt 7 Endpunkte bereit.
Überblick
Jeder Endpunkt teilt sich dieselbe Hülle — nur model und die input-Felder ändern sich. Führe einen beliebigen im Playground des Modell-Markts aus.
Authentifizierung
Erstelle einen API-Schlüssel unter /api-keys und sende ihn als Bearer-Token. Anfragen aus dem Browser bei angemeldeter Sitzung funktionieren auch über das Session-Cookie.
Authorization: Bearer <YOUR_API_KEY>Task erstellen
POST https://api.lithovas.com/api/generateBody: { "model": "<slug>", "input": { … } }
Antwort: { "taskId": "<id>", "state": "waiting" }
Ergebnis abfragen
GET https://api.lithovas.com/api/generate/<taskId>Antwort: { "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }
state zu success oder fail wird. Fehlgeschlagene Tasks werden nicht berechnet.Endpunkte
| Modell | Task | model slug |
|---|---|---|
| Grok Imagine | Text to Image | grok-imagine/text-to-image |
| Grok Imagine | Image to Image | grok-imagine/image-to-image |
| Grok Imagine | Text to Video | grok-imagine/text-to-video |
| Grok Imagine | Image to Video | grok-imagine/image-to-video |
| Grok Imagine | Image to Video | grok-imagine/upscale |
| Grok Imagine | Image to Video | grok-imagine/extend |
| Grok Imagine 1.5 Preview | Image to Video | grok-imagine/1-5-preview |
Grok Imagine · Text to Image
grok-imagine/text-to-imagepromptstringerforderlichText prompt describing the desired image (max 5000 chars)
aspect_ratioenum<string>optionalWidth-to-height ratio of generated image
nsfw_checkerbooleanoptionalContent filtering; disabled when false
enable_probooleanoptionalQuality mode (true) vs speed mode (false)
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/text-to-image",
"input": {
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "1:1",
"nsfw_checker": false,
"enable_pro": false
}
}'Grok Imagine · Image to Image
grok-imagine/image-to-imagepromptstringoptionalText description specifying desired content or style
image_urlsarray<string>erforderlichUp to 1 reference image URL (JPEG/PNG/WebP, max 10MB)
nsfw_checkerbooleanoptionalToggle content filtering; false disables filtering
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/image-to-image",
"input": {
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"image_urls": [
"https://example.com/input.jpg"
],
"nsfw_checker": false
}
}'Grok Imagine · Text to Video
grok-imagine/text-to-videopromptstringerforderlichText prompt describing desired video motion (max 5000 chars)
aspect_ratioenum<string>optionalWidth-to-height ratio of the generated video
modeenum<string>optionalGeneration mode affecting style and intensity of motion
durationnumberoptionalVideo length in seconds (range 6-30, step 1)
resolutionenum<string>optionalThe resolution of the generated video
nsfw_checkerbooleanoptionalDisables content filtering when set to false
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/text-to-video",
"input": {
"prompt": "A cinematic red panda surfing through neon rain at dusk.",
"aspect_ratio": "2:3",
"mode": "normal",
"duration": 5,
"resolution": "480p",
"nsfw_checker": false
}
}'Grok Imagine · Image to Video
grok-imagine/image-to-videoimage_urlsarray<string>optionalExternal image URLs for video (max 7, JPEG/PNG/WEBP, 10MB each)
task_idstringoptionalTask ID from previous Grok text-to-image generation (max 100 chars)
indexintegeroptionalImage index when using task_id (0-5, 0-based)
promptstringoptionalText describing desired video motion (max 5000 chars)
modeenum<string>optionalGeneration mode: fun, normal, spicy
durationstringoptionalVideo duration in seconds (6-30 range, 1 second steps)
resolutionenum<string>optionalOutput video resolution
aspect_ratioenum<string>optionalVideo aspect ratio for multi-image mode
nsfw_checkerbooleanoptionalEnable content filtering (disabled by default)
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/image-to-video",
"input": {
"image_urls": [
"https://example.com/input.jpg"
],
"task_id": "example",
"index": 0,
"prompt": "Animate the image with natural motion, subtle camera movement, and cinematic lighting.",
"mode": "normal",
"duration": 5,
"resolution": "480p",
"aspect_ratio": "16:9",
"nsfw_checker": false
}
}'Grok Imagine · Image to Video
grok-imagine/upscaletask_idstringerforderlichTask ID from a previously successful video generation task
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/upscale",
"input": {
"task_id": "example"
}
}'Grok Imagine · Image to Video
grok-imagine/extendtask_idstringerforderlichTask ID from previous video generation (Kie AI models only)
promptstringerforderlichText instructions describing desired video movement and expansion
extend_atnumberoptionalStarting position for video extension
extend_timesnumbererforderlichDuration of video extension in seconds (6 or 10 seconds)
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/extend",
"input": {
"task_id": "example",
"prompt": "Animate the image with natural motion, subtle camera movement, and cinematic lighting.",
"extend_at": 2,
"extend_times": 1
}
}'Grok Imagine 1.5 Preview · Image to Video
grok-imagine/1-5-previewpromptstringerforderlichPrompt for video generation (max 4096 chars)
image_urlsarray<string>optionalImage files for input (JPEG/PNG/WebP/JPG, max 20MB, up to 1 file)
aspect_ratioenum<string>optionalAspect ratio for video generation
resolutionenum<string>optionalResolution for video generation
durationintegeroptionalVideo duration in seconds (range 1-15)
nsfw_checkerbooleanoptionalIf set to false, content filtering is disabled
curl -X POST https://api.lithovas.com/api/generate \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine/1-5-preview",
"input": {
"prompt": "Animate the image with natural motion, subtle camera movement, and cinematic lighting.",
"image_urls": [
"https://example.com/input.jpg"
],
"aspect_ratio": "auto",
"resolution": "480p",
"duration": 8,
"nsfw_checker": false
}
}'