> ## Documentation Index
> Fetch the complete documentation index at: https://veniceai-docs-responses-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Video-Upscaling

> Verbessern Sie Videoauflösung und -qualität mit dem topaz-video-upscale-Modell in Venices asynchroner Video-Queue, mit 1x-, 2x- oder 4x-Upscaling.

Mit Video-Upscaling kannst du vorhandene Videos in höhere Auflösungen heben und gleichzeitig die visuelle Qualität verbessern. Das **Topaz-Video-Upscale**-Modell nutzt KI-basiertes Upscaling, um die Auflösung 2× oder 4× zu erhöhen, oder wendet bei 1× eine Qualitätsverbesserung in der Original-Auflösung an.

## Wie es funktioniert

Video-Upscaling nutzt dasselbe asynchrone Queue-System wie die Videogenerierung:

1. **Queue** — Video an `/video/queue` mit Modell `topaz-video-upscale` senden
2. **Poll** — `/video/retrieve` mit der zurückgegebenen `queue_id` aufrufen, bis der Status `completed` ist
3. **Complete** — `/video/complete` aufrufen, um den Job abzuschließen und die Output-URL zu erhalten

Der Server erkennt Dauer, Bildrate und Dimensionen des Input-Videos automatisch aus der hochgeladenen Datei. Du musst diese Werte nicht angeben – die Abrechnung erfolgt anhand der tatsächlichen Videometadaten.

## Upscale-Faktoren

| `upscale_factor` | Output-Auflösung | Anwendungsfall |
| - | - | - |
| `1` | Wie Input | Nur Qualitätsverbesserung (Denoising, Sharpening) |
| `2` (Default) | 2× Input-Dimensionen | Standard-Upscale – 720p-Input wird 1440p-Output |
| `4` | 4× Input-Dimensionen | Maximales Upscale – 480p-Input wird 1920p-Output |

<Note>
  Der Parameter `upscale_factor` ersetzt `resolution` bei Upscale-Modellen. Wird `resolution` übergeben, gibt es einen Fehler. Das liegt daran, dass die Output-Auflösung von den Input-Dimensionen abhängt – ein `2×`-Upscale eines 720p-Videos ergibt etwas anderes als ein `2×`-Upscale eines 480p-Videos.
</Note>

## Unterstützte Eingabeformate

* **Formate**: MP4, MOV, WebM
* **Input-Methoden**: HTTPS-URL oder `data:video/...;base64,...`-Data-URL
* **Max. Dauer**: 300 Sekunden (5 Minuten)

## API-Nutzung

### Upscale-Job in die Queue stellen

<CodeGroup>
  ```bash cURL theme={null}
  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={null}
  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"]
  print(f"Queued: {queue_id}")
  ```

  ```javascript Node.js theme={null}
  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 } = await response.json();
  console.log(`Queued: ${queue_id}`);
  ```
</CodeGroup>

Die Antwort enthält eine `queue_id`, um den Job zu verfolgen:

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

### Auf Fertigstellung pollen

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.venice.ai/api/v1/video/retrieve \
    -H "Authorization: Bearer $VENICE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"queue_id": "abc123-def456-..."}'
  ```

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

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

      if data.get("status") == "completed":
          print(f"Video URL: {data['url']}")
          break

      time.sleep(5)
  ```

  ```javascript Node.js theme={null}
  const poll = async (queueId) => {
    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({ queue_id: queueId }),
      });
      const data = await res.json();

      if (data.status === "completed") {
        console.log(`Video URL: ${data.url}`);
        return data;
      }

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

  await poll(queue_id);
  ```
</CodeGroup>

### Mit Complete abschließen

Nach dem Abruf des Ergebnisses `/video/complete` aufrufen, um den Job zu finalisieren:

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

***

## API-Parameter

| Feld | Typ | Pflicht | Beschreibung |
| - | - | - | - |
| `model` | string | **Ja** | Muss `topaz-video-upscale` sein |
| `video_url` | string | **Ja** | Input-Video-URL oder Data-URL. Unterstützte Formate: MP4, MOV, WebM. |
| `upscale_factor` | number | Nein | `1`, `2` (Default) oder `4`. Steuert den Upscale-Multiplikator. |

