マーケットサポート← アプリに戻る

Grok Imagine

Grok Imagine モデルは統一された非同期ジョブ API で呼び出します。POST /api/generate でタスクを開始し、完了するまで GET /api/generate/{taskId} をポーリングします。このファミリーは 7 個のエンドポイントを提供します。

概要

すべてのエンドポイントは同じ外枠を共有し、変わるのは modelinput フィールドだけです。モデルマーケットの playground から任意に実行できます。

認証

/api-keys で API キーを作成し、Bearer トークンとして送信します。ログイン中のブラウザからのリクエストはセッション cookie 経由でも動作します。

Authorization: Bearer <YOUR_API_KEY>

タスクの作成

POST
POST https://api.lithovas.com/api/generate

ボディ:{ "model": "<slug>", "input": { … } }

レスポンス:{ "taskId": "<id>", "state": "waiting" }

結果の照会

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

レスポンス:{ "taskId", "state": "waiting" | "success" | "fail", "resultUrls": [ … ], "creditsConsumed", "failMsg", "balance" }

非同期
タスク作成の 200 は、タスクが受理されたことを意味するだけで、完了ではありません。statesuccess または fail になるまでこのエンドポイントをポーリングしてください。失敗したタスクは課金されません。

エンドポイント

モデルタスクmodel 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 フィールド
promptstring必須

Text prompt describing the desired image (max 5000 chars)

aspect_ratioenum<string>任意

Width-to-height ratio of generated image

nsfw_checkerboolean任意

Content filtering; disabled when false

enable_proboolean任意

Quality mode (true) vs speed mode (false)

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 フィールド
promptstring任意

Text description specifying desired content or style

image_urlsarray<string>必須

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

nsfw_checkerboolean任意

Toggle content filtering; false disables filtering

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 フィールド
promptstring必須

Text prompt describing desired video motion (max 5000 chars)

aspect_ratioenum<string>任意

Width-to-height ratio of the generated video

modeenum<string>任意

Generation mode affecting style and intensity of motion

durationnumber任意

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

resolutionenum<string>任意

The resolution of the generated video

nsfw_checkerboolean任意

Disables content filtering when set to false

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 フィールド
image_urlsarray<string>任意

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

task_idstring任意

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

indexinteger任意

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

promptstring任意

Text describing desired video motion (max 5000 chars)

modeenum<string>任意

Generation mode: fun, normal, spicy

durationstring任意

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

resolutionenum<string>任意

Output video resolution

aspect_ratioenum<string>任意

Video aspect ratio for multi-image mode

nsfw_checkerboolean任意

Enable content filtering (disabled by default)

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 フィールド
task_idstring必須

Task ID from a previously successful video generation task

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 フィールド
task_idstring必須

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

promptstring必須

Text instructions describing desired video movement and expansion

extend_atnumber任意

Starting position for video extension

extend_timesnumber必須

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

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 フィールド
promptstring必須

Prompt for video generation (max 4096 chars)

image_urlsarray<string>任意

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

aspect_ratioenum<string>任意

Aspect ratio for video generation

resolutionenum<string>任意

Resolution for video generation

durationinteger任意

Video duration in seconds (range 1-15)

nsfw_checkerboolean任意

If set to false, content filtering is disabled

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