Skip to main content
Back to API Platform

Grok Imagine Video API

Grok Imagine video generation with text-to-video and image-to-video support Integrate this model via REST with endpoint docs, parameters, and code examples.

Video Generation
Img2Vid
Credit Cost
2 credits/sec
Type
video

API Endpoint

POST
/api/v1/models/xai-video/run

Parameters

Input parameters accepted by this model

ParameterTypeDefault
prompt
required
string
-
image_url
url
-
mode
enum
text-to-video
resolution
enum
720p
aspect_ratio
enum
16:9
duration
integer
5

Supported Aspect Ratios

16:9
4:3
1:1
9:16
3:4
3:2
2:3

Example Outputs

Real outputs generated by this model

View Details

a thrilling action sequence of a woman trying to find her favorite candy. The candy wrapper is purple with a pixelated dragon and reads "Pixel Dojo". The woman says "Gotta have that pixel dojo candy. with over 60 ai tools, it's basically zero calories."

10 credits
14.5s

Code Examples

Copy and paste to get started

bash
curl -X POST "https://pixeldojo.ai/api/v1/models/xai-video/run" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cinematic shot of ocean waves at sunset",
    "aspect_ratio": "16:9",
    "duration": 5
  }'

Response Format

Submit Response (202 Accepted)

json
{
  "jobId": "job_abc123...",
  "status": "pending",
  "statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123...",
  "creditCost": 10,
  "creditsRemaining": 95,
  "expiresAt": "2025-01-23T12:00:00Z"
}

Completed Response

json
{
  "jobId": "job_abc123...",
  "status": "completed",
  "output": {
    "video": "https://temp.pixeldojo.ai/pixeldojotemp/1705930123-456789.mp4"
  },
  "creditCost": 10,
  "expiresAt": "2025-01-23T12:00:00Z"
}