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

Keep subjects consistent with reference-to-video

OpenGen reference-to-video preserves characters, products, and style across 20 video models using typed input.references entries and structured Kling elements. Upload private reference media via POST /v1/assets, inspect per-type reference limits via GET /v1/models/{provider}/{model}?operation=reference-to-video, confirm pricing with POST /v1/pricing/estimate, and submit once with a persisted Idempotency-Key without mixing incompatible frame modes.

operation: reference-to-videoReviewed 2026-12-02
AGENT PROMPT · PASTE INTO YOUR AGENT OR AUTO-READ
Walk me through a reference-to-video generation on OpenGen (https://opengen.dev):
1. Discover models supporting reference-to-video via GET https://opengen.dev/v1/models?operation=reference-to-video (or MCP find_models with operation="reference-to-video"; filter by inputRole="references.image", "references.video", "references.audio", or "elements" as needed).
2. Inspect the exact chosen model via GET https://opengen.dev/v1/models/{provider}/{model}?operation=reference-to-video (or MCP get_model, e.g. id="alibaba/happy-horse-1.1", operation="reference-to-video") to verify per-type reference caps, resolution limits, and published pricing.
3. Upload each private reference file via POST https://opengen.dev/v1/assets (or MCP upload_asset) and confirm state="ready".
4. Run POST https://opengen.dev/v1/pricing/estimate (or MCP estimate_cost) and obtain my explicit confirmation of the route and maxCostMicros spend cap.
5. Submit once with a persisted Idempotency-Key via POST https://opengen.dev/v1/generations or MCP generate, then follow via job_get(id, afterRevision, waitMs=25000) without blind resubmission.
View raw .md ↗

OpenGen reference-to-video conditions video generation on one or more workspace-private subject images, reference videos, audio clips, or structured elements so characters and products stay consistent across camera moves.

1. Pick a model for your reference types and caps

Every model enforces exact reference media types, counts, and resolution limits:

  • HappyHorse 1.1 (alibaba/happy-horse-1.1): active official routes across Alibaba Model Studio Singapore (alibaba-model-studio-ap-southeast-1/alibaba-happy-horse-1.1), Tokyo (ap-northeast-1), and Virginia (us-east-1)—each live-verified for text-to-video at 480p / 3s, while reference-to-video remains documented. Supports up to 9 image references, 3–15 seconds, 480p/720p/1080p, and always-on synchronized audio.
  • Kling 4.0 (kling/kling-4.0): active official route on kling-ap-southeast-1/kling-kling-4.0 (live-verified for text-to-video at 720p / 3s; reference-to-video remains documented), supporting up to 10 images, 5 videos, and 3 audio clips (15 total) plus structured elements (id, description, images or video, optional voice).
  • Seedance 2.5 (bytedance/seedance-2.5): up to 30 images, 10 videos, and 10 audio clips (50 combined), 4–30 seconds, 480p–1080p.
  • Wan 3.0 (alibaba/wan-3.0): active Singapore route alibaba/ap-southeast-1/wan-3.0 (live-verified for text-to-video and image-to-video at 480p / 2s; reference-to-video remains documented), up to 10 images, 5 videos, 5 audio clips, and 1 document reference.
curl --fail-with-body \
  "https://opengen.dev/v1/models?operation=reference-to-video&inputRole=references.image"

curl --fail-with-body \
  "https://opengen.dev/v1/models/alibaba/happy-horse-1.1?operation=reference-to-video"

2. Upload your private reference assets

Upload each reference image, video, or audio clip privately via POST /v1/assets and verify every returned asset reports state: "ready".

curl --fail-with-body \
  -X POST "https://opengen.dev/v1/assets" \
  -H "Authorization: Bearer $OPENGEN_API_KEY" \
  -H "Idempotency-Key: ref-front-$(uuidgen | tr '[:upper:]' '[:lower:]')" \
  -F "file=@./character-front.png;type=image/png"

curl --fail-with-body \
  -X POST "https://opengen.dev/v1/assets" \
  -H "Authorization: Bearer $OPENGEN_API_KEY" \
  -H "Idempotency-Key: ref-side-$(uuidgen | tr '[:upper:]' '[:lower:]')" \
  -F "file=@./character-side.png;type=image/png"

3. Estimate route eligibility before submitting

Order your uploaded references inside input.references, run POST /v1/pricing/estimate, and review route eligibility before submitting.

set -eu
umask 077
if [ -e r2v-submission.key ]; then
  echo "Existing r2v-submission.key found; recover read-only via GET /v1/generations/lookup before replacing r2v-request.json." >&2
  exit 1
fi
rm -f r2v-request.json
cat <<'JSON' > r2v-request.json
{
  "modelId": "alibaba/happy-horse-1.1",
  "operation": "reference-to-video",
  "input": {
    "prompt": "The ceramic character from the reference images walks across a sunlit studio workbench and picks up a brass wrench, steady medium shot.",
    "references": [
      {
        "type": "image",
        "asset": {
          "assetKey": "inputs/YOUR_WORKSPACE/CHARACTER_FRONT_UUID.png"
        }
      },
      {
        "type": "image",
        "asset": {
          "assetKey": "inputs/YOUR_WORKSPACE/CHARACTER_SIDE_UUID.png"
        }
      }
    ],
    "duration": 5,
    "resolution": "720p",
    "aspectRatio": "16:9",
    "audio": true
  },
  "routeId": "alibaba-model-studio-ap-southeast-1/alibaba-happy-horse-1.1",
  "billing": "byok"
}
JSON
chmod 600 r2v-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 @r2v-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 r2v-submission.key ]; then
  echo "Existing r2v-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="r2v-$(printf '%s' "$RAW_UUID" | tr '[:upper:]' '[:lower:]')"
