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.
Related Resources
- Model Marketplace — Explore all available models and capabilities
- Common API — Check account credits and usage
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The 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。 |
callBackUrl | string | No | Optional callback URL for task completion notifications. If provided, the system will send a POST request to this URL when the task completes. |
input | object | Yes | Input parameters for the generation task. |
input.prompt | string | No | Prompt for video generation. Maximum length: 4096 characters. |
input.image_urls | array<string> | No | Upload 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_ratio | string | No | The 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.resolution | string | No | Resolution for video generation. Default:"480p"。 Allowed values:480p / 720p / 1080p。 示例:480p。 |
input.duration | integer | No | Video duration in seconds. Range: [1, 15]. Default: 8. Minimum: 1. Maximum: 15. Step: 1. Default:8。 示例:8。 |
input.nsfw_checker | boolean | No | Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model. |
Request Example
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
}
}'{
"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.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | 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。 |
msg | string | 否 | Response message, error description when failed 示例:success。 |
data | object | 是 | — |
data.taskId | string | 否 | Task ID, can be used with Get Task Details endpoint to query task status |
data.recordId | string | 否 | Record ID, can be used to get the record details |
Success response
{
"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
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | Unified callback code: 200 for success, 501 for failure. Allowed values:200 / 501。 示例:200。 |
msg | string | 是 | Unified callback message. Allowed values:Playground task completed successfully. / Playground task failed.。 示例:Playground task completed successfully.。 |
data | object | 是 | — |
data.taskId | string | 是 | The unique task identifier. |
data.model | string | 是 | The model used for the task. Allowed values:grok-imagine-video-1-5-preview。 示例:grok-imagine-video-1-5-preview。 |
data.state | string | 是 | Terminal task state. Allowed values:success / fail。 示例:success。 |
data.param | string | 是 | JSON string containing the submitted task parameters. |
data.resultJson | string | 否 | JSON string containing resultUrls, firstFrameUrl, lastFrameUrl, or resultObject when successful. Present only when state is success. |
data.failCode | string | 否 | Failure code, a numeric string such as "400" or "500". Present only when state is fail. |
data.failMsg | string | 否 | Failure reason. Present only when state is fail. |
data.costTime | integer | 否 | Processing time in seconds. Present on both success and failure callbacks. |
data.completeTime | integer | 否 | Task completion timestamp. |
data.createTime | integer | 否 | Task creation timestamp. |
data.updateTime | integer | 否 | Use completeTime as the completion time; updateTime may equal createTime. |
data.creditsConsumed | number | 否 | Credits consumed by the task; 0 for failed tasks. |
Task completed successfully
{
"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
{
"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
}
}