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

> ## Agent Instructions
> The Venice API is OpenAI-compatible: use any OpenAI SDK with the base URL `https://api.venice.ai/api/v1` and a Venice API key, or pay per request from a USDC wallet through x402 with no account.
> Read model IDs from `GET /models` or `GET /models/traits` at runtime instead of hardcoding them from memory or from these pages. Models are added and retired often.
> Every model's price is in https://docs.venice.ai/pricing.md. Quote video and audio jobs with `POST /video/quote` or `POST /audio/quote` before you queue them.
> Search these docs from an MCP client at https://docs.venice.ai/mcp. The full agent guide is https://docs.venice.ai/agents.md.

# Video Upscaling

> Enhance video resolution and quality with the topaz-video-upscale model on Venice's async video queue, with 1x, 2x, or 4x upscaling factors.

Video upscaling lets you enhance existing videos to higher resolutions while improving visual quality. The **Topaz Video Upscale** model uses AI-powered upscaling to increase resolution by 2x or 4x, or apply quality enhancement at the original resolution (1x).

## How it works

Video upscaling uses the same async queue system as video generation:

1. **Queue** — Submit your video to `/video/queue` with the `topaz-video-upscale` model
2. **Poll** — Call `/video/retrieve` with `model` and the returned `queue_id`. While the job runs, it returns JSON with `"status": "PROCESSING"`. When the job finishes, the response body is the upscaled MP4 (`Content-Type: video/mp4`), so save it to a file. There is no output URL.
3. **Clean up (optional)** — After you've saved the file, call `/video/complete` to delete the stored output

The server automatically detects the input video's duration, frame rate, and dimensions from the uploaded file. You don't need to provide these values — billing is calculated from the actual video metadata.

## Upscale factors

| `upscale_factor` | Output resolution | Use case |
| - | - | - |
| `1` | Same as input | Quality enhancement only (denoising, sharpening) |
| `2` (default) | 2x input dimensions | Standard upscale — 720p input becomes 1440p output |
| `4` | 4x input dimensions | Maximum upscale — 480p input becomes 1920p output |

> [!NOTE]
>
> The `upscale_factor` parameter replaces `resolution` for upscale models. Passing `resolution` will return an error. This is because the output resolution depends on the input video's dimensions — a `2x` upscale of a 720p video produces a different result than a `2x` upscale of a 480p video.

## Supported input formats

* **Formats**: MP4, MOV, WebM
* **Input methods**: HTTPS URL or `data:video/...;base64,...` data URL
* **Max duration**: 300 seconds (5 minutes)

## API usage

### Queue an upscale job

```bash cURL theme={"system"}
curl https://api.venice.ai/api/v1/video/queue \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "topaz-video-upscale",
    "video_url": "https://example.com/input-video.mp4",
    "upscale_factor": 2
  }'
```

```python Python theme={"system"}
import requests

response = requests.post(
    "https://api.venice.ai/api/v1/video/queue",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "topaz-video-upscale",
        "video_url": "https://example.com/input-video.mp4",
        "upscale_factor": 2,
    },
)

data = response.json()
queue_id = data["queue_id"]
download_url = data.get("download_url")
print(f"Queued: {queue_id}")
```

```javascript Node.js theme={"system"}
const response = await fetch("https://api.venice.ai/api/v1/video/queue", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "topaz-video-upscale",
    video_url: "https://example.com/input-video.mp4",
    upscale_factor: 2,
  }),
});

const { queue_id, download_url } = await response.json();
console.log(`Queued: ${queue_id}`);
```

The response includes a `queue_id` to track the job:

```json theme={"system"}
{
  "model": "topaz-video-upscale",
  "queue_id": "abc123-def456-..."
}
```

### Poll and save the result

```bash cURL theme={"system"}
curl https://api.venice.ai/api/v1/video/retrieve \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "topaz-video-upscale", "queue_id": "abc123-def456-..."}' \
  -o upscaled.mp4 \
  -w '%{content_type}\n'
```

```python Python theme={"system"}
import time

while True:
    result = requests.post(
        "https://api.venice.ai/api/v1/video/retrieve",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        json={"model": "topaz-video-upscale", "queue_id": queue_id},
    )
    result.raise_for_status()

    if "video/mp4" in result.headers.get("Content-Type", ""):
        with open("upscaled.mp4", "wb") as f:
            f.write(result.content)
        break

    if result.json().get("status") == "COMPLETED" and download_url:
        with open("upscaled.mp4", "wb") as f:
            f.write(requests.get(download_url).content)
        break

    time.sleep(5)

print("Saved upscaled.mp4")
```

