/9router-video
Generate videos via 9Router /v1/videos/generations using xAI Grok Imagine (grok-imagine-video). Async job flow - submit, poll request_id until done, download MP4. Use when the user wants to create, generate, or render a video, text-to-video (txt2vid), or image-to-video.
$ npx -y skills add decolua/9router --skill 9router-video --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/9router-video
Context preview
The summary Claude sees to decide when to auto-load this skill.
Generate videos via 9Router /v1/videos/generations using xAI Grok Imagine (grok-imagine-video). Async job flow - submit, poll request_id until done, download MP4. Use when the user wants to create, generate, or render a video, text-to-video (txt2vid), or image-to-video.
SKILL.md
9router-video.SKILL.mdname: 9router-video
description: Generate videos via 9Router /v1/videos/generations using xAI Grok Imagine (grok-imagine-video). Async job flow - submit, poll request_id until done, download MP4. Use when the user wants to create, generate, or render a video, text-to-video (txt2vid), or image-to-video.
9Router — Video Generation (xAI Grok Imagine)
Requires `NINEROUTER_URL` (and `NINEROUTER_KEY` if auth enabled). See https://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router/SKILL.md for setup.
Requires a connected **xAI account** in the 9Router dashboard — either **Grok Build OAuth** (SuperGrok / X Premium+ subscription sign-in) or a direct **xAI API key** from console.x.ai. The two are separate auth types with separate billing; the dashboard shows which one each connection uses.
Endpoints (async job flow)
Video generation is **asynchronous**: the POST returns a `request_id` immediately, then you poll until the job is `done` or `failed`.
| Endpoint | Purpose | |---|---| | `POST /v1/videos/generations` | text-to-video / image-to-video | | `POST /v1/videos/edits` | edit an existing video | | `POST /v1/videos/extensions` | extend an existing video | | `GET /v1/videos/{request_id}` | poll job status |
Request fields (passed through to xAI unchanged — see https://docs.x.ai/developers/rest-api-reference/inference/videos):
| Field | Required | Notes | |---|---|---| | `model` | no | `xai/grok-imagine-video` (prefix is stripped before upstream) | | `prompt` | yes for T2V | video description | | `duration` | no | seconds | | `aspect_ratio` | no | `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `3:2`, `2:3` | | `resolution` | no | `480p`, `720p`, `1080p` | | `image` | no | `{ "url": "https://… or data:image/…;base64,…" }` for image-to-video | | `video` | edits/extensions | `{ "url": "…mp4" }` or `{ "file_id": "…" }` |
Examples
Submit a job:
curl -X POST "$NINEROUTER_URL/v1/videos/generations" \
-H "Authorization: Bearer $NINEROUTER_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"xai/grok-imagine-video","prompt":"A cinematic tracking shot through a neon city at night","duration":8,"aspect_ratio":"16:9","resolution":"720p"}'
# → {"request_id":"abc123"} (response header x-9router-connection-id: <id>)Poll until done (echo the connection header back so the same account polls the job):
curl "$NINEROUTER_URL/v1/videos/abc123" \
-H "Authorization: Bearer $NINEROUTER_KEY" \
-H "x-connection-id: <id from create response>"
# → {"status":"pending","progress":42}
# → {"status":"done","video":{"url":"https://…mp4","duration":8},"model":"grok-imagine-video"}
# → {"status":"failed","error":{"code":"…","message":"…"}}Download: fetch `video.url` from the `done` response.
CLI one-shot
9router xai video \
--prompt "A cinematic tracking shot through a neon city at night" \
--output video.mp4
# options: --model --duration --aspect-ratio --resolution --image --timeout --port --api-key
Submits, polls with progress, downloads to `video.mp4.part`, atomically renames on success. Ctrl+C cancels cleanly; non-zero exit on failure.
Notes & limits
- Jobs are **account-bound** upstream: poll with the same connection that created the job (`x-connection-id` header, value from the create response's `x-9router-connection-id`).
- Creation POSTs are **never auto-retried** (a retry could create and bill two videos). Only a 401→token-refresh→single-retry is performed, which upstream rejects before job creation.
- Video models are tagged `kind: "video"` and are excluded from chat model lists and chat fallback combos.
- Grok Build **subscription OAuth** tokens are sent to the same `api.x.ai/v1/videos` endpoints as API keys; whether a given subscription tier includes video-generation quota is controlled by xAI and is not verified by 9Router — a `403`/`permission_denied` from upstream means the connected account has no video access.
Read more
name: 9router-video description: Generate videos via 9Router /v1/videos/generations using xAI Grok Imagine (grok-imagine-video). Async job flow - submit, poll request_id until done, download MP4. Use when the user wants to create, generate, or render a video, text-to-video (txt2vid), or image-to-video.
9Router — Video Generation (xAI Grok Imagine)
Requires `NINEROUTER_URL` (and `NINEROUTER_KEY` if auth enabled). See https://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router/SKILL.md for setup.
Requires a connected **xAI account** in the 9Router dashboard — either **Grok Build OAuth** (SuperGrok / X Premium+ subscription sign-in) or a direct **xAI API key** from console.x.ai. The two are separate auth types with separate billing; the dashboard shows which one each connection uses.
Endpoints (async job flow)
Video generation is **asynchronous**: the POST returns a `request_id` immediately, then you poll until the job is `done` or `failed`.
| Endpoint | Purpose | |---|---| | `POST /v1/videos/generations` | text-to-video / image-to-video | | `POST /v1/videos/edits` | edit an existing video | | `POST /v1/videos/extensions` | extend an existing video | | `GET /v1/videos/{request_id}` | poll job status |
Request fields (passed through to xAI unchanged — see https://docs.x.ai/developers/rest-api-reference/inference/videos):
| Field | Required | Notes | |---|---|---| | `model` | no | `xai/grok-imagine-video` (prefix is stripped before upstream) | | `prompt` | yes for T2V | video description | | `duration` | no | seconds | | `aspect_ratio` | no | `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `3:2`, `2:3` | | `resolution` | no | `480p`, `720p`, `1080p` | | `image` | no | `{ "url": "https://… or data:image/…;base64,…" }` for image-to-video | | `video` | edits/extensions | `{ "url": "…mp4" }` or `{ "file_id": "…" }` |
Examples
Submit a job:
curl -X POST "$NINEROUTER_URL/v1/videos/generations" \
-H "Authorization: Bearer $NINEROUTER_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"xai/grok-imagine-video","prompt":"A cinematic tracking shot through a neon city at night","duration":8,"aspect_ratio":"16:9","resolution":"720p"}'
# → {"request_id":"abc123"} (response header x-9router-connection-id: <id>)Poll until done (echo the connection header back so the same account polls the job):
curl "$NINEROUTER_URL/v1/videos/abc123" \
-H "Authorization: Bearer $NINEROUTER_KEY" \
-H "x-connection-id: <id from create response>"
# → {"status":"pending","progress":42}
# → {"status":"done","video":{"url":"https://…mp4","duration":8},"model":"grok-imagine-video"}
# → {"status":"failed","error":{"code":"…","message":"…"}}Download: fetch `video.url` from the `done` response.
CLI one-shot
9router xai video \ --prompt "A cinematic tracking shot through a neon city at night" \ --output video.mp4 # options: --model --duration --aspect-ratio --resolution --image --timeout --port --api-key
Submits, polls with progress, downloads to `video.mp4.part`, atomically renames on success. Ctrl+C cancels cleanly; non-zero exit on failure.
Notes & limits
- Jobs are **account-bound** upstream: poll with the same connection that created the job (`x-connection-id` header, value from the create response's `x-9router-connection-id`).
- Creation POSTs are **never auto-retried** (a retry could create and bill two videos). Only a 401→token-refresh→single-retry is performed, which upstream rejects before job creation.
- Video models are tagged `kind: "video"` and are excluded from chat model lists and chat fallback combos.
- Grok Build **subscription OAuth** tokens are sent to the same `api.x.ai/v1/videos` endpoints as API keys; whether a given subscription tier includes video-generation quota is controlled by xAI and is not verified by 9Router — a `403`/`permission_denied` from upstream means the connected account has no video access.
Never stop coding. Save 20-40% tokens with RTK + auto-fallback to FREE & cheap AI models. Connect All AI Code Tools (Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini, OpenCode, Cline, OpenClaw...) to 40+ AI Providers & 100+ Models.
Repo: decolua/9router
Other skills on 9router.
- /9router-chat
Chat / code generation via 9Router using OpenAI /v1/chat/completions or Anthropic /v1/messages format with streaming + auto-fallback combos. Use when the user wants to ask an LLM, generate code, summarize text, or run prompts through 9Router.
Open skill - /9router-embeddings
Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.
Open skill - /9router-image
Generate images via 9Router /v1/images/generations using OpenAI / Gemini Imagen / DALL-E / FLUX / MiniMax / SDWebUI / ComfyUI / Codex models. Use when the user wants to create, generate, draw, or render an image, picture, or text-to-image (txt2img).
Open skill - /9router-stt
Speech-to-text via 9Router /v1/audio/transcriptions using OpenAI Whisper / Groq / Gemini / Deepgram / AssemblyAI / NVIDIA / HuggingFace models. Use when the user wants to transcribe audio, convert speech to text, or get subtitles from audio files.
Open skill - /9router-tts
Text-to-speech via 9Router /v1/audio/speech using OpenAI / ElevenLabs / Deepgram / Edge TTS / Google TTS / Hyperbolic / Inworld voices. Use when the user wants to convert text to speech, generate audio, voiceover, narrate, or read text aloud.
Open skill - /9router-web-fetch
Fetch URL → markdown / text / HTML via 9Router /v1/web/fetch using Firecrawl / Jina Reader / Tavily Extract / Exa Contents. Use when the user wants to scrape a webpage, extract URL content, read article, or convert a URL to markdown.
Open skill

