---
title: Topaz Ampliar video | RunAPI
description: Usa el endpoint de mejora de video para crear una tarea asíncrona.
url: https://runapi.ai/es/docs/api/topaz/upscale-video.md
canonical: https://runapi.ai/es/docs/api/topaz/upscale-video
locale: es
---

> Versión HTML: https://runapi.ai/es/docs/api/topaz/upscale-video
> Índice del sitio para agentes: https://runapi.ai/llms.txt

# Topaz Ampliar video

## Descripción general

Usa el endpoint de mejora de video con un modelo compatible. Usa el ID de tarea devuelto para recuperar su estado, o proporciona callback_url para las entregas documentadas a continuación.

### Inicio rápido

1. Cree una Clave de API y establézcala como RUNAPI_API_KEY.
2. Elija un modelo compatible y envíe una solicitud POST cuyo cuerpo coincida con el esquema de ese modelo.
3. Almacena el ID de tarea devuelto, luego sondea hasta alcanzar un estado terminal o gestiona las devoluciones de llamada documentadas a continuación.

## Endpoint

POST /api/v1/topaz/upscale_video

URL base: https://runapi.ai

Versión de la API: v1

Autenticación: Authorization: Bearer YOUR_API_TOKEN

## Modelos compatibles

Abra una página de modelo para conocer los precios actuales, los límites de velocidad y los detalles de uso comercial.

- [topaz-upscale-video](https://runapi.ai/es/models/topaz/upscale-video)

## Esquema de solicitud

Los campos y los valores permitidos dependen del modelo seleccionado. Cuando se proporciona, callback_url recibe las entregas de tareas documentadas a continuación.

### topaz-upscale-video

```json
{
  "callback_url": {
    "description": "URL de webhook para la entrega de tareas en estado terminal.",
    "type": "string"
  },
  "model": {
    "description": "Identificador del modelo.",
    "required": true,
    "type": "string"
  },
  "source_video_url": {
    "description": "URL pública de vídeo de origen.",
    "required": true,
    "type": "string"
  },
  "upscale_factor": {
    "default": 2,
    "description": "Multiplicador de mejora de video.",
    "enum": [
      1,
      2,
      4
    ],
    "type": "integer"
  }
}
```

## Crear aceptación

HTTP 202 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## Consulta en proceso

HTTP 200 - GET /api/v1/topaz/upscale_video/:id

### Esquema de respuesta

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## Consulta completada

HTTP 200 - GET /api/v1/topaz/upscale_video/:id

### Esquema de respuesta

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "completed",
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
```

## Consulta fallida

HTTP 200 - GET /api/v1/topaz/upscale_video/:id

### Esquema de respuesta

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## Devolución de llamada del cliente: completado

HTTP 200 - POST callback_url

### Esquema de respuesta

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "videos": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "status",
    "videos"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "id": "tsk_reference_demo",
  "status": "completed",
  "videos": [
    {
      "url": "https://file.runapi.ai/reference-video.mp4"
    }
  ]
}
```

## Devolución de llamada del cliente: fallido

HTTP 200 - POST callback_url

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## Errores

HTTP 401 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "Authentication required"
}
```

## Errores

HTTP 401 - GET /api/v1/topaz/upscale_video/:id

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "Authentication required"
}
```

## Errores

HTTP 400 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Mensaje de error legible por personas.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Resumen de validación legible por personas.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Mensajes de validación con clave por campo de solicitud público, con un array de cadenas legibles por personas para cada campo.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### Ejemplo de respuesta

```json
{
  "error": "model must be one of: topaz-upscale-video"
}
```

## Errores

HTTP 402 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "Insufficient balance"
}
```

## Errores

HTTP 429 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "API key credit limit exceeded"
}
```

## Errores

HTTP 409 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "The request uses features that are not supported for the selected model"
}
```

## Errores

HTTP 429 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "Rate limit reached. Please retry later."
}
```

## Errores

HTTP 503 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "Service under maintenance, please try again later"
}
```

## Errores

HTTP 504 - POST /api/v1/topaz/upscale_video

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "The request timed out"
}
```

## Errores

HTTP 404 - GET /api/v1/topaz/upscale_video/:id

### Esquema de respuesta