```javascript Node.js theme={"system"}
import { writeFile } from "node:fs/promises";

const poll = async (queueId, downloadUrl) => {
  while (true) {
    const res = await fetch("https://api.venice.ai/api/v1/video/retrieve", {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ model: "topaz-video-upscale", queue_id: queueId }),
    });
    if (!res.ok) {
      throw new Error(`${res.status}: ${await res.text()}`);
    }

    if (res.headers.get("Content-Type")?.includes("video/mp4")) {
      await writeFile("upscaled.mp4", Buffer.from(await res.arrayBuffer()));
      return;
    }

    const data = await res.json();
    if (data.status === "COMPLETED" && downloadUrl) {
      const video = await fetch(downloadUrl);
      await writeFile("upscaled.mp4", Buffer.from(await video.arrayBuffer()));
      return;
    }

    await new Promise((r) => setTimeout(r, 5000));
  }
};

await poll(queue_id, download_url);
console.log("Saved upscaled.mp4");
```

The finished upscale is the response body itself, not a JSON field, so check `Content-Type` before parsing. The cURL example prints the content type of each response: repeat it until it prints `video/mp4`, at which point `upscaled.mp4` holds the video. If the queue response included a `download_url`, retrieve returns JSON with `"status": "COMPLETED"` instead, and you download the file from that URL. See [Private download links](https://docs.venice.ai/guides/media/video-generation.md#private-download-links).

### Clean up (optional)

After you've saved the MP4, you can call `/video/complete` to delete the stored output. It doesn't return the video or a URL.

```bash theme={"system"}
curl https://api.venice.ai/api/v1/video/complete \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "topaz-video-upscale", "queue_id": "abc123-def456-..."}'
```

***

## API parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `model` | string | **Yes** | Must be `topaz-video-upscale` |
| `video_url` | string | **Yes** | Input video URL or data URL. Supported formats: MP4, MOV, WebM. |
| `upscale_factor` | number | No | `1`, `2` (default), or `4`. Controls the upscale multiplier. |

### Parameters not used for upscale models

The following parameters are **not accepted** for `topaz-video-upscale` and will return an error if provided:

| Field | Reason |
| - | - |
| `resolution` | Use `upscale_factor` instead. Output resolution depends on input dimensions. |
| `prompt` | Upscaling does not use text prompts. An empty string is set automatically. |

The `duration` parameter is also ignored — the server detects duration directly from the video file for billing accuracy.

***

## Pricing

Pricing is based on **duration**, **output resolution tier**, and **frame rate**. The output resolution tier is determined by the input video's height multiplied by the upscale factor.

### Output resolution tiers

| Tier | Output height | Per-second rate |
| - | - | - |
| 720p | ≤ 720px | \~\$0.013 |
| 1080p | 721–1080px | \~\$0.025 |
| 4K | > 1080px | \~\$0.10 |

> [!NOTE]
>
> Videos with frame rates above 48fps cost 2x the per-second rate.

### Pricing examples

| Input | Upscale factor | Output | Duration | Estimated cost |
| - | - | - | - | - |
| 480p, 30fps | 2x | 960p (1080p tier) | 10s | \~\$0.25 |
| 720p, 30fps | 2x | 1440p (4K tier) | 10s | \~\$1.00 |
| 1080p, 30fps | 2x | 2160p (4K tier) | 30s | \~\$3.00 |
| 360p, 24fps | 4x | 1440p (4K tier) | 10s | \~\$1.00 |
| 480p, 60fps | 2x | 960p (1080p tier) | 10s | \~\$0.50 |

Use the [Video Quote API](https://docs.venice.ai/api-reference/endpoint/video/quote.md) to get exact pricing before submitting a job.

### Getting a quote

```bash theme={"system"}
curl https://api.venice.ai/api/v1/video/quote \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "topaz-video-upscale",
    "video_url": "https://example.com/input.mp4",
    "upscale_factor": 2
  }'
```

`video_url` is **required** for quotes on upscale models — the quote endpoint fetches the file and detects duration, FPS, and height from the bytes, so there is no need to supply them. Omitting it returns `400` with *"video\_url is required for quotes on this model"*.

Quotes for upscale models require an API key. Requests without one return `403`.

Pass the same `upscale_factor` (`1`, `2`, or `4`) to `/video/quote` that you will send to `/video/queue`, so the quote matches the job. Quote also accepts `resolution` (`"2x"` or `"4x"`) as a deprecated alias for upscale models; if both are sent, `upscale_factor` takes precedence.

***

## Troubleshooting

| Problem | Likely cause | Fix |
| - | - | - |
| `"Use upscale_factor instead of resolution"` | `resolution` was passed in the request | Remove `resolution` and use `upscale_factor` instead |
| Higher-than-expected cost | Input video has high resolution or high FPS | Check input dimensions with the quote endpoint. 720p+ input with 2x upscale lands in the 4K pricing tier. |
| Job takes a long time | Large or long video | Upscaling is compute-intensive. Longer videos and higher upscale factors take proportionally longer. |
| `"Insufficient balance"` | Account credits too low | Add credits at [venice.ai/settings/api](https://venice.ai/settings/api?utm_source=venice-api-documentation) |


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