(set -C; printf '%s\n' "$IDEMPOTENCY_KEY" > r2v-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 @r2v-request.json > r2v-receipt.json

Structured subject elements on Kling 4.0

On Kling 4.0 (kling/kling-4.0), you can group multi-angle images (or a reference video) under named input.elements entries so the prompt can address each subject explicitly (using "billing": "byok" while managed reference-to-video quotes on kling-ap-southeast-1/kling-kling-4.0 remain comparison-only):

JSON
{
  "modelId": "kling/kling-4.0",
  "operation": "reference-to-video",
  "input": {
    "prompt": "Hero_Robot walks across the greenhouse and adjusts a hanging lantern while rain taps on the glass roof.",
    "elements": [
      {
        "id": "Hero_Robot",
        "description": "Small brushed-aluminum workshop robot with amber optics",
        "images": [
          { "assetKey": "inputs/YOUR_WORKSPACE/CHARACTER_FRONT_UUID.png" },
          { "assetKey": "inputs/YOUR_WORKSPACE/CHARACTER_SIDE_UUID.png" }
        ]
      }
    ],
    "duration": 5,
    "resolution": "720p",
    "aspectRatio": "16:9",
    "audio": true
  },
  "routeId": "kling-ap-southeast-1/kling-kling-4.0",
  "billing": "byok"
}

4. Follow progress and retrieve privately

Poll GET /v1/generations/{id}/status?waitMs=25000 (or GET /v1/generations/{id}/events SSE / MCP job_get) until deliveryStatus: "available", then download your private MP4 from the signed /media/... URL returned by GET /v1/generations/{id}.

Next steps

Supported Models

Live catalog inventory for reference-to-video (19 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
Alibaba8 routes$0.0325 / secGET /v1/models/alibaba/wan-3.0?operation=reference-to-video
alibaba/wan-3.0-prime
Alibaba8 routes$0.051 / secGET /v1/models/alibaba/wan-3.0-prime?operation=reference-to-video
alibaba/happy-horse-1.1
Alibaba6 routes$0.061885 / secGET /v1/models/alibaba/happy-horse-1.1?operation=reference-to-video
kling/kling-4.0
Kling AI4 routes$0.157 / secGET /v1/models/kling/kling-4.0?operation=reference-to-video
kling/kling-4.0-flash
Kling AI2 routes$0.094 / secGET /v1/models/kling/kling-4.0-flash?operation=reference-to-video
H3 Flex · PikaOpen weights
pika/h3-flex
Pika1 route$0.03 / secGET /v1/models/pika/h3-flex?operation=reference-to-video
bytedance/seedance-2.0
ByteDance6 routes≈$0.07 / secGET /v1/models/bytedance/seedance-2.0?operation=reference-to-video
bytedance/seedance-2.0-fast
ByteDance5 routes≈$0.0591 / secGET /v1/models/bytedance/seedance-2.0-fast?operation=reference-to-video
bytedance/seedance-2.0-mini
ByteDance5 routes≈$0.0369 / secGET /v1/models/bytedance/seedance-2.0-mini?operation=reference-to-video
bytedance/seedance-2.5
ByteDance5 routes$0.1028 / secGET /v1/models/bytedance/seedance-2.5?operation=reference-to-video
google/gemini-omni-1.1-flash
Google5 routes$0.03 / secGET /v1/models/google/gemini-omni-1.1-flash?operation=reference-to-video
MiniMax H3Open weights
minimax/h3
MiniMax5 routes$0.05 / secGET /v1/models/minimax/h3?operation=reference-to-video
bytedance/seedance-2.5-flash
ByteDance4 routes≈$0.07 / secGET /v1/models/bytedance/seedance-2.5-flash?operation=reference-to-video
google/gemini-omni-1.2-flash
Google3 routes$0.02 / secGET /v1/models/google/gemini-omni-1.2-flash?operation=reference-to-video
xai/grok-imagine-video-1.5
xAI3 routes$0.08 / secGET /v1/models/xai/grok-imagine-video-1.5?operation=reference-to-video
minimax/h3-highspeed
MiniMax2 routes$0.03 / secGET /v1/models/minimax/h3-highspeed?operation=reference-to-video
minimax/h3-lite
MiniMax2 routes$0.0125 / secGET /v1/models/minimax/h3-lite?operation=reference-to-video
minimax/h3-max
MiniMax2 routes$0.05 / secGET /v1/models/minimax/h3-max?operation=reference-to-video
fal/h3-max-turbo
fal1 route$0.05 / secGET /v1/models/fal/h3-max-turbo?operation=reference-to-video