Skip to content

Grok Imagine Video 1.5 Preview ​

This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.

Endpoint ​

POST /jobs/createTask

Full URL: https://ai.modelfold.online/v1/jobs/createTask

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

Output is an MP4 video with an audio track generated together with the video (dialogue written in the prompt is spoken). Audio cannot be turned off.

Create Task ​

Use this endpoint to create a new text-to-video generation task.

  • Get Task Details — After submission, use the unified query endpoint to check task progress and retrieve results

TIP

For production use, we recommend providing the callBackUrl parameter so your service can receive completion notifications instead of polling for task status.

File Upload ​

TIP

Need to upload files before calling this endpoint? See File Upload API Quickstart.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name used for generation. This endpoint must use grok-imagine-video-1-5-preview. Default:"grok-imagine-video-1-5-preview"。 Allowed values:grok-imagine-video-1-5-preview。 示例:grok-imagine-video-1-5-preview。
callBackUrlstringNoOptional callback URL for task completion notifications. If provided, the system will send a POST request to this URL when the task completes.
inputobjectYesInput parameters for the generation task.
  input.promptstringNoPrompt for video generation. Maximum length: 4096 characters.
  input.image_urlsarray&lt;string&gt;NoUpload image files to be used as API input. Supported file types: image/jpeg, image/png, image/webp, image/jpg. Maximum file size: 20MB. Supports multi-file upload, up to 7 file.Only one is supported when the resolution is 1080p.
  input.aspect_ratiostringNoThe aspect ratio of the video. This parameter is invalid if it is a single image. Default:"auto"。 Allowed values:1:1 / 16:9 / 9:16 / 3:2 / 2:3 / auto。 示例:auto。
  input.resolutionstringNoResolution for video generation. Default:"480p"。 Allowed values:480p / 720p / 1080p。 示例:480p。
  input.durationintegerNoVideo duration in seconds. Range: [1, 15]. Default: 8. Minimum: 1. Maximum: 15. Step: 1. Default:8。 示例:8。
  input.nsfw_checkerbooleanNoDefaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request Example ​

bash
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-imagine-video-1-5-preview",
  "callBackUrl": "https://your-domain.com/api/callback",
  "input": {
    "prompt": "A serene mountain landscape at sunrise",
    "image_urls": [
      "https://your-domain.com/input.png"
    ],
    "aspect_ratio": "auto",
    "resolution": "480p",
    "duration": 8,
    "nsfw_checker": false
  }
}'
json
{
  "model": "grok-imagine-video-1-5-preview",
  "callBackUrl": "https://your-domain.com/api/callback",
  "input": {
    "prompt": "A serene mountain landscape at sunrise",
    "image_urls": [
      "https://your-domain.com/input.png"
    ],
    "aspect_ratio": "auto",
    "resolution": "480p",
    "duration": 8,
    "nsfw_checker": false
  }
}

Response ​

200 — Request successful. ​

参数类型必填说明
codeinteger否Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying). 可选值:200 / 401 / 402 / 404 / 422 / 429 / 455 / 500 / 501 / 505。 示例:200。
msgstring否Response message, error description when failed 示例:success。
dataobject是—
  data.taskIdstring否Task ID, can be used with Get Task Details endpoint to query task status
  data.recordIdstring否Record ID, can be used to get the record details

Success response

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_grok-imagine-video-1.5-preview_1234567890"
  }
}

Callback ​

videoTaskCompleted ​

Callback URL: {request.body#/callBackUrl} (the callBackUrl in the request body).

The system sends this callback when the grok-imagine-video-1-5-preview task succeeds or fails.

Callback body parameters

参数类型必填说明
codeinteger是Unified callback code: 200 for success, 501 for failure. Allowed values:200 / 501。 示例:200。
msgstring是Unified callback message. Allowed values:Playground task completed successfully. / Playground task failed.。 示例:Playground task completed successfully.。
dataobject是—
  data.taskIdstring是The unique task identifier.
  data.modelstring是The model used for the task. Allowed values:grok-imagine-video-1-5-preview。 示例:grok-imagine-video-1-5-preview。
  data.statestring是Terminal task state. Allowed values:success / fail。 示例:success。
  data.paramstring是JSON string containing the submitted task parameters.
  data.resultJsonstring否JSON string containing resultUrls, firstFrameUrl, lastFrameUrl, or resultObject when successful. Present only when state is success.
  data.failCodestring否Failure code, a numeric string such as "400" or "500". Present only when state is fail.
  data.failMsgstring否Failure reason. Present only when state is fail.
  data.costTimeinteger否Processing time in seconds. Present on both success and failure callbacks.
  data.completeTimeinteger否Task completion timestamp.
  data.createTimeinteger否Task creation timestamp.
  data.updateTimeinteger否Use completeTime as the completion time; updateTime may equal createTime.
  data.creditsConsumednumber否Credits consumed by the task; 0 for failed tasks.

Task completed successfully

json
{
  "code": 200,
  "msg": "Playground task completed successfully.",
  "data": {
    "taskId": "task_example_video_webhook_001",
    "model": "grok-imagine-video-1-5-preview",
    "state": "success",
    "param": "{\"input\":\"{}\",\"callBackUrl\":\"https://example.com/callback\",\"model\":\"grok-imagine-video-1-5-preview\"}",
    "resultJson": "{\"resultUrls\":[\"https://example.com/generated-video.mp4\"]}",
    "costTime": 12,
    "completeTime": 1234567890,
    "createTime": 1234560000,
    "updateTime": 1234567890,
    "creditsConsumed": 1.23
  }
}

Task failed

json
{
  "code": 501,
  "msg": "Playground task failed.",
  "data": {
    "taskId": "task_example_video_webhook_001",
    "model": "grok-imagine-video-1-5-preview",
    "state": "fail",
    "param": "{\"input\":\"{}\",\"callBackUrl\":\"https://example.com/callback\",\"model\":\"grok-imagine-video-1-5-preview\"}",
    "failCode": "400",
    "failMsg": "<error detail>",
    "costTime": 12,
    "creditsConsumed": 0
  }
}

ModelFold — one API for all the best AI models.