> ## 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.

# Reusable characters and motions

> Save a character image or motion video once, then render it in any number of Video Remix jobs by ID, without re-uploading.

A Character (`char_`) is a saved character image. A Motion (`mot_`) is a saved motion video. Viggle processes each one once, and then you pass its ID to any number of [Video Remix](https://docs.viggle.ai/v1/video/video-remix) renders instead of uploading the same file again.

Use saved assets when the same character or motion appears in more than one render: a mascot that dances to every new trend, or one dance performed by many user avatars. For a one-off render, send the files directly.

This page covers 2D assets for Video Remix (`type=render`, the default). The same endpoints also build rigged 3D characters and 3D motion; see [3D characters](https://docs.viggle.ai/v1/3d/characters.md) and [3D motion](https://docs.viggle.ai/v1/3d/motion.md).

## What you send

| Asset | Call | Source | Optional | Price |
| - | - | - | - | - |
| Character | `POST /v1/characters` | `image` (file) or `image_url` | `name` | 1 credit (\$0.01) |
| Motion | `POST /v1/motions` | `motion_video` (file) or `motion_video_url` | `name` | Free |

Both take `multipart/form-data` and answer right away with `status: "queued"`. Media limits match Video Remix: character images up to 20 MiB; motion videos up to 100 MiB, 0.5–600 seconds, at least 64×64 pixels, even width and height.

Using a saved asset doesn't change the render price: \$0.01 per character per second of finished video. If your balance can't cover the 1-credit Character, create answers `402 INSUFFICIENT_CREDITS`.

## Create, wait, render

This script does the whole loop: it saves a Character and a Motion from sample media hosted by Viggle, waits for both to be ready, renders them by ID, and prints the video URL. Export `VIGGLE_API_KEY` and run it as-is. The cURL version needs `jq`. To upload local files instead, send `image` and `motion_video` file fields.

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

# wait_ready <path>: poll an asset until it is ready
wait_ready() {
  for _ in $(seq 1 100); do
    status=$(curl -sS --fail-with-body "$API/$1" -H "$AUTH" | jq -r '.status')
    case "$status" in
      ready) return 0 ;;
      failed) echo "$1 failed" >&2; exit 1 ;;
    esac
    sleep 3
  done
  echo "Timed out waiting for $1" >&2; exit 1
}

character_id=$(curl -sS --fail-with-body "$API/characters" -H "$AUTH" \
  -F image_url="https://assets.viggle.ai/pub/www/developers/threed-source-image-3f2f6787.webp" -F name="Mascot" | jq -er '.id')
motion_id=$(curl -sS --fail-with-body "$API/motions" -H "$AUTH" \
  -F motion_video_url="https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4" -F name="Dance loop" | jq -er '.id')
wait_ready "characters/$character_id"
wait_ready "motions/$motion_id"
echo "Saved $character_id and $motion_id"

render_id=$(curl -sS --fail-with-body "$API/renders" -H "$AUTH" \
  -F character_id="$character_id" -F motion_id="$motion_id" | jq -er '.id')

for _ in $(seq 1 120); do
  render=$(curl -sS --fail-with-body "$API/videos/$render_id" -H "$AUTH")
  case $(echo "$render" | jq -r '.status') in
    ready) echo "$render" | jq -r '.video_url'; exit 0 ;;
    failed|cancelled) echo "$render" | jq -c '.error' >&2; exit 1 ;;
  esac
  sleep 5
done
echo "Timed out waiting for $render_id" >&2; exit 1
```

```javascript Node.js theme={null}
// Node.js 20+. Save as reuse-assets.mjs, then run: node reuse-assets.mjs

const API = "https://apis.viggle.ai/v1";
const headers = { Authorization: `Bearer ${process.env.VIGGLE_API_KEY}` };
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

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;
}

async function upload(path, fields) {
  const form = new FormData();
  for (const [key, value] of Object.entries(fields)) form.append(key, value);
  return call(path, { method: "POST", body: form });
}

async function waitReady(path) {
  for (let i = 0; i < 100; i++) {
    const asset = await call(path);
    if (asset.status === "ready") return asset;
    if (asset.status === "failed") throw new Error(`${path} failed`);
    await sleep(3000);
  }
  throw new Error(`Timed out waiting for ${path}`);
}

