Browse all docs & guides
On this page
OPERATION & PLATFORM GUIDE

Edit videos with source clips and references

OpenGen video-edit modifies an existing workspace-private clip via input.sourceVideo (uploaded up to 100 MiB or reused from an owned prior job output) or top-level previousJobId. Inspect each model's exact override restrictions with GET /v1/models/{provider}/{model}?operation=video-edit because models like FLUX 3 Video preserve source duration and dimensions, estimate cost with POST /v1/pricing/estimate, and submit once with a persisted Idempotency-Key.

operation: video-editReviewed 2026-12-02
AGENT PROMPT · PASTE INTO YOUR AGENT OR AUTO-READ
Walk me through a video-edit generation on OpenGen (https://opengen.dev):
1. Discover models supporting video-edit via GET https://opengen.dev/v1/models?operation=video-edit (or MCP find_models with operation="video-edit").
2. Inspect the exact model via GET https://opengen.dev/v1/models/{provider}/{model}?operation=video-edit (or MCP get_model, e.g. id="bfl/flux-3-video" or "xai/grok-imagine-video", operation="video-edit") to check which override fields (duration, resolution, aspectRatio, audio) are forbidden vs allowed.
3. Upload the source MP4/WebM via POST https://opengen.dev/v1/assets (presigned PUT up to 100 MiB) or reuse an owned OpenGen video output via POST https://opengen.dev/v1/assets with source="job_output" (or pass top-level previousJobId when supported).
4. Run POST https://opengen.dev/v1/pricing/estimate (or MCP estimate_cost) and wait for my confirmation of the selected route and maxCostMicros spend ceiling.
5. Submit once with a persisted Idempotency-Key via POST https://opengen.dev/v1/generations or MCP generate, and follow read-only via job_get until delivered.
View raw .md ↗

OpenGen video-edit transforms an existing private video clip (input.sourceVideo) or continues a prior owned generation (previousJobId) with prompt-guided lighting, weather, object, or style edits. Because providers enforce very different override rules on video editing, OpenGen validates every field before admission instead of silently discarding unsupported parameters.

1. Check per-model video-edit constraints

ModelRoute(s) & verification scopeRequired sourceForbidden / restricted fields on video-edit
FLUX 3 Video (bfl/flux-3-video)bfl-undisclosed/bfl-flux-3-video (active BFL adapter; live-verified for text-to-video 720p/5s, video-edit remains documented)sourceVideo or previousJobIdPreserves source clip length (up to 15s), dimensions (downscales >720p to 720p), and audio; duration, resolution, aspectRatio, and audio are rejected. Published tariff: $0.03/s.
Grok Imagine Video (xai/grok-imagine-video)xai-undisclosed/xai-grok-imagine-video (live-verified for video-edit at 720p/3s; other durations/resolutions remain documented)sourceVideo or previousJobIdPreserves source clip duration (duration is rejected); accepts resolution (480p/720p), aspectRatio, audio, and up to 7 image references.
Kling 4.0 (kling/kling-4.0)kling-ap-southeast-1/kling-kling-4.0, runway-undisclosed/kling-kling-4.0 (live-verified for text-to-video 720p/3s; video-edit is documented)sourceVideo or previousJobIdAccepts prompt (required), duration, resolution, references, and elements; audio is always on.
Gemini Omni 1.2 Flash (google/gemini-omni-1.2-flash)Documented routessourceVideo or previousJobIdSupports stateful previousJobId continuation pinned to the originating deployment and model version.
curl --fail-with-body \
  "https://opengen.dev/v1/models?operation=video-edit"

curl --fail-with-body \
  "https://opengen.dev/v1/models/bfl/flux-3-video?operation=video-edit"

2. Upload a private MP4/WebM or reuse a prior OpenGen video output

For local video clips (up to 100 MiB MP4 or WebM), use the presigned single-PUT flow (POST /v1/assets -> storage PUT -> POST /v1/assets/complete). If the clip was generated by an earlier OpenGen job in the same workspace, skip re-uploading completely and copy it server-side with source: "job_output":

# Reuse a completed OpenGen video output as an independent ready input asset
curl --fail-with-body \
  -X POST "https://opengen.dev/v1/assets" \
  -H "Authorization: Bearer $OPENGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reuse-vid-$(uuidgen | tr '[:upper:]' '[:lower:]')" \
  --data '{
    "source": "job_output",
    "sourceJobId": "550e8400-e29b-41d4-a716-446655440000",
    "outputIndex": 0
  }'

3. Estimate route eligibility before submitting

Notice that bfl/flux-3-video on video-edit accepts only prompt and sourceVideo (plus optional count).

set -eu
umask 077
if [ -e video-edit-submission.key ]; then
  echo "Existing video-edit-submission.key found; recover read-only via GET /v1/generations/lookup before replacing video-edit-request.json." >&2
  exit 1