```json
{
  "properties": {
    "error": {
      "description": "Mensaje de error legible por personas.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Ejemplo de respuesta

```json
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
```

## Ejemplos de código generados

Usa cURL directamente o instala un SDK para tu lenguaje. Cada muestra envía la solicitud validada que se muestra en esta referencia.

### curl

```curl
curl -X POST https://runapi.ai/api/v1/topaz/upscale_video \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"model":"topaz-upscale-video","source_video_url":"https://cdn.runapi.ai/public/samples/video-lowres.mp4"}'
```

### javascript

#### Instalar

```bash
npm install @runapi.ai/topaz
```

```javascript
import { TopazClient } from "@runapi.ai/topaz";

const client = new TopazClient({ apiKey: process.env.RUNAPI_API_KEY });
const task = await client.upscaleVideo.create({
  "model": "topaz-upscale-video",
  "source_video_url": "https://cdn.runapi.ai/public/samples/video-lowres.mp4"
});
```

### python

#### Instalar

```bash
pip install runapi-topaz
```

```python
import os
from runapi.topaz import TopazClient

client = TopazClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.upscale_video.create(
  model="topaz-upscale-video",
  source_video_url="https://cdn.runapi.ai/public/samples/video-lowres.mp4"
)
```

### go

#### Instalar

```bash
go get github.com/runapi-ai/topaz-sdk/go@latest
```

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  topaz "github.com/runapi-ai/topaz-sdk/go/topaz"
)

func main() {
  client, err := topaz.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  task, err := client.UpscaleVideo.Create(context.Background(), topaz.UpscaleVideoParams{
    Model: "topaz-upscale-video",
    SourceVideoURL: "https://cdn.runapi.ai/public/samples/video-lowres.mp4",
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = task
}
```

### ruby

#### Instalar

```bash
gem install runapi-topaz
```

```ruby
require "runapi/topaz"

client = RunApi::Topaz::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
task = client.upscale_video.create(
  model: "topaz-upscale-video",
  source_video_url: "https://cdn.runapi.ai/public/samples/video-lowres.mp4"
)
```

### java

#### Instalar

```kotlin
implementation("ai.runapi:runapi-topaz")
```

```java
import ai.runapi.topaz.TopazClient;
import ai.runapi.topaz.types.UpscaleVideoParams;
import ai.runapi.core.polling.TaskCreateResponse;

public final class Example {
  public static void main(String[] args) {
    TopazClient client = TopazClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TaskCreateResponse task = client.upscaleVideo().create(
        UpscaleVideoParams.builder()
        .model("topaz-upscale-video")
        .sourceVideoUrl("https://cdn.runapi.ai/public/samples/video-lowres.mp4")
            .build()
    );
  }
}
```

### php

#### Instalar

```bash
composer require runapi-ai/topaz
```

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\Topaz\TopazClient;

$client = new TopazClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$task = $client->upscaleVideo->create([
  "model" => "topaz-upscale-video",
  "source_video_url" => "https://cdn.runapi.ai/public/samples/video-lowres.mp4"
]);
```

## Guías relacionadas

- [Autenticación](https://runapi.ai/es/docs/guides/authentication.md)
- [Inicio rápido](https://runapi.ai/es/docs/guides/task-api/quickstart.md)

---

## Más de RunAPI

- [Inicio](https://runapi.ai/es/.md)
- [Catálogo de modelos](https://runapi.ai/es/models.md)
- [Precios](https://runapi.ai/es/pricing.md)
- [Proveedores](https://runapi.ai/es/models)
- [Documentación](https://runapi.ai/es/docs/guides)
- [SDKs](https://runapi.ai/es/sdk.md)
- [CLI](https://runapi.ai/es/cli.md)
- [Servidor MCP](https://runapi.ai/es/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/es/claude-code-vs-cursor.md)
- [Configuración de Cursor API](https://runapi.ai/es/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/es/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/es/contact.md)
- [Contacto](https://runapi.ai/es/contact.md)
- [Términos](https://runapi.ai/es/terms.md)
- [Privacidad](https://runapi.ai/es/privacy.md)
- [Índice del sitio para agentes](https://runapi.ai/llms.txt)

Contacto: contact@runapi.ai

## Datos estructurados

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "es",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/es",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/es/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "es",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/es",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/esicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "es",
    "@type": "TechArticle",
    "headline": "Topaz Ampliar video",
    "description": "Usa el endpoint de mejora de video para crear una tarea asíncrona.",
    "url": "https://runapi.ai/es/docs/api/topaz/upscale-video",
    "mainEntityOfPage": "https://runapi.ai/es/docs/api/topaz/upscale-video"
  }
]
```
