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.
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.
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
Need to restyle or modify an existing video clip? See Video Editing.
Remove backgrounds from subject reference stills first with Background Removal.
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.