const character = await upload("/characters", {
  image_url: "https://assets.viggle.ai/pub/www/developers/threed-source-image-3f2f6787.webp",
  name: "Mascot",
});
const motion = await upload("/motions", {
  motion_video_url: "https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4",
  name: "Dance loop",
});
await waitReady(`/characters/${character.id}`);
await waitReady(`/motions/${motion.id}`);
console.log(`Saved ${character.id} and ${motion.id}`);

const render = await upload("/renders", { character_id: character.id, motion_id: motion.id });
for (let i = 0; i < 120; i++) {
  const video = await call(`/videos/${render.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 sleep(5000);
}
throw new Error(`Timed out waiting for ${render.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()


def wait_ready(path):
    for _ in range(100):
        asset = check(requests.get(f"{API}/{path}", headers=HEADERS))
        if asset["status"] == "ready":
            return asset
        if asset["status"] == "failed":
            raise RuntimeError(f"{path} failed")
        time.sleep(3)
    raise TimeoutError(f"Timed out waiting for {path}")


# Passing fields through files= makes requests send multipart/form-data.
character = check(requests.post(f"{API}/characters", headers=HEADERS, files={
    "image_url": (None, "https://assets.viggle.ai/pub/www/developers/threed-source-image-3f2f6787.webp"),
    "name": (None, "Mascot"),
}))
motion = check(requests.post(f"{API}/motions", headers=HEADERS, timeout=300, files={
    "motion_video_url": (None, "https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4"),
    "name": (None, "Dance loop"),
}))
wait_ready(f"characters/{character['id']}")
wait_ready(f"motions/{motion['id']}")
print("Saved", character["id"], "and", motion["id"])

render = check(requests.post(f"{API}/renders", headers=HEADERS, files={
    "character_id": (None, character["id"]),
    "motion_id": (None, motion["id"]),
}))
for _ in range(120):
    render = check(requests.get(f"{API}/videos/{render['id']}", headers=HEADERS))
    if render["status"] == "ready":
        print(render["video_url"])
        break
    if render["status"] in ("failed", "cancelled"):
        raise RuntimeError(f"{render['status']}: {render['error']}")
    time.sleep(5)
else:
    raise TimeoutError(f"Timed out waiting for {render['id']}")
```

The create response for a Character looks like this (a Motion is the same with a `mot_` ID):

```json theme={null}
{
  "id": "char_550e8400-e29b-41d4-a716-446655440000",
  "status": "queued",
  "name": "Mascot",
  "progress": null,
  "capabilities": [],
  "created_at": "2026-11-20T09:15:22Z",
  "completed_at": null,
  "error": null,
  "type": "render",
  "vsplat": null,
  "glb": null
}
```

## When an asset is ready

Poll `GET /v1/characters/{id}` or `GET /v1/motions/{id}` every few seconds. An asset can be used in a render once `status` is `ready` and `capabilities` includes `video_render`. A Character or Motion that isn't ready, or that has only a 3D output, is rejected by `POST /v1/renders` with `400`.

## Manage saved assets

* Saved 2D assets belong to your account, so every API key on the account can use them. Renders, by contrast, are visible only to the key that created them.
* They don't expire. Viggle keeps them until you delete them.
* The image or video you uploaded to create one is deleted 1 hour after processing. After that, leave `mode` unset and render with the same `model` the asset was created with. Renders that need the original source answer `400`: a saved Motion with `mode=full_pipeline` or `scene_preprocess`, a saved Character with `mode=character_only`, and a saved Character rendered on a motion video (not a saved Motion) with a different `model`.
* List them with `GET /v1/characters` and `GET /v1/motions` (up to 100 each).
* Delete one with `DELETE /v1/characters/{id}` or `DELETE /v1/motions/{id}`. The answer is `204` with an empty body.
* Viggle motion templates become saved Motions through `POST /v1/motions/import`. See [Use a Viggle motion template](https://docs.viggle.ai/v1/video/video-remix#use-a-viggle-motion-template).

## Next steps

> [card] [Video Remix](https://docs.viggle.ai/v1/video/video-remix)
>
> Render options, the draft flow and multi-person renders.

> [card] [3D characters](https://docs.viggle.ai/v1/3d/characters.md)
>
> Turn the same image into a rigged 3D character.

> [card] [3D motion](https://docs.viggle.ai/v1/3d/motion.md)
>
> Turn a video or a prompt into GLB or FBX animation.

> [card] [Create a character (API reference)](https://docs.viggle.ai/v1/api-reference/characters/create-a-character.md)
>
> Every field for `POST /v1/characters`.


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