SpaceXAI: Grok Imagine Video
x-ai/grok-imagine-videoGrok Imagine Video is SpaceXAI's fast, text-, image-, and reference-conditioned video generation model. It produces short videos (1–15 seconds, 24 fps) at 480p or 720p across seven aspect ratios -...
- Modalities
- text+image->video
- Price
- $0.35 per generation
- Context
- —
- Released
- May 18, 2026
- Knowledge cutoff
- —
Providers
Every request enters through InfAPI. One key calls every model in the catalog. Upstream groups, ratios, and tiers are not shown.
| Endpoint | Input | Output | Context | Status |
|---|---|---|---|---|
| InfAPI | $0.35 per generation | — | — | Available |
- Input
- Text, Image
- Output
- Video
- Tokenizer
- Grok
- Max output
- —
- Endpoint
- Video generation
Pricing
Listed price for this model on this gateway. Token prices are per 1M tokens.
| Item | Price | Unit |
|---|---|---|
| Requestrequest | $0.35 | per generation |
| Inputprompt | $0 | per 1M tokens |
| Outputcompletion | $0 | per 1M tokens |
API
API
Submit a video generation request with the model, a prompt, and optional duration, resolution, aspect ratio, or first-frame image. Poll the job for status. When it is complete, the status response includes download URLs and the content endpoint returns the file.
Get your API key
Create a key on the keys page and set it as an environment variable: Keys
export INFAPI_API_KEY=sk-...Make your first request
Use x-ai/grok-imagine-video
import time
import requests
headers = {
"Authorization": "Bearer $INFAPI_API_KEY",
"Content-Type": "application/json",
}
# 1. Submit a video generation request.
submitted = requests.post(
"https://infapi.cc/v1/videos",
headers=headers,
json={
"model": "x-ai/grok-imagine-video",
"prompt": "The dolphins leap out of the water in a graceful arc, sunlight glinting off the waves",
"duration": 8,
"resolution": "720p",
"aspect_ratio": "16:9",
"frame_images": [
{
"type": "image_url",
"image_url": {
"url": "https://live.staticflickr.com/3851/14825276609_098cac593d_b.jpg"
},
"frame_type": "first_frame"
}
]
},
)
submitted.raise_for_status()
job_id = submitted.json()["id"]
print(f"Job submitted: {job_id}")
# 2. Poll until the job finishes.
while True:
status = requests.get(f"https://infapi.cc/v1/videos/{job_id}", headers=headers)
status.raise_for_status()
payload = status.json()
print(f"Status: {payload.get('status')}")
if payload.get("status") in {"completed", "succeeded"}:
for url in payload.get("unsigned_urls") or payload.get("urls") or []:
print(f"Video URL: {url}")
break
if payload.get("status") in {"failed", "cancelled"}:
raise SystemExit(payload.get("error") or "Video generation failed")
time.sleep(5)
# 3. Download the file.
video = requests.get(f"https://infapi.cc/v1/videos/{job_id}/content", headers=headers)
video.raise_for_status()
open("output.mp4", "wb").write(video.content)
print("Saved output.mp4")Endpoint
POST / GET https://infapi.cc/v1/videos
Authorization: Bearer $INFAPI_API_KEY
GET https://infapi.cc/v1/videos/{id}/content
Using third-party SDKs
Point the OpenAI SDK at https://infapi.cc/v1 with $INFAPI_API_KEY. The HTTP samples above are the request shape this gateway accepts.
from openai import OpenAI
client = OpenAI(
base_url="https://infapi.cc/v1",
api_key="$INFAPI_API_KEY",
)
job = client.videos.create(
model="x-ai/grok-imagine-video",
prompt="The dolphins leap out of the water in a graceful arc, sunlight glinting off the waves",
seconds="8",
size="1280x720",
)
print(job.id)
while job.status not in {"completed", "succeeded", "failed", "cancelled"}:
job = client.videos.retrieve(job.id)
print(job.status)
content = client.videos.download_content(job.id)
open("output.mp4", "wb").write(content.read())Supported parameters
logprobsLogprobs
Return the log probability of each output token.
max_tokensMax tokens
Upper bound on generated tokens. Output stops at the limit.
response_formatResponse format
For example json_object or json_schema, to constrain the shape.
seedSeed
A fixed seed helps reproduce sampling. It does not guarantee byte-identical output.
temperatureTemperature
Sampling temperature. Lower is steadier, higher is more varied. Often 0 to 2.
top_logprobsTop logprobs
Also return the most likely alternatives at each position.
top_pTop-p
Sample only from tokens whose cumulative probability reaches top_p.
FAQ
What is this model?
Grok Imagine Video is SpaceXAI's fast, text-, image-, and reference-conditioned video generation model. It produces short videos (1–15 seconds, 24 fps…
How much does it cost?
$0.35 per generation
What inputs and outputs does it support?
text+image->video
When was it released?
May 18, 2026