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

# Upscale a video with FlashVSR

> Double the width and height of any video with FlashVSR. Upload a file or pass a URL; $0.01 per second of source video.

FlashVSR upscales a video you already have by a fixed 2x: a 1280×720 source comes back at 2560×1440. You send one video, and you get back an upscaled MP4. There is no target-resolution setting and nothing else to tune.

Use it to sharpen finished output before you publish it, such as a 768p [Viggle Remake](https://docs.viggle.ai/v1/video/remake.md) result, a [Video Remix](https://docs.viggle.ai/v1/video/video-remix) render, or footage from anywhere else. For a [Viggle H3](https://docs.viggle.ai/v1/video/generate-video) video, you can ask for `1080p`, `2k` or `4k` at generation time instead.

## What you send

`POST /v1/videos/super-resolution` as `multipart/form-data`.

| Parameter | Required | Notes |
| - | - | - |
| `video` | One of | The source video as a file upload |
| `video_url` | One of | A public `http(s)://` URL of the source video |
| `watermark` | No | Default `false`. Adds the Viggle watermark to the result |

Send `video` or `video_url`, not both.

### Source video limits

| | Limit |
| - | - |
| File size | Up to 100 MiB |
| Length | 0.5–600 seconds |
| Dimensions | At least 64×64 pixels, even width and height |

A source outside these limits is rejected at create with `400 INVALID_REQUEST`.

## Price

1 credit (\$0.01) per second of source video, rounded up to a whole second. The service measures the length itself.

```text theme={null}
credits = ceil(source seconds)
```

A 4.2-second source costs 5 credits ($0.05). The 6.88-second sample below costs 7 credits ($0.07). A failed job is refunded.

> [!WARNING]
>
> If your balance can't cover the job, the request is still accepted with `status: "queued"`, and the job then ends `failed` with `error.code: "INSUFFICIENT_CREDITS"`. Check `GET /v1/credits` before large batches.

## Upscale a video

Export `VIGGLE_API_KEY` and run one of these as-is. They upscale a sample video hosted by Viggle; swap in your own URL when you're ready. Each script polls every 5 seconds and prints the upscaled 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/super-resolution" \
  -H "Authorization: Bearer $VIGGLE_API_KEY" \
  -F video_url="https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4" | jq -er '.id')
echo "Submitted $video_id"

for _ in $(seq 1 120); 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 5
done
echo "Timed out waiting for $video_id" >&2; exit 1
```

```javascript Node.js theme={null}
// Node.js 20+. Save as upscale.mjs, then run: node upscale.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("video_url", "https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4");
const { id } = await call("/videos/super-resolution", { method: "POST", body: form });
console.log(`Submitted ${id}`);

for (let i = 0; i < 120; 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, 5000));
}
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/super-resolution", headers=HEADERS, timeout=300, files={
    "video_url": (None, "https://assets.viggle.ai/pub/www/developers/sample-motion-97bb074a.mp4"),
}))
print("Submitted", video["id"])

for _ in range(120):
    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(5)
else:
    raise TimeoutError(f"Timed out waiting for {video['id']}")
```

To upload a local file instead, send it as `video`:

```bash theme={null}
curl https://apis.viggle.ai/v1/videos/super-resolution \
  -H "Authorization: Bearer $VIGGLE_API_KEY" \
  -F video=@input.mp4
```

The create call answers with a `vsr_` ID:

```json theme={null}
{ "id": "vsr_5b7e2c90-d14f-4a6e-8c3b-9f1d2a4e6b70", "status": "queued", "progress": null, "created_at": "2026-11-20T09:12:03Z" }
```

## Get the result

Read the job with `GET /v1/videos/{video_id}`, passing the `vsr_` ID unchanged. When `status` is `ready`, download `video_url`.

* The link is valid for one hour, and every read returns a fresh one.
* Download promptly. The upscaled file is deleted 24 hours after the job finishes; after that the job still reads `ready` with `video_url` set to `null`.
* Upscale jobs don't appear in `GET /v1/videos`. Keep the `vsr_` ID you got at create.
* Only the API key that created the job can read it.

See [Task lifecycle](https://docs.viggle.ai/v1/concepts/task-lifecycle.md) and [Limits and retention](https://docs.viggle.ai/v1/concepts/limits-and-retention.md).

## Next steps

> [card] [Viggle Remake](https://docs.viggle.ai/v1/video/remake.md)
>
> Replace the people in a video, then upscale the 768p result.

> [card] [Video Remix](https://docs.viggle.ai/v1/video/video-remix)
>
> Put a character on a motion video.

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

> [card] [Upscale a video (API reference)](https://docs.viggle.ai/v1/api-reference/videos/upscale-a-video.md)
>
> Every field and error for `POST /v1/videos/super-resolution`.


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