MarktSupport← Zurück zur App

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
POST https://api.lithovas.com/api/generate

Body: { "model": "<slug>", "input": { … } }

Antwort: { "taskId": "<id>", "state": "waiting" }

Ergebnis abfragen

GET
GET https://api.lithovas.com/api/generate/<taskId>

Antwort: { "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }

Asynchron
Ein 200 von „Task erstellen“ bedeutet nur, dass der Task angenommen wurde — nicht, dass er fertig ist. Frage diesen Endpunkt ab, bis state zu success oder fail wird. Fehlgeschlagene Tasks werden nicht berechnet.

Endpunkte

ModellTaskmodel slug
Grok ImagineText to Imagegrok-imagine/text-to-image
Grok ImagineImage to Imagegrok-imagine/image-to-image
Grok ImagineText to Videogrok-imagine/text-to-video
Grok ImagineImage to Videogrok-imagine/image-to-video
Grok ImagineImage to Videogrok-imagine/upscale
Grok ImagineImage to Videogrok-imagine/extend
Grok Imagine 1.5 PreviewImage to Videogrok-imagine/1-5-preview

Grok Imagine · Text to Image

POSTText to Imagegrok-imagine/text-to-image
input-Felder
promptstringerforderlich

Text prompt describing the desired image (max 5000 chars)

aspect_ratioenum<string>optional

Width-to-height ratio of generated image

nsfw_checkerbooleanoptional

Content filtering; disabled when false

enable_probooleanoptional

Quality mode (true) vs speed mode (false)

Beispiel
cURL
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

POSTImage to Imagegrok-imagine/image-to-image
input-Felder
promptstringoptional

Text description specifying desired content or style

image_urlsarray<string>erforderlich

Up to 1 reference image URL (JPEG/PNG/WebP, max 10MB)

nsfw_checkerbooleanoptional

Toggle content filtering; false disables filtering

Beispiel
cURL
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

POSTText to Videogrok-imagine/text-to-video
input-Felder
promptstringerforderlich

Text prompt describing desired video motion (max 5000 chars)

aspect_ratioenum<string>optional

Width-to-height ratio of the generated video

modeenum<string>optional

Generation mode affecting style and intensity of motion

durationnumberoptional

Video length in seconds (range 6-30, step 1)

resolutionenum<string>optional

The resolution of the generated video

nsfw_checkerbooleanoptional

Disables content filtering when set to false

Beispiel
cURL
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

POSTImage to Videogrok-imagine/image-to-video
input-Felder
image_urlsarray<string>optional

External image URLs for video (max 7, JPEG/PNG/WEBP, 10MB each)

task_idstringoptional

Task ID from previous Grok text-to-image generation (max 100 chars)

indexintegeroptional

Image index when using task_id (0-5, 0-based)

promptstringoptional

Text describing desired video motion (max 5000 chars)

modeenum<string>optional

Generation mode: fun, normal, spicy

durationstringoptional

Video duration in seconds (6-30 range, 1 second steps)

resolutionenum<string>optional

Output video resolution

aspect_ratioenum<string>optional

Video aspect ratio for multi-image mode

nsfw_checkerbooleanoptional

Enable content filtering (disabled by default)

Beispiel
cURL
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

POSTImage to Videogrok-imagine/upscale
input-Felder
task_idstringerforderlich

Task ID from a previously successful video generation task

Beispiel
cURL
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

POSTImage to Videogrok-imagine/extend
input-Felder
task_idstringerforderlich

Task ID from previous video generation (Kie AI models only)

promptstringerforderlich

Text instructions describing desired video movement and expansion

extend_atnumberoptional

Starting position for video extension

extend_timesnumbererforderlich

Duration of video extension in seconds (6 or 10 seconds)

Beispiel
cURL
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

POSTImage to Videogrok-imagine/1-5-preview
input-Felder
promptstringerforderlich

Prompt for video generation (max 4096 chars)

image_urlsarray<string>optional

Image files for input (JPEG/PNG/WebP/JPG, max 20MB, up to 1 file)

aspect_ratioenum<string>optional

Aspect ratio for video generation

resolutionenum<string>optional

Resolution for video generation

durationintegeroptional

Video duration in seconds (range 1-15)

nsfw_checkerbooleanoptional

If set to false, content filtering is disabled

Beispiel
cURL
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
  }
}'