Video API

Grok Video API

Grok Video API gives teams an API-first way to use Grok Imagine video generation inside production workflows. It supports prompt-driven text-to-video and image-to-video from a single source image through one endpoint.

Try prompts and source images in the web generator first, settle the duration, resolution and aspect ratio, then send the same settings from your app, creative tool, or content pipeline.

Supported modes
  • Grok Imagine Text to Video
  • Grok Imagine Image to Video
Capabilities

What Grok Video API adds to your video workflow

The page follows the same API-first structure as the reference: test the model, understand the fields, then move into integration.

Text-to-video generation

Turn detailed prompts into short-form video concepts for social posts, ads, product moments, and fast creative exploration.

Image-to-video motion

Animate source images while preserving the subject, composition, and visual direction that your team already approved.

Duration and resolution control

Choose 1 to 15 seconds and 480p, 720p or 1080p per request, and check the credit cost with estimate_cost before you spend it.

API-ready payloads

Work with model slugs, prompts, image URLs, aspect ratios and generation polling in one integration path.

Quick Start

From Grok video test to production request

A compact path for teams that want to validate output quality before wiring Grok video generation into an app.

1. Choose a mode

Select text-to-video for prompt-only creation, or image-to-video to animate one source image.

2. Submit generation

Call generate_video with your API key, the model slug, a prompt and an optional source image URL.

3. Poll and reuse

Poll the generation until it succeeds, then reuse the output URL in your product or campaign workflow.

API reference: pricing, parameters and code

Every Grok Imagine request goes through one endpoint, POST /api/mcp, with the generate_video tool and model "grok-imagine-video-1.5". A cheaper variant, "grok-imagine-video-1.5-lite", takes the same fields. Text-to-video and image-to-video are available through the endpoint today; the job runs on the same account, credits and history as the web generator.

Pricing

Clips are billed in credits per output second, and image-to-video costs the same as text-to-video at the same length and resolution. A 6-second 720p clip costs 66 credits, which makes Grok Imagine one of the lowest-cost video models on the site; Seedance 2.5 at 720p runs about 105 credits per second. Compare credit plans

ResolutionCredits / second6 s clip10 s clip15 s clip
480p≈ 5.8365988
720p≈ 1166110165
1080p≈ 19.5117195293

Parameters

Put the prompt and image URL at the top level and the generation settings inside options. Option names a model does not accept are skipped, so check the exact field list with get_model when you switch models.

ParameterAccepted valuesDefaultNotes
promptstring (≤ 4,096 chars)—Required. Describe subject, motion, camera and sound.
imageUrlshttp(s) URL[] (1 item)—Optional first frame for image-to-video. The clip follows the source image aspect ratio.
options.duration1–15 (seconds)6Billed per output second.
options.resolution480p | 720p | 1080p720pSets the per-second price.
options.aspect_ratio16:9 | 9:16 | 1:1 | 3:2 | 2:316:9Text-to-video only; ignored when a first frame is sent.

Code examples

The curl request starts one vertical 6-second clip. The Python script first asks estimate_cost for the price, then submits the job and waits until it finishes. Create a key under Settings → API Keys (it starts with sk_), keep it on your server, and send it as a Bearer token. Get an API key · Full API reference

curl
curl -X POST https://tikdek.com/api/mcp \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"generate_video","arguments":{"model":"grok-imagine-video-1.5","prompt":"A neon-lit food truck opens its shutters at night, handheld camera, sizzling grill and street chatter","options":{"duration":6,"resolution":"720p","aspect_ratio":"9:16"}}}}'
Python
import json
import os

import requests

API_URL = "https://tikdek.com/api/mcp"
HEADERS = {
    "Authorization": f"Bearer {os.environ['API_KEY']}",
    "Content-Type": "application/json",
    "Accept": "application/json, text/event-stream",
}


def call(tool, arguments):
    body = {
        "jsonrpc": "2.0",
        "id": 1,
        "method": "tools/call",
        "params": {"name": tool, "arguments": arguments},
    }
    res = requests.post(API_URL, headers=HEADERS, json=body, timeout=90)
    res.raise_for_status()
    lines = [l[5:] for l in res.text.splitlines() if l.startswith("data:")]
    message = json.loads(lines[-1] if lines else res.text)
    if "error" in message:
        raise RuntimeError(message["error"]["message"])
    result = message["result"]
    if result.get("isError"):
        raise RuntimeError(result["content"][0]["text"])
    return result["structuredContent"]


args = {
    "model": "grok-imagine-video-1.5",
    "prompt": "A neon-lit food truck opens its shutters at night, handheld camera, sizzling grill and street chatter",
    "options": {
        "duration": 6,
        "resolution": "720p",
        "aspect_ratio": "9:16"
    }
}
print(call("estimate_cost", {"mediaType": "video", **args}))

job = call("generate_video", args)
while True:
    status = call("wait_for_generation", {"id": job["id"]})
    if status["status"] in ("success", "failed", "canceled"):
        break
print(status["status"], status.get("url"))

Limits and retries

  • Clips run 1 to 15 seconds at 480p, 720p or 1080p. Prompts are capped at 4,096 characters.
  • Each account can run up to 10 generations at the same time; new requests are rejected until one finishes.
  • Requests are limited to 120 per minute per IP or account, with a 200 KB body cap. On HTTP 429, wait for the Retry-After seconds.
  • Prompts and media pass a content-safety check. Refused, failed or canceled jobs refund their credits automatically.
  • Generation is asynchronous: generate_video returns an id, and wait_for_generation waits up to 50 seconds per call. Poll again instead of resubmitting, so a slow job is not charged twice.

Related pages: Seedance 2.5 API · Wan 2.7 API · Seedance 2.5 model page

Use Cases

What you can create with Grok Video API

Use the API when your product needs repeatable Grok video output, not just one-off manual generations.

  • Prompt-led social clips for TikTok, Reels, and Shorts
  • Animated product stills and campaign visuals
  • Rapid storyboard and concept video exploration
  • Video variants for ads, thumbnails, and landing pages
  • Vertical and widescreen versions of the same idea
  • Low-cost 480p drafts before a 1080p final render
Production Notes

Built for real production video workflows

Account-gated execution

Users sign in, submit jobs, and consume credits through the existing Tikdek generation flow.

Reference and task inputs

Image-to-video accepts one source image URL, and the clip follows that image’s aspect ratio.

Draft-to-final iteration

Test ideas at 480p or short durations, then rerun the prompts that work at 720p or 1080p.

FAQ

Grok Video API questions

Start building

Turn Grok video into your production workflow

Open the generator, test a Grok video prompt or source image, then use the API docs when you are ready to wire it into production.

workflow
API-ready
video tools
2 modes
per clip
1–15 s