### Bei Upscale-Modellen nicht verwendete Parameter

Die folgenden Parameter werden bei `topaz-video-upscale` **nicht akzeptiert** und führen zu einem Fehler:

| Feld | Grund |
| - | - |
| `resolution` | Stattdessen `upscale_factor` verwenden. Die Output-Auflösung hängt von den Input-Dimensionen ab. |
| `prompt` | Upscaling nutzt keine Text-Prompts. Ein leerer String wird automatisch gesetzt. |

Der Parameter `duration` wird ebenfalls ignoriert – der Server erkennt die Dauer für die Abrechnungsgenauigkeit direkt aus der Videodatei.

***

## Preise

Die Preise basieren auf **Dauer**, **Output-Auflösungs-Tier** und **Bildrate**. Der Output-Auflösungs-Tier ergibt sich aus der Höhe des Input-Videos multipliziert mit dem Upscale-Faktor.

### Output-Auflösungs-Tiers

| Tier | Output-Höhe | Pro-Sekunde-Rate |
| - | - | - |
| 720p | ≤ 720 px | \~\$0,013 |
| 1080p | 721–1080 px | \~\$0,025 |
| 4K | > 1080 px | \~\$0,10 |

<Note>
  Videos mit Bildraten über 48 fps kosten das 2-fache der Pro-Sekunde-Rate.
</Note>

### Preisbeispiele

| Input | Upscale-Faktor | Output | Dauer | Geschätzte Kosten |
| - | - | - | - | - |
| 480p, 30fps | 2× | 960p (1080p-Tier) | 10 s | \~\$0,25 |
| 720p, 30fps | 2× | 1440p (4K-Tier) | 10 s | \~\$1,00 |
| 1080p, 30fps | 2× | 2160p (4K-Tier) | 30 s | \~\$3,00 |
| 360p, 24fps | 4× | 1440p (4K-Tier) | 10 s | \~\$1,00 |
| 480p, 60fps | 2× | 960p (1080p-Tier) | 10 s | \~\$0,50 |

Nutze die [Video-Quote-API](/api-reference/endpoint/video/quote), um vor dem Einreichen die genauen Kosten zu erhalten.

### Quote abrufen

```bash theme={null}
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"
  }'
```

`video_url` ist für Quotes auf Upscale-Modellen **erforderlich** – der Quote-Endpoint ruft die Datei ab und ermittelt Dauer, FPS und Höhe aus den Bytes, sodass du sie nicht angeben musst. Wird es weggelassen, kommt `400` mit *"video\_url is required for quotes on this model"* zurück.

<Warning>
  Die Quote- und Queue-Endpoints benennen den Upscale-Faktor derzeit unterschiedlich: `/video/queue` nimmt `upscale_factor` (`1`, `2` oder `4`), während `/video/quote` den Faktor aus `resolution` (`"2x"` oder `"4x"`) liest. Das Senden von `upscale_factor` an den Quote-Endpoint hat keine Wirkung – er fällt auf den Default `"2x"` zurück und gibt einen 2x-Preis für einen möglicherweise 4x-Job zurück. Übergib beim Quoten eines 4x-Upscales `resolution: "4x"`.
</Warning>

***

## Fehlerbehebung

| Problem | Wahrscheinliche Ursache | Lösung |
| - | - | - |
| `"Use upscale_factor instead of resolution"` | `resolution` wurde im Request übergeben | `resolution` entfernen und stattdessen `upscale_factor` verwenden |
| Höhere Kosten als erwartet | Input-Video hat hohe Auflösung oder hohe FPS | Input-Dimensionen über den Quote-Endpoint prüfen. 720p+-Input mit 2×-Upscale landet im 4K-Pricing-Tier. |
| Job dauert lange | Großes oder langes Video | Upscaling ist rechenintensiv. Längere Videos und höhere Upscale-Faktoren brauchen proportional länger. |
| `"Insufficient balance"` | Kontoguthaben zu niedrig | Credits unter [venice.ai/settings/api](https://venice.ai/settings/api?utm_source=venice-api-documentation) aufladen |


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