# Video Upscale API on MLMux

> Upscales an existing video to 720p, 1080p, 2K, or 4K.

- Model page: https://www.mlmux.com/mlmux/video-upscale
- API model ID: `mlmux/video-upscale`
- Provider: MLMux
- Generation modes: Source video
- Endpoint: `POST https://api.mlmux.com/v1/videos/generations`
- Reference images: not available yet
- Resolutions: 720p, 1080p, 2K, 4K
- Input: a source video as `video_url`; the output is as long as the source, and no prompt is needed

## Pricing

Pay as you go in credits; 1 credit = 1 US dollar, with no subscription. `official-cheap` is the default route.

- 720p: $0.038 on `official`, $0.035 on `official-cheap` per second of the source video
- 1080p: $0.077 on `official`, $0.069 on `official-cheap` per second of the source video
- 2K: $0.123 on `official`, $0.111 on `official-cheap` per second of the source video
- 4K: $0.154 on `official`, $0.138 on `official-cheap` per second of the source video

## Request

Send your API key as `Authorization: Bearer $MLMUX_API_KEY`. Create keys at https://www.mlmux.com/console/api-keys.

```bash
curl https://api.mlmux.com/v1/videos/generations \
  -H "Authorization: Bearer $MLMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "mlmux/video-upscale",
  "route_mode": "official-cheap",
  "video_url": "https://your-cdn.example/source.mp4",
  "resolution": "1080p"
}'

# The response is a task. Poll it until "status" is "succeeded", then read "video".
curl https://api.mlmux.com/v1/videos/generations/TASK_ID \
  -H "Authorization: Bearer $MLMUX_API_KEY"
```

```python
import os
import time
import requests

headers = {"Authorization": f"Bearer {os.environ['MLMUX_API_KEY']}"}
response = requests.post(
    "https://api.mlmux.com/v1/videos/generations",
    headers=headers,
    json={
      "model": "mlmux/video-upscale",
      "route_mode": "official-cheap",
      "video_url": "https://your-cdn.example/source.mp4",
      "resolution": "1080p"
    },
    timeout=300,
)
response.raise_for_status()
task = response.json()

while task["status"] not in ("succeeded", "failed", "expired", "canceled"):
    time.sleep(5)
    task = requests.get("https://api.mlmux.com" + task["poll_url"], headers=headers, timeout=30).json()

print(task["status"], task.get("video"))
```

The response is a task. Poll its `poll_url` every few seconds until `status` is `succeeded`, then read the video URL, or receive a webhook when it finishes.

## Frequently asked questions

### What is Video Upscale?

Video Upscale is a video tool on MLMux. You can run it in the browser or call it through the same API as the video models. Upscales an existing video to 720p, 1080p, 2K, or 4K.

### How do I use the Video Upscale API?

Create an API key in the MLMux Console, then send a POST request to https://api.mlmux.com/v1/videos/generations with the key in the Authorization header and model set to mlmux/video-upscale. The request returns a task: poll it, or receive a webhook when the video is ready.

### What can Video Upscale do?

Video Upscale processes a source video you pass as video_url, with no prompt, and the output is as long as the source.

### How much does Video Upscale cost?

MLMux is pay as you go, with no subscription or monthly fee, and 1 credit equals 1 US dollar. Video Upscale charges for each second of the video it returns, which is as long as the source: $0.035 per second on the default official-cheap route and $0.038 on the official route, at 720p. Rates for every resolution are listed in the pricing section of this page.

### Can I try Video Upscale without writing code?

Yes. Sign in and use the playground at the top of this page to run Video Upscale with the same settings as the API. The playground's code views show the matching request for your settings, and the quick start below has copy-paste examples in cURL, Python, and JavaScript.

## More

- Video API guide: https://www.mlmux.com/docs/videos
- Pricing for every model: https://www.mlmux.com/pricing
- All models: https://www.mlmux.com/llms.txt