fi
rm -f video-edit-request.json
cat <<'JSON' > video-edit-request.json
{
  "modelId": "bfl/flux-3-video",
  "operation": "video-edit",
  "input": {
    "prompt": "Change the overcast sky to warm golden-hour sunlight and add gentle reflections on the wet pavement.",
    "sourceVideo": {
      "assetKey": "inputs/YOUR_WORKSPACE/RETURNED_VIDEO_UUID.mp4"
    }
  },
  "routeId": "bfl-undisclosed/bfl-flux-3-video",
  "billing": "byok"
}
JSON
chmod 600 video-edit-request.json

# Dry-run estimate only (review selectedRouteId and workspaceEligibility before submitting)
curl --fail-with-body \
  -X POST "https://opengen.dev/v1/pricing/estimate" \
  -H "Authorization: Bearer $OPENGEN_API_KEY" \
  -H "Content-Type: application/json" \
  --data @video-edit-request.json

Submit once after reviewing the estimate

Run this step only after reviewing the estimate output above and confirming selectedRouteId, workspaceEligibility, and your BYOK billing payer.

set -eu
umask 077
if [ -e video-edit-submission.key ]; then
  echo "Existing video-edit-submission.key found; recover read-only via GET /v1/generations/lookup before creating a new submission." >&2
  exit 1
fi
RAW_UUID="$(uuidgen)"
[ -n "$RAW_UUID" ] || { echo "uuidgen failed" >&2; exit 1; }
IDEMPOTENCY_KEY="vedit-$(printf '%s' "$RAW_UUID" | tr '[:upper:]' '[:lower:]')"
(set -C; printf '%s\n' "$IDEMPOTENCY_KEY" > video-edit-submission.key)

curl --fail-with-body \
  -X POST "https://opengen.dev/v1/generations" \
  -H "Authorization: Bearer $OPENGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  --data @video-edit-request.json > video-edit-receipt.json

Reference-guided editing on Grok Imagine Video

If you want to specify target resolution (480p or 720p) or supply reference images alongside sourceVideo, use Grok Imagine Video (xai/grok-imagine-video, omitting duration, with "billing": "byok" since managed video-edit quotes are comparison-only):

JSON
{
  "modelId": "xai/grok-imagine-video",
  "operation": "video-edit",
  "input": {
    "prompt": "Swap the jacket in the clip to the emerald wool coat shown in the reference image.",
    "sourceVideo": {
      "assetKey": "inputs/YOUR_WORKSPACE/RETURNED_VIDEO_UUID.mp4"
    },
    "references": [
      {
        "type": "image",
        "asset": {
          "assetKey": "inputs/YOUR_WORKSPACE/COAT_REF_UUID.png"
        }
      }
    ],
    "resolution": "720p",
    "aspectRatio": "source"
  },
  "routeId": "xai-undisclosed/xai-grok-imagine-video",
  "billing": "byok"
}

4. Poll and verify delivered output

Poll GET /v1/generations/{id}/status?waitMs=25000 (or MCP job_get) until deliveryStatus: "available", then download privately via GET /v1/generations/{id}. Recover any interrupted submission read-only via GET /v1/generations/lookup?idempotencyKey=$IDEMPOTENCY_KEY.

Next steps

  • Need to add new footage to the end of a clip instead of editing existing frames? See Video Extension.
  • Learn how input pins protect tombstoned source videos during active jobs in Owned Assets.

Supported Models

Live catalog inventory for video-edit (11 documented variants). Click any model to compare exact regional routes, privacy disclosures, and source-linked tariffs, or inspect its canonical schema directly via the single-call model endpoint.

ModelCreatorRoutesLowest published priceSingle-call API
alibaba/wan-3.0
Alibaba6 routes$0.041256 / secGET /v1/models/alibaba/wan-3.0?operation=video-edit
alibaba/wan-3.0-prime
Alibaba6 routes$0.0636 / secGET /v1/models/alibaba/wan-3.0-prime?operation=video-edit
xAI4 routes$0.05 / secGET /v1/models/xai/grok-imagine-video?operation=video-edit
kling/kling-4.0
Kling AI3 routes$0.157 / secGET /v1/models/kling/kling-4.0?operation=video-edit
kling/kling-4.0-flash
Kling AI3 routes$0.094 / secGET /v1/models/kling/kling-4.0-flash?operation=video-edit
bfl/flux-3-video
Black Forest Labs2 routes$0.03 / secGET /v1/models/bfl/flux-3-video?operation=video-edit
google/gemini-omni-1.1-flash
Google5 routes$0.03 / secGET /v1/models/google/gemini-omni-1.1-flash?operation=video-edit
google/gemini-omni-1.2-flash
Google3 routes$0.02 / secGET /v1/models/google/gemini-omni-1.2-flash?operation=video-edit
bytedance/seedance-2.5
ByteDance1 route$0.20 / secGET /v1/models/bytedance/seedance-2.5?operation=video-edit
bytedance/seedance-2.5-flash
ByteDance1 route$0.13 / secGET /v1/models/bytedance/seedance-2.5-flash?operation=video-edit
MiniMax H3Open weights
minimax/h3
MiniMax1 route$0.08 / secGET /v1/models/minimax/h3?operation=video-edit