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

# Obtener estado de vídeo

> Obtiene el estado de una solicitud de generación de vídeo. Consulte cada 20 segundos salvo que use webhooks.

Requiere acceso a la versión preliminar del espacio de trabajo. Consulta [Trabajos de vídeo y procesamiento por lotes](../../guides/async-video-and-batch.mdx) para la configuración, los webhooks y la gestión de resultados.


## OpenAPI

````yaml es/openapi/v1/openapi.localized.yaml GET /videos/{video_id}
openapi: 3.0.3
info:
  title: Phaseo Gateway API
  description: >-
    Una API de pasarela para acceder a diversos modelos de IA mediante endpoints
    compatibles con OpenAI.
  version: 1.0.0
  contact:
    name: Phaseo
    url: https://phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
    description: Enrutamiento global
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core Phaseo Gateway operations.
paths:
  /videos/{video_id}:
    get:
      tags:
        - Gateway
      summary: Obtener estado del vídeo
      description: >-
        Obtiene el estado de una solicitud de generación de vídeo. Consulte cada
        20 segundos salvo que use webhooks.
      operationId: getVideo
      parameters:
        - name: video_id
          in: path
          required: true
          description: ID de la solicitud de generación de vídeo.
          schema:
            type: string
      responses:
        '200':
          description: Respuesta de estado del vídeo
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
components:
  schemas:
    VideoGenerationResponse:
      type: object
      properties:
        id:
          type: string
        polling_url:
          type: string
        websocket_url:
          type: string
          format: uri
          description: >-
            URL de WebSocket para suscribirse a actualizaciones normalizadas del
            ciclo de vida de trabajos asíncronos.
        model:
          type: string
        request_id:
          type: string
        session_id:
          type: string
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
            - cancelled
            - expired
        lifecycle_status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - cancelled
            - expired
          description: >-
            Estado normalizado del ciclo de vida asíncrono para consumidores de
            sondeo, WebSocket y webhooks.
        cancel_url:
          type: string
          format: uri
          nullable: true
          description: Reservado por compatibilidad; actualmente siempre es null.
        output_access:
          type: string
          enum:
            - bytes
            - signed_url
            - both
        generation_id:
          type: string
          nullable: true
        native_video_id:
          type: string
          nullable: true
          description: >-
            ID de vídeo/trabajo nativo del proveedor cuando difiere del ID
            propio de la pasarela.
        created_at:
          oneOf:
            - type: integer
            - type: string
        started_at:
          nullable: true
          oneOf:
            - type: integer
            - type: string
        completed_at:
          nullable: true
          oneOf:
            - type: integer
            - type: string
        object:
          type: string
          example: video
        poll_after_seconds:
          type: integer
          example: 20
        provider:
          type: string
        seconds:
          type: number
        size:
          type: string
        audio:
          type: boolean
        content_url:
          type: string
          description: Presente cuando output_access incluye bytes (endpoint autenticado).
        download_url:
          type: string
          nullable: true
          description: >-
            URL firmada de primera parte para descarga directa cuando el estado
            es completed.
        expires_at:
          type: integer
          nullable: true
          description: >-
            Marca de tiempo Unix (segundos) de caducidad de la download_url
            firmada.
        progress:
          type: integer
          nullable: true
        progress_source:
          type: string
        asset:
          type: object
          nullable: true
          properties:
            id:
              type: string
            mime_type:
              type: string
            bytes:
              type: integer
            sha256:
              type: string
            width:
              type: integer
            height:
              type: integer
            duration_seconds:
              type: number
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/VideoOutput'
        billing:
          $ref: '#/components/schemas/VideoBillingSummary'
        webhook:
          $ref: '#/components/schemas/AsyncWebhookPublicState'
        next_webhook_retry_at:
          type: string
          nullable: true
          description: >-
            Marca de tiempo ISO del próximo reintento programado del webhook del
            usuario, si está en cola.
        last_webhook_progress:
          type: number
          nullable: true
          description: >-
            Último intervalo aproximado de progreso enviado a los consumidores
            de webhooks.
        last_webhook_progress_at:
          type: string
          nullable: true
          description: >-
            Marca de tiempo ISO del envío del intervalo de progreso más reciente
            del webhook.
        last_webhook_dispatched_at:
          type: string
          nullable: true
          description: Marca de tiempo ISO del intento de envío del webhook más reciente.
        usage:
          type: object
          properties:
            cost:
              type: number
            is_byok:
              type: boolean
          additionalProperties: true
        error:
          nullable: true
    VideoOutput:
      type: object
      properties:
        index:
          type: integer
        mime_type:
          type: string
        bytes_available:
          type: boolean
        content_url:
          type: string
          description: Presente cuando output_access incluye bytes.
        download_url:
          type: string
          description: URL firmada de primera parte para esta salida.
        expires_at:
          type: integer
          description: Marca de tiempo Unix (segundos) de caducidad de esta URL de salida.
    VideoBillingSummary:
      type: object
      properties:
        currency:
          type: string
        estimated_provider_cost:
          type: string
          nullable: true
        estimated_user_cost:
          type: string
          nullable: true
        settled_provider_cost:
          type: string
          nullable: true
        settled_user_cost:
          type: string
          nullable: true
        state:
          type: string
          enum:
            - pending
            - estimated
            - settled
            - void
        billable:
          type: boolean
        total_nanos:
          type: integer
          nullable: true
        estimated_nanos:
          type: integer
          nullable: true
        reserved_nanos:
          type: integer
          nullable: true
        reservation_id:
          type: string
          nullable: true
        reservation_status:
          type: string
          nullable: true
        charge_reason:
          type: string
          nullable: true
        charged:
          type: boolean
          nullable: true
        billed_at:
          type: string
      additionalProperties: true
    AsyncWebhookPublicState:
      type: object
      description: >-
        Configuración depurada del webhook asíncrono y estado de entrega. Nunca
        se devuelven secretos; `has_secret` indica si las entregas firmadas
        están habilitadas. Las entregas firmadas incluyen las cabeceras
        x-phaseo-signature, x-phaseo-timestamp, x-phaseo-event-id,
        x-phaseo-event-type, x-phaseo-delivery-key, x-phaseo-attempt y
        x-phaseo-max-attempts.
      properties:
        url:
          type: string
          format: uri
          nullable: true
        events:
          type: array
          items:
            type: string
        has_secret:
          type: boolean
        delivery:
          $ref: '#/components/schemas/AsyncWebhookDeliverySummary'
        attempts:
          type: array
          items:
            $ref: '#/components/schemas/AsyncWebhookDeliveryAttempt'
    AsyncWebhookDeliverySummary:
      type: object
      description: >-
        Resumen público de entrega de webhooks asíncronos gestionados por la
        pasarela. Permite distinguir el estado de ejecución del trabajo del
        estado de entrega del webhook.
      properties:
        total_attempts:
          type: integer
          description: Total de intentos de entrega registrados para este trabajo.
        delivered_events:
          type: integer
          description: Número de claves de entrega que han alcanzado el estado entregado.
        delivered_event_types:
          type: array
          description: Claves de entrega entregadas al menos una vez.
          items:
            type: string
          example:
            - video.completed
        pending_retries:
          type: integer
          description: Número de claves de entrega con un reintento programado actualmente.
        next_retry_at:
          type: string
          nullable: true
          description: Marca de tiempo ISO del próximo reintento programado, si existe.
        last_attempt_at:
          type: string
          nullable: true
          description: Marca de tiempo ISO del intento de entrega más reciente.
        last_attempt_status:
          type: string
          nullable: true
          enum:
            - delivered
            - scheduled_retry
            - failed_permanently
          description: Resultado del intento de entrega más reciente.
        last_response_status:
          type: integer
          nullable: true
          description: Estado HTTP devuelto por el destino del webhook, si está disponible.
        last_delivered_at:
          type: string
          nullable: true
          description: Marca de tiempo ISO de la entrega correcta más reciente.
        last_failure_at:
          type: string
          nullable: true
          description: Marca de tiempo ISO del intento fallido o en reintento más reciente.
        last_error_message:
          type: string
          nullable: true
          description: Mensaje de error de entrega más reciente, si está disponible.
    AsyncWebhookDeliveryAttempt:
      type: object
      description: >-
        Intento reciente de entrega de un webhook asíncrono gestionado por la
        pasarela.
      properties:
        id:
          type: string
          description: Identificador estable del intento para auditoría y depuración.
        delivery_key:
          type: string
          description: Clave de idempotencia para la entrega de este evento.
          example: video.completed
        event_type:
          type: string
          description: Tipo de evento entregado al destino del webhook.
          example: video.completed
        status:
          type: string
          enum:
            - delivered
            - scheduled_retry
            - failed_permanently
        attempt_number:
          type: integer
          description: Número de intento para esta clave de entrega, comenzando en uno.
        max_attempts:
          type: integer
          description: >-
            Máximo de intentos antes de marcar la entrega como fallida
            permanentemente.
        tried_at:
          type: string
          description: Marca de tiempo ISO de este intento.
        delivered_at:
          type: string
          nullable: true
          description: Marca de tiempo ISO de la entrega correcta de este intento.
        next_retry_at:
          type: string
          nullable: true
          description: >-
            Marca de tiempo ISO del próximo reintento tras este intento, si está
            programado.
        response_status:
          type: integer
          nullable: true
          description: Estado HTTP devuelto por el destino del webhook, si está disponible.
        error_message:
          type: string
          nullable: true
          description: Mensaje de error de entrega, si está disponible.
        response_body_preview:
          type: string
          nullable: true
          description: >-
            Vista previa del cuerpo de respuesta del destino del webhook con
            información sensible oculta.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Autenticación con token Bearer

````

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