Grok Imagine
Los modelos de Grok Imagine se llaman a través de una API de trabajos asíncrona y unificada. Inicia una tarea con POST /api/generate y luego sondea GET /api/generate/{taskId} hasta que termine. Esta familia expone 7 endpoints.
Resumen
Todos los endpoints comparten la misma envoltura — solo cambian model y los campos input. Ejecuta cualquiera desde el playground del Mercado de modelos.
Autenticación
Crea una API key en /api-keys y luego envíala como token Bearer. Las solicitudes desde el navegador con sesión iniciada también funcionan mediante la cookie de sesión.
Authorization: Bearer <YOUR_API_KEY>Crear tarea
POST https://api.lithovas.com/api/generateCuerpo: { "model": "<slug>", "input": { … } }
Respuesta: { "taskId": "<id>", "state": "waiting" }
Consultar resultado
GET https://api.lithovas.com/api/generate/<taskId>Respuesta: { "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }
state sea success o fail. Las tareas fallidas no se facturan.Endpoints
| Modelo | Tarea | 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-imagepromptstringobligatorioText prompt describing the desired image (max 5000 chars)
aspect_ratioenum<string>opcionalWidth-to-height ratio of generated image
nsfw_checkerbooleanopcionalContent filtering; disabled when false
enable_probooleanopcionalQuality 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-imagepromptstringopcionalText description specifying desired content or style
image_urlsarray<string>obligatorioUp to 1 reference image URL (JPEG/PNG/WebP, max 10MB)
nsfw_checkerbooleanopcionalToggle 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-videopromptstringobligatorioText prompt describing desired video motion (max 5000 chars)
aspect_ratioenum<string>opcionalWidth-to-height ratio of the generated video
modeenum<string>opcionalGeneration mode affecting style and intensity of motion
durationnumberopcionalVideo length in seconds (range 6-30, step 1)
resolutionenum<string>opcionalThe resolution of the generated video
nsfw_checkerbooleanopcionalDisables 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>opcionalExternal image URLs for video (max 7, JPEG/PNG/WEBP, 10MB each)
task_idstringopcionalTask ID from previous Grok text-to-image generation (max 100 chars)
indexintegeropcionalImage index when using task_id (0-5, 0-based)
promptstringopcionalText describing desired video motion (max 5000 chars)
modeenum<string>opcionalGeneration mode: fun, normal, spicy
durationstringopcionalVideo duration in seconds (6-30 range, 1 second steps)
resolutionenum<string>opcionalOutput video resolution
aspect_ratioenum<string>opcionalVideo aspect ratio for multi-image mode
nsfw_checkerbooleanopcionalEnable 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_idstringobligatorioTask 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_idstringobligatorioTask ID from previous video generation (Kie AI models only)
promptstringobligatorioText instructions describing desired video movement and expansion
extend_atnumberopcionalStarting position for video extension
extend_timesnumberobligatorioDuration 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-previewpromptstringobligatorioPrompt for video generation (max 4096 chars)
image_urlsarray<string>opcionalImage files for input (JPEG/PNG/WebP/JPG, max 20MB, up to 1 file)
aspect_ratioenum<string>opcionalAspect ratio for video generation
resolutionenum<string>opcionalResolution for video generation
durationintegeropcionalVideo duration in seconds (range 1-15)
nsfw_checkerbooleanopcionalIf 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
}
}'