Spiral gives your agent every tool with one account. Browse the tools →

opencode · Video

How to Use Grok Imagine Extend Video in opencode

Grok Imagine Extend Video adds a prompted continuation to an existing clip, useful for finishing an action or extending a camera move. It returns the original and continuation together, preserving the source proportions with output capped at 720p.

Prompts to try with Grok Imagine Extend Video in opencode

Copy an example into opencode, or ask in your own words.

Use Grok Imagine Extend Video on public/media/product.mp4 if it is 2 to 15 seconds long. Add 4 seconds in which the camera pulls back to show the full product, then holds.

Grok Imagine Extend Videoopencode
Try asking
  • Use Grok Imagine Extend Video to add 3 seconds to assets/character.mp4. Continue from the final pose: the character turns toward the doorway and pauses. Check that the source is 2 to 15 seconds long first.

  • Find the 8-second landscape clip in this project's media folder. Use Grok Imagine Extend Video to add 4 seconds of the existing camera movement, and save the result for review.

  • Use Grok Imagine Extend Video on the project's 6-second city shot. Make two separate 4-second continuations from that source: a slow pullback and a gentle pan to the right.

  • Use Grok Imagine Extend Video to extend assets/closing-shot.mp4 by 5 seconds, provided the source is 2 to 15 seconds long. Request gentle movement in the scene with a stationary camera, then make a preview around the join.

How to set up Grok Imagine Extend Video in opencode

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the server

    Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

    opencode mcp add spiral --global --url https://api.spiral.ai/mcp
  2. Sign in

    Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.

    opencode mcp auth spiral
  3. Check it

    Spiral shows as connected.

    opencode mcp list

Use the Spiral skill

  1. Send opencode this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Grok Imagine Extend Video

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "fal",
        "model": "xai/grok-imagine-video/extend-video",
        "input": {
          "prompt": "The camera slowly zooms out to reveal the city skyline at sunset",
          "video_url": "https://v3b.fal.media/files/b/0a8b9112/V5Z_NIPE3ppMDWivNo6_q_video_019.mp4"
        }
      }'

Then paste one of the prompts above: opencode finds Grok Imagine Extend Video on Spiral, shows the price and runs it.

Grok Imagine Extend Video providers and prices

Spiral runs Grok Imagine Extend Video through fal. Open a card for today's price, with every fee included.

falVideo
Grok Imagine Extend Video
xai/grok-imagine-video/extend-video

Settings you can ask for

Grok Imagine Extend Video works from your prompt and video URL. Ask opencode for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Duration2 to 106

Length of the extension in seconds.

Every API field of Grok Imagine Extend Video is on its tool page: open its card above.

What can you do with Grok Imagine Extend Video in opencode?

Extend project video assets with a requested next action or camera move. A coding agent can inspect clip lengths and prepare continuations for review alongside the project's existing media.

Finish a product reveal

Continue an existing product shot as the camera pulls back to show the full object. Request a short pause at the end for a closing edit.

Complete a character action

Extend an animated scene so a character can finish turning, sit down, or react to something already visible.

Add room for narration

Request a few more seconds of motion in an existing landscape shot, then place narration over the longer sequence in an editor.

Continue an establishing shot

Extend a camera move across a city, room, or landscape to give the location more screen time.

Try different story endings

Start each attempt from the same short clip and request a different next action. Compare the endings before choosing one for the edit.

Lengthen presentation footage

Continue an existing background clip with restrained motion to give a presentation's closing slide more time on screen.

Questions about Grok Imagine Extend Video in opencode

Can opencode use Grok Imagine Extend Video?

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Grok Imagine Extend Video like any built-in tool.

How much does Grok Imagine Extend Video cost in opencode?

$0.065 per second. Billed on `duration`, default 6. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

Do I need a fal account to use Grok Imagine Extend Video in opencode?

No. Spiral runs Grok Imagine Extend Video on its own fal account. You sign in to Spiral once and never paste a key.

How long does it take to set up Grok Imagine Extend Video in opencode?

About two minutes: add the server, then sign in, then check it.

Does opencode wait while Grok Imagine Extend Video runs?

Grok Imagine Extend Video runs in the background. opencode starts the run, checks on it and gives you the video when it's ready.

What is Grok Imagine Extend Video useful for?

Use it to add a next beat to an existing shot: finish a gesture, continue a camera move, or give a scene a longer ending. The continuation begins at the clip's last frame.

How long can the finished video be?

A source can be 2 to 15 seconds long, and an extension adds 2 to 10 seconds. A 15-second source with a 10-second extension produces a 25-second result.

Can Grok Imagine Extend Video produce 1080p output?

Output is capped at 720p. It otherwise follows the source video's resolution and proportions.

What should I put in the continuation prompt?

Describe what happens immediately after the final frame. For example, ask a walking subject to stop and turn, or ask the camera to continue pulling back.

Does the result include my original footage?

Yes. The result contains the original clip and the generated continuation stitched together.

Get started

Start using Grok Imagine Extend Video in opencode

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into opencode:

Set up opencode

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options