# Send Grok Imagine Video Generation to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "grok-imagine-video",
    "name": "Grok Imagine Video Generation",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/DevvGwardo/grok-imagine-video",
    "canonicalUrl": "https://clawhub.ai/DevvGwardo/grok-imagine-video",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/grok-imagine-video",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=grok-imagine-video",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "CHANGELOG.md",
      "README.md",
      "references/api_reference.md",
      "scripts/grok_video_api.py",
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/grok-imagine-video"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/grok-imagine-video",
    "downloadUrl": "https://openagent3.xyz/downloads/grok-imagine-video",
    "agentUrl": "https://openagent3.xyz/skills/grok-imagine-video/agent",
    "manifestUrl": "https://openagent3.xyz/skills/grok-imagine-video/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/grok-imagine-video/agent.md"
  }
}
```
## Documentation

### Grok Imagine Video

Generate videos using xAI's Grok Imagine API directly from your messaging interface.

### Setup

Important: You need your own xAI API key. Get it from https://console.x.ai/

For full installation instructions, see README.md

Quick setup:

# Set your xAI API key (YOUR key, not pre-configured)
export XAI_API_KEY="your-api-key-here"

### Capabilities

Text-to-image: Generate images from text descriptions (up to 10 variations)
Image editing: Modify images using natural language
Text-to-video: Create videos from text descriptions
Image-to-video: Animate static images into motion
Video editing: Modify videos using natural language
Async generation: Handles long-running video jobs with polling
Auto-delivery: Downloads and delivers images/videos via chat

### 1. Image Generation

User says: "Create an image of a cyberpunk cityscape at night"

python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))
result = client.generate_image("A cyberpunk cityscape at night, neon lights reflecting on wet streets")
print(f"Image URL: {result}")
EOF

Images are generated instantly (no polling needed). Download promptly as URLs are temporary.

### 1b. Image Editing

User says: "Edit this image — make it look like a watercolor"

python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))
result = client.edit_image(
    image_url="https://example.com/photo.jpg",
    prompt="Make it look like a watercolor painting"
)
print(f"Edited image: {result}")
EOF

### 2. Text-to-Video

User says: "Generate a video of a sunset over the ocean"

# Use the Python client
python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))
result = client.text_to_video("A beautiful sunset over the ocean", duration=10)
print(f"Job started: {result['job_id']}")
EOF

### 3. Wait for Video Completion

Video generation takes 1-3 minutes. Poll with progress:

python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))

def progress(response):
    print(f"Polling... {'Done!' if 'video' in response else 'Pending'}")

final = client.wait_for_completion("request-id-here", progress_callback=progress)
print(f"Video ready: {final['video']['url']}")
EOF

### 4. Download and Deliver

Download the completed video to the workspace:

python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))
output = "/data/workspace/videos/sunset.mp4"
client.download_video(final, output)  # pass the full response dict
print(f"Downloaded: {output}")
EOF

### Image-to-Video

Animate an image:

from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(api_key)
result = client.image_to_video(
    image_url="https://example.com/photo.jpg",
    prompt="Make the clouds move slowly",
    duration=10
)

### Video Editing

Edit an existing video:

result = client.edit_video(
    video_url="https://example.com/source.mp4",
    edit_prompt="Add a warm sunset filter and slow down to 50% speed"
)

### Configuration

Important: Get your own API key from https://console.x.ai/ - do NOT use pre-configured keys.

export XAI_API_KEY="sk-..."

For OpenClaw integration, add to workspace .env or manage via gateway config.

See README.md for complete setup instructions.

### Error Handling

Common errors and responses:

Unauthorized / API key not set: → Get your key from https://console.x.ai/ and set export XAI_API_KEY="your-key" - See README.md for details
Rate limit: "Too many requests" → Wait and retry
Content policy: "Prompt violates content policies" → Rephrase prompt
Timeout: Job took too long → Reduce duration or complexity

Always wrap API calls in try/except and provide user-friendly messages.

### Best Practices

Prompt engineering (images):

Be descriptive: "A collage of London landmarks in a stenciled street-art style"
Specify style: "Watercolor painting of a mountain lake at dawn"
Use multiple variations (n=4) to explore interpretations

Prompt engineering (videos):

Be specific: "A golden retriever running through a sunny meadow"
Include camera movement: "Slow pan from left to right"
Specify lighting: "Warm golden hour lighting"

Performance:

Images generate instantly — no polling needed
Use 480p for faster video generation, 720p for higher quality
Keep videos under 10 seconds unless essential
Start with text-to-video, then edit if needed

User experience:

Images: deliver immediately after generation
Videos: send progress updates: "Generating video... 45% complete"
Estimate time for videos: "This takes about 2-3 minutes"
Confirm delivery: "Here's your image/video!"

### Limits

Images per request: 1-10
Video duration: 1-15 seconds
Video resolution: 480p (default) or 720p
Rate limit: 60 requests/minute
Max concurrent jobs: 15

See references/api_reference.md for full API documentation.

### Integration with Other Skills

Combine with ffmpeg-video-editor for post-processing (trimming, concatenation, filters)
Use fal-ai for additional video effects
Integrate with image-generation skills for source images

### Troubleshooting

Job stuck in "pending": Check API key and quota

Video generation slow: Try 720p instead of 1080p

Failed jobs: Check error_code in response; see API reference

Download errors: Verify video_url is accessible and has not expired
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: DevvGwardo
- Version: 1.0.4
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/grok-imagine-video)
- [Send to Agent page](https://openagent3.xyz/skills/grok-imagine-video/agent)
- [JSON manifest](https://openagent3.xyz/skills/grok-imagine-video/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/grok-imagine-video/agent.md)
- [Download page](https://openagent3.xyz/downloads/grok-imagine-video)