Skip to Content
Video ModelsGrok Imagine

Grok

Overview

Grok is a powerful text-to-video generation model that creates high-quality videos from text prompts or images.

Test API KEY: key_00000000000000000000000000000000

Endpoints

1. Create Task

Request

POST https://api.pixwithapi.online/api/task/create

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Api-Key{API_KEY}Yes

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe input prompt (e.g., “a futuristic city”)
image_urlsarrayConditional[“https://cdn.pixwithapi.online/xxx.jpg ”]. Provide 1 image. Required for Image-to-Video mode.
model_idstringYes2-19 (Text-to-Video)
optionsobjectYesConfiguration options for the task
options.prompt_optimizationbooleanYesIf true, all prompt words will be automatically translated into English.
options.aspect_ratiostringConditionalAspect ratio of the output. Valid values: '2:3' (Default), '3:2', '1:1', '9:16', '16:9'. Required for Text-to-Video mode only.
options.modestringYesGeneration mode. Valid values: 'fun', 'normal' (Default), 'spicy'.

Example Request - Text-to-Video

{ "prompt": "a futuristic city", "model_id": "2-19", "options": { "prompt_optimization": true, "aspect_ratio": "2:3", "mode": "normal" } }

Example Request - Image-to-Video

{ "prompt": "a futuristic city", "image_urls": [ "https://cdn.pixwithapi.online/images/cf0ddb5ad6a0f0c85ab4d1dceb9fd89c_0.jpeg" ], "model_id": "2-19", "options": { "prompt_optimization": true, "mode": "normal" } }

Response Parameters

ParameterTypeDescription
codeint1=success, 0=error
messagestringSuccess and failure messages
dataobject
data.task_idstring
data.estimated_timeintEstimated time in seconds

Response

{ "code": 1, "message": "success", "data": { "task_id": "d425ab4dc256f0ebaa84862b9cea8a3d", "estimated_time": 30 } }
Last updated on