> ## Documentation Index
> Fetch the complete documentation index at: https://docs.viggle.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Viggle Remake

> Replace the people in a video with your own characters while keeping the original motion, camera and timing.

Viggle Remake replaces the people in a video with characters from your images. You send a driving video and one or more character images. Remake keeps the driving video's motion, camera and timing and swaps in your characters. Output is a 768p MP4.

Use it to recast a clip: put your mascot into a dance video, swap the actors in an ad, or turn a recorded performance into a different character. To make a character perform a motion from scratch instead, see [Video Remix](https://docs.viggle.ai/v1/video/video-remix). To generate a new shot from references, see [Reference to video](https://docs.viggle.ai/v1/video/reference-to-video.md).

Remake runs on `POST /v1/videos`, the same endpoint as Viggle H3. Sending a driving video or any character image field selects Remake, and the job ID starts with `anim_`.

> [!WARNING]
>
> Remake always needs a driving video. A request with character images but no `driving_video` or `driving_video_url` (including an empty or `null` URL) is rejected with `400 INVALID_REQUEST` before anything is charged, whatever the image count, `prompt` or `enhance_mode`. To make video from an image with Viggle H3, use [First frame to video](https://docs.viggle.ai/v1/video/first-frame-to-video.md) or [Reference to video](https://docs.viggle.ai/v1/video/reference-to-video.md).

## Choose an enhance mode

`enhance_mode` decides how much preparation Remake does before rendering, and sets the price.

| `enhance_mode` | Driving video | Price per second | How it works | Recommended images |
| - | - | - | - | - |
| `normal` | 5–16 s | \$0.01 (1 credit) | The lightest pass: swaps your character in with minimal preparation | 1, or 2–3 with target tags |
| `planner` (default) | 5–16 s | \$0.05 (5 credits) | Adds a planning pass that prepares the prompt and key frames before rendering | 1, or 2–3 with target tags |
| `agent` | 5–60 s | \$0.10 (10 credits) | An AI agent plans and runs the whole edit. Reads `prompt` as a free-form instruction | 1–10, in order |

The driving-video range and the price are enforced by the API, and every mode accepts up to 10 character images. The other two columns are guidance on what each mode does well.

Start with `planner`, the default. `normal` costs a fifth as much. `agent` is the one to use for clips longer than 16 seconds, more than 3 people, or an edit you'd rather describe in words.

## Character images and target tags

Each character image replaces one person in the driving video.

* One person to replace: send one image. No prompt is needed.
* Several people with `planner` or `normal`: works best with 2–3 images and a prompt that starts with one tag per image, in order: `<Character1>`, `<Character2>`, `<Character3>`. After each tag, describe which person in the video that image replaces. Without tags, expect only the first image to be used.
* With `agent`: send 1–10 images in order. They map to Character1, Character2 and so on. Tags are optional; you can say who replaces whom in plain words.

```text theme={null}
<Character1>the person in white on the left<Character2>the person in red on the right
```

## What you send

Send `multipart/form-data` to upload files, or JSON (or `application/x-www-form-urlencoded`) when every input is a URL.

| Parameter | Required | Notes |
| - | - | - |
| `driving_video` or `driving_video_url` | Yes, one | The video whose motion is kept. One of the two, not both. Without it the request returns `400` |
| `character_image` | One image source | Image files. Repeat the field for each image, in order |
| `character_image_url` | One image source | An image URL. Repeatable in forms |
| `character_image_urls` | One image source | An ordered list of image URLs: a JSON array in a JSON body, or a JSON array string in a form |
| `prompt` | No | Target tags, or the agent's editing instruction |
| `enhance_mode` | No | `normal`, `planner` (default) or `agent` |
| `watermark` | No | Default `false`. Doesn't change the price |

Use one image source per request: uploads, `character_image_url` or `character_image_urls`. Uploads and URLs can't mix. Remake has no `quality`, `duration_s`, `resolution`, `aspect_ratio` or `seed`; sending `quality` is rejected with `400`. The output length follows the driving video. Full schema: [Create a video](https://docs.viggle.ai/v1/api-reference/videos/create-a-video.md).

### Media requirements

| Input | Requirement |
| - | - |
| Driving video length | 5–16 seconds for `normal` and `planner`, checked exactly (16.2 s is rejected). 5–60 seconds for `agent`: the length check counts whole seconds (60.9 s passes), but billing rounds up, so a 60.9 s video is billed as 61 seconds |
| Driving video file | Up to 100 MiB, at least 64×64 pixels, even width and height |
| Character images | Up to 10. Uploads up to 20 MiB each. Any decodable image (JPEG, PNG and so on); no fixed size, aspect ratio or full-body framing required |
| URLs | Must be public `https://` URLs. `http://` is rejected |

A driving video outside the range for its `enhance_mode` is rejected at create with `400 INVALID_REQUEST`, before anything is charged.

## Price

Remake is billed per second of driving video, rounded up, at the rate of its `enhance_mode`:

```text theme={null}
credits = ceil(driving video seconds) × 1 (normal) | 5 (planner) | 10 (agent)
```

An 8.3-second driving video is billed as 9 seconds: 9 credits ($0.09) with `normal`, 45 credits ($0.45) with `planner`, 90 credits (\$0.90) with `agent`.

* The amount is reserved when you submit. If your balance can't cover it, the request fails with `402 INSUFFICIENT_CREDITS` and no job runs. The attempt may still appear in `GET /v1/videos` as a failed `anim_` job.
* When the job is `ready`, the charge is settled against the finished video's length at the same rate. It never goes above the reservation, so settlement can only refund.
* A failed job is refunded in full.
* If the reservation step is busy, the request can fail with `429 RATE_LIMITED`. Retry with backoff.

## Remake a video

Export `VIGGLE_API_KEY` and run one of these as-is. They use a sample driving video (6.88 seconds, one dancer) and a sample character image hosted by Viggle, with the default `planner` mode. The sample is billed as 7 seconds: 35 credits (\$0.35). Each script polls every 10 seconds and prints the video URL. The cURL version needs `jq`.

```bash cURL theme={null}
#!/usr/bin/env bash
set -euo pipefail
API="https://apis.viggle.ai/v1"

video_id=$(curl -sS --fail-with-body "$API/videos" \
  -H "Authorization: Bearer $VIGGLE_API_KEY" \
  -F driving_video_url="https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4" \
  -F character_image_url="https://assets.viggle.ai/pub/www/developers/threed-source-image-3f2f6787.webp" | jq -er '.id')
echo "Submitted $video_id"

for _ in $(seq 1 720); do
  video=$(curl -sS --fail-with-body "$API/videos/$video_id" \
    -H "Authorization: Bearer $VIGGLE_API_KEY")
  case $(echo "$video" | jq -r '.status') in
    ready) echo "$video" | jq -r '.video_url'; exit 0 ;;
    failed|cancelled) echo "$video" | jq -c '.error' >&2; exit 1 ;;
  esac
  sleep 10
done
echo "Timed out waiting for $video_id" >&2; exit 1
```

```javascript Node.js theme={null}
// Node.js 20+. Save as remake.mjs, then run: node remake.mjs
const API = "https://apis.viggle.ai/v1";
const headers = { Authorization: `Bearer ${process.env.VIGGLE_API_KEY}` };

async function call(path, init = {}) {
  const res = await fetch(`${API}${path}`, { ...init, headers });
  const body = await res.json();
  if (!res.ok) throw new Error(`HTTP ${res.status}: ${JSON.stringify(body.error)}`);
  return body;
}

const form = new FormData();
form.append("driving_video_url", "https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4");
form.append("character_image_url", "https://assets.viggle.ai/pub/www/developers/threed-source-image-3f2f6787.webp");
const { id } = await call("/videos", { method: "POST", body: form });
console.log(`Submitted ${id}`);

for (let i = 0; i < 720; i++) {
  const video = await call(`/videos/${id}`);
  if (video.status === "ready") {
    console.log(video.video_url);
    process.exit(0);
  }
  if (video.status === "failed" || video.status === "cancelled") {
    throw new Error(`${video.status}: ${JSON.stringify(video.error)}`);
  }
  await new Promise((resolve) => setTimeout(resolve, 10000));
}
throw new Error(`Timed out waiting for ${id}`);
```

```python Python theme={null}
import os
import time

import requests

API = "https://apis.viggle.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['VIGGLE_API_KEY']}"}


def check(resp):
    if not resp.ok:
        raise RuntimeError(f"HTTP {resp.status_code}: {resp.text}")
    return resp.json()


# Passing fields through files= makes requests send multipart/form-data.
video = check(requests.post(f"{API}/videos", headers=HEADERS, timeout=300, files={
    "driving_video_url": (None, "https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4"),
    "character_image_url": (None, "https://assets.viggle.ai/pub/www/developers/threed-source-image-3f2f6787.webp"),
}))
print("Submitted", video["id"])

for _ in range(720):
    video = check(requests.get(f"{API}/videos/{video['id']}", headers=HEADERS))
    if video["status"] == "ready":
        print(video["video_url"])
        break
    if video["status"] in ("failed", "cancelled"):
        raise RuntimeError(f"{video['status']}: {video['error']}")
    time.sleep(10)
else:
    raise TimeoutError(f"Timed out waiting for {video['id']}")
```

To upload local files instead, send them as `driving_video` and `character_image`:

```bash theme={null}
curl https://apis.viggle.ai/v1/videos \
  -H "Authorization: Bearer $VIGGLE_API_KEY" \
  -F driving_video=@driving.mp4 \
  -F character_image=@character.png
```

The create call answers with the job ID:

```json theme={null}
{ "id": "anim_8c41d2e0-7a9b-4f13-a6d2-3b5e7c9f1a24", "status": "queued", "progress": null, "created_at": "2026-11-20T09:12:03Z" }
```

### Several people, or agent mode

With hosted media you can send JSON. These bodies go to the same endpoint with `Content-Type: application/json`, and you poll the returned `anim_` ID the same way.

```bash Two people, planner theme={null}
curl https://apis.viggle.ai/v1/videos \
  -H "Authorization: Bearer $VIGGLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "driving_video_url": "https://example.com/driving.mp4",
    "character_image_urls": ["https://example.com/first.jpg", "https://example.com/second.jpg"],
    "prompt": "<Character1>the person in white on the left<Character2>the person in red on the right"
  }'
```

```bash Agent theme={null}
curl https://apis.viggle.ai/v1/videos \
  -H "Authorization: Bearer $VIGGLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "driving_video_url": "https://example.com/driving.mp4",
    "character_image_urls": ["https://example.com/first.jpg", "https://example.com/second.jpg"],
    "prompt": "Replace the dancer in white with the first character and the dancer in red with the second",
    "enhance_mode": "agent"
  }'
```

## Get the result

Poll `GET /v1/videos/{video_id}` with the `anim_` ID. While the job is queued, the response includes `queue_position` and `estimated_wait_seconds`. When `status` is `ready`, download `video_url`.

* The link is valid for one hour, and every read returns a fresh one.
* The video is deleted 24 hours after the job finishes. Copy it to your own storage.
* Only the API key that created the job can read it. It also appears in `GET /v1/videos`.
* A Remake job can't be cancelled once submitted.

See [Task lifecycle](https://docs.viggle.ai/v1/concepts/task-lifecycle.md) and [Errors](https://docs.viggle.ai/v1/production/errors.md).

## Next steps

> [card] [Upscale the result](https://docs.viggle.ai/v1/video/upscale.md)
>
> Double the 768p output with FlashVSR, at \$0.01 per second.

> [card] [Video Remix](https://docs.viggle.ai/v1/video/video-remix)
>
> Make a character perform a motion video, with optional alpha output.

> [card] [Pricing](https://docs.viggle.ai/v1/pricing.md)
>
> Every price, with worked examples.

> [card] [Create a video (API reference)](https://docs.viggle.ai/v1/api-reference/videos/create-a-video.md)
>
> Every field, limit and error for `POST /v1/videos`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.