grok-media

Document xAI Grok image and video generation API authentication, endpoints, and polling.

46.2k|5.7k|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/calesthio/OpenMontage --skill grok-media
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grok-media
Source: https://github.com/calesthio/OpenMontage/tree/main/.agents/skills/grok-media
Command: npx skills add https://github.com/calesthio/OpenMontage --skill grok-media

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear, actionable guidance for authenticating, calling, prompting, and handling responses from xAI Grok image and video generation endpoints so teams can reliably generate and edit short-form media without trial-and-error.

Core Features & Use Cases

  • Authentication & Endpoints: Explains XAI_API_KEY usage, base URL, and required Authorization headers for image and video endpoints.
  • Image Workflows: Covers text-to-image generation, single-image edits, multi-image compositing, prompt structure, and acceptable image input formats.
  • Video Workflows: Covers text-to-video, image-to-video, and reference-image video modes, polling for generation status, and handling success/failure states.
  • Practical Guidance: Includes pricing guidance, prompt best practices, good/weak fit scenarios, and failure-handling recommendations for production pipelines.

Quick Start

Use grok-media to generate a 6-second 720p reference-conditioned video of a product using grok-imagine-video with the product image URL as the reference and a concise scene-and-motion prompt.

Frequently Asked Questions about grok-media

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate API requests for xAI Grok image and video generation?

To generate images using xAI Grok, send a POST request to the /images/generations endpoint with your XAI_API_KEY. This workflow supports text-to-image generation, single-image edits, and multi-image compositing using structured prompts and acceptable image input formats.

How does polling work for xAI Grok video generation requests?

Polling for xAI Grok video generation works by sending GET requests to the /videos/{request_id} endpoint. You must explicitly handle the response states—done, failed, and expired—to manage the asynchronous generation lifecycle and retrieve the final video output.

Can I use a reference image to condition xAI Grok short video generation?

Yes, you can use a reference image to condition xAI Grok short video generation. This reference-conditioned video workflow uses a provided image URL alongside a concise scene-and-motion prompt to generate a customized 6-second 720p video output.

What are the known limitations and failure states when generating videos with Grok?

Known limitations and failure states when generating videos with Grok include handling failed and expired polling statuses on GET /videos/{request_id}. The API requires explicit error handling for these states to ensure production pipelines can manage incomplete or unsuccessful generation tasks.