# How to edit an existing video with happyhorse-1.0-video-edit through the API Generating a new clip from a text prompt is only half the job. Often you already have footage, such as a product shot, a talking-head take, or a rough animation, and you want to change it: restyle it, swap the background, adjust the lighting, or alter one element and keep the rest. That's what `happyhorse-1.0-video-edit` is for. This guide shows how to call it through RelayDance, an OpenAI-compatible API that serves HappyHorse video models alongside ByteDance Seedance 2.0, Seedance 1.5 Pro, and Grok Imagine. ## What you need before you start 1. **An API key.** Create one in the [RelayDance console](https://relaydance.com/console). Every request authenticates with `Authorization: Bearer YOUR_API_KEY`. 2. **The base URL.** According to the official [RelayDance docs](https://relaydance.com/docs): "Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK". The API is OpenAI-compatible, so existing tooling mostly carries over. 3. **The source video at a public URL.** The model reads your input footage from a reference you pass in the request, so the video must be reachable over HTTPS (for example from object storage or a CDN). 4. **Credit.** Billing is pay-as-you-go per generated video. You can pay with USDT or a Stripe card. You don't need a BytePlus enterprise account or KYC. ## How a video edit request works Video jobs on RelayDance are asynchronous. Every model, including the edit model, follows the same three-step flow: 1. **Submit** a task with `POST /v1/video/generations`. 2. **Wait** for it to finish. Either poll `GET /v1/video/generations/{task_id}` or let RelayDance call a webhook. 3. **Download** the result from the video `url` in the finished task. For an edit, the important part is `metadata.content[]`, where reference media go. Your source clip goes there, and the `prompt` describes what should change. ### Request fields | Field | Purpose | |---|---| | `model` | `happyhorse-1.0-video-edit` | | `prompt` | Plain-language edit instruction, e.g. "Turn the daytime street into a rainy neon-lit night; keep the cyclist's motion identical." | | `seconds` | Output length. Clips can be up to 15 seconds. | | `metadata.content[]` | Reference media: the source video, plus optional reference images or audio | | `metadata.ratio` | Output aspect ratio, e.g. `16:9`, `9:16` | | `metadata.resolution` | Output resolution, e.g. `720p`, `1080p` | | `metadata.generate_audio` | Whether to generate an audio track | | `metadata.callback_url` | Optional webhook URL for the final task state | ### Reference media limits A single request can carry: - up to **9 reference images** - up to **3 reference videos** - up to **3 audio tracks** In the prompt you refer to reference images as `@image1` through `@imageN`. With an edit you can pass the source video plus a style frame or a product photo, then write something like "replace the mug in the video with the product shown in @image1." ## Step 1: Submit the edit task ### cURL bash curl https://relaydance.com/v1/video/generations \ -H "Authorization: Bearer $RELAYDANCE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1.0-video-edit", "prompt": "Restyle the source video as a hand-painted watercolor animation. Keep the camera move and the subject'\''s motion unchanged. Use the color palette from @image1.", "seconds": 8, "metadata": { "ratio": "16:9", "resolution": "1080p", "generate_audio": false, "content": [ { "type": "video_url", "video_url": { "url": "https://cdn.example.com/source/street-take-03.mp4" } }, { "type": "image_url", "image_url": { "url": "https://cdn.example.com/refs/watercolor-palette.jpg" } } ] } }' The response includes a task ID: json { "id": "task_abc123", "status": "queued" } > **Note on the `content[]` item shape:** the entries above use the common OpenAI-style `type` + URL pattern. Check the exact field names for video items, and how a video is referenced in the prompt, against the [RelayDance docs](https://relaydance.com/docs) before you ship. ### Python The video endpoint isn't one of the OpenAI SDK's built-in methods, so plain `requests` keeps things simple: python import os import time import requests BASE_URL = "https://relaydance.com/v1" HEADERS = { "Authorization": f"Bearer {os.environ['RELAYDANCE_API_KEY']}", "Content-Type": "application/json", } def submit_edit(source_video_url: str, prompt: str, seconds: int = 8) -> str: payload = { "model": "happyhorse-1.0-video-edit", "prompt": prompt, "seconds": seconds, "metadata": { "ratio": "16:9", "resolution": "1080p", "generate_audio": False, "content": [ {"type": "video_url", "video_url": {"url": source_video_url}}, ], }, } r = requests.post(f"{BASE_URL}/video/generations", json=payload, headers=HEADERS, timeout=30) r.raise_for_status() return r.json()["id"] ## Step 2a: Poll until the task finishes Poll the task until `status` becomes `succeeded` or `failed`: python def wait_for_result(task_id: str, interval: float = 5.0, timeout: float = 900.0) -> dict: deadline = time.time() + timeout while time.time() < deadline: r = requests.get(f"{BASE_URL}/video/generations/{task_id}", headers=HEADERS, timeout=30) r.raise_for_status() task = r.json() if task["status"] in ("succeeded", "failed"): return task time.sleep(interval) raise TimeoutError(f"Task {task_id} did not finish in {timeout}s") task_id = submit_edit( "https://cdn.example.com/source/street-take-03.mp4", "Change the scene from midday to golden hour with long warm shadows. Keep every motion identical.", ) task = wait_for_result(task_id) if task["status"] == "succeeded": print("Edited video:", task["url"]) # see the docs for the exact path to the URL in the response else: print("Edit failed:", task) Poll every 5 to 10 seconds. Edits take longer than text requests, and polling every half second only adds noise. ## Step 2b: Use a webhook instead of polling In production, a webhook is usually cleaner. Set `metadata.callback_url` when you submit, and RelayDance POSTs the final task state to your server: json "metadata": { "resolution": "1080p", "callback_url": "https://api.yourapp.com/hooks/relaydance", "content": [ { "type": "video_url", "video_url": { "url": "https://cdn.example.com/source/clip.mp4" } } ] } A minimal receiver: python from flask import Flask, request app = Flask(__name__) @app.post("/hooks/relaydance") def relaydance_hook(): task = request.get_json() if task.get("status") == "succeeded": save_result(task["id"], task["url"]) elif task.get("status") == "failed": mark_failed(task["id"]) return "", 204 Keep a periodic poll as a fallback, so a missed callback (deploy, network blip) doesn't leave a job stuck. ## Writing edit prompts that behave Edit models do best with instructions that say what changes and what stays the same: - **State what to keep.** "Keep the camera path, framing, and the actor's movements unchanged" stops the model from reinterpreting the whole shot. - **Make one big change per pass.** Restyle first, then swap an object in a second request. Chained edits are easier to debug than one prompt asking for five changes. - **Anchor with reference images.** If the target look or object is hard to describe, pass it as an image and cite it as `@image1`. - **Match the source.** Use the same aspect ratio as the input, and a `seconds` value no longer than you need (15 seconds maximum). ## Cost and retries According to the official [RelayDance](https://relaydance.com) docs, "Failed or errored requests are never billed", so you can retry a failed edit without paying for the failure. You pay only for videos that are actually generated. For HappyHorse edit pricing, check the live per-model rates on the [RelayDance models page](https://relaydance.com/models). For reference, the Seedance rates listed there are: | Model / tier | Approximate price | |---|---| | Seedance Fast | ~$0.152 / second | | Seedance 2.0, 720p | ~$0.190 / second | | Seedance 2.0, 1080p | ~$0.470 / second | | Seedance 2.5, 1080p (`doubao-seedance-2-5-1080p`, added 2026-10-10) | ~$0.711 / second | | Seedance native 4K | ~$4.90 per 5-second clip | *Source: [relaydance.com/models](https://relaydance.com/models)* The models page also lists `gpt-image-2` for preparing reference frames. Image output is free and only input is billed. Image-to-image starts at about CNY 0.035, and 4K output costs the same as 1K. You can generate high-resolution style references through `POST /v1/images/generations` and pass them into an edit as `@image1`. ## Quick checklist - [ ] API key from [relaydance.com/console](https://relaydance.com/console) - [ ] Base URL set to `https://relaydance.com/v1` - [ ] Source video hosted at a public HTTPS URL - [ ] `model: "happyhorse-1.0-video-edit"`, `prompt`, and `seconds` (15 or less) - [ ] Source video and any reference images in `metadata.content[]` - [ ] Poll `GET /v1/video/generations/{task_id}` or set `metadata.callback_url` - [ ] Download the result from the video `url` when `status` is `succeeded` The full endpoint reference is in the [RelayDance docs](https://relaydance.com/docs), and current rates for every model are on the [models page](https://relaydance.com/models). --- *Notes:* A few details weren't in the facts you gave me, so the article hedges on them instead of stating them as fact: - **`content[]` item format:** the `type`/`video_url`/`image_url` structure in the examples is my guess at the format. - **How a video is cited in the prompt:** your facts only say images are cited as `@image1` to `@imageN`, so I didn't invent a video token. - **Where the video URL sits in the response:** the facts say the result "contains the video url" but not where. - **HappyHorse edit pricing:** there was no price for `happyhorse-1.0-video-edit`, so the article sends readers to the models page and shows Seedance rates only as reference. Check the first three against the docs before publishing, and add the HappyHorse price if you have it.
According to the official relaydance.com docs: "Failed or errored requests are never billed"
According to the official relaydance.com/docs docs: "Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK"

Key facts and figures

ItemValueSource
Seedance 2.0 720p priceabout $0.190 / secondrelaydance.com/models
Seedance 2.0 1080p priceabout $0.470 / secondrelaydance.com/models
Seedance 2.5 1080p priceabout $0.711 / second, added 2026-10-10, model doubao-seedance-2-5-1080prelaydance.com/models
Seedance Fast priceabout $0.152 / secondrelaydance.com/models
Seedance native 4K priceabout $4.90 per 5-second cliprelaydance.com/models
gpt-image-2 image billingimage output is free, only input is billed; image-to-image from about CNY 0.035; 4K and 1K output cost the samerelaydance.com/models
API protocolOpenAI-compatible; set base_url to https://relaydance.com/v1relaydance.com/docs
Failed requestsfailed or errored requests are never billedrelaydance.com/docs

Data verified 2026-06-29; live prices are on the official /models page.


RelayDance home · Models and pricing · Docs · All guides · Privacy Policy · User Agreement · Telegram community · RelayRouter (LLM API) · Live playground