Animate images to video with Grok Imagine Image to Video via the Muapi REST API. Pay per generation — no subscription needed.
POST https://api.muapi.ai/api/v1/grok-imagine-image-to-videoSubmit a job with your MuApi API key in the x-api-key header, then poll https://api.muapi.ai/api/v1/predictions/{request_id}/result until status is completed.
| Name | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Text prompt describing the video. Reference uploaded images using @image(n) followed by a space — e.g. @image1 a sunset over the ocean. |
| images_list | array | Yes | Upload or provide image URLs for image-to-video generation. Supports up to 7 images. Reference each image in the prompt with @image1, @image2, etc. |
| aspect_ratio | string | No | Aspect ratio of the output video. Note: ignored when only a single image is provided.Options: 9:16, 16:9, 2:3, 3:2, 1:1Default: "2:3" |
| mode | string | No | Note: When generating videos using external image inputs, Spicy mode is not supported and will automatically switch to Normal.Options: fun, normal, spicyDefault: "normal" |
| resolution | string | No | Output video resolution.Options: 480p, 720pDefault: "480p" |
| duration | int | No | Video duration in seconds (6–30). Cost: $0.025/s at 480p, $0.05/s at 720p.Default: 6 |
REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/grok-imagine-image-to-video \
-H "x-api-key: $MUAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"<prompt>","images_list":[]}' | jq -r .request_id)
curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY"import os, time, requests
API = "https://api.muapi.ai/api/v1"
headers = {"x-api-key": os.environ["MUAPI_API_KEY"]}
r = requests.post(f"{API}/grok-imagine-image-to-video", headers=headers, json={"prompt":"<prompt>","images_list":[]})
request_id = r.json()["request_id"]
while True:
res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json()
if res["status"] == "completed":
print(res["outputs"]); break
if res["status"] == "failed":
raise RuntimeError(res.get("error"))
time.sleep(3)Full docs and agent/MCP integration: llms.txt. Get an API key at muapi.ai/access-keys.