İçeriğe geç

Video işini okuma

Bir video işinin durumunu, ilerlemesini, maliyetini ve tamamlandığında dosyaya giden, bir saat geçerli yeni bağlantıyı okuyun.

Markdown
Bu sayfada
GET/v1/videos/{id}

İşi döndürür. status completed, failed ya da cancelled olana kadar birkaç saniyede bir okuyun. Her okuma dosyaya yeni bir bağlantı imzalar; süresi dolmuş bir output.url işi yeniden okuyarak yenilenir.

Örnek

İstek
curl https://api.getlykia.com/v1/videos/gen-1795463406-qOWSYdRnX7cEsv8q \
  -H "Authorization: Bearer $LYKIA_API_KEY"
Yanıt200
{
    "id": "gen-1795463406-qOWSYdRnX7cEsv8q",
    "object": "video",
    "status": "completed",
    "progress": 100,
    "model": "bytedance/seedance-1.0-pro",
    "provider": "bytedance",
    "created_at": 1795463406,
    "completed_at": 1795463439,
    "expires_at": 1796068239,
    "duration_seconds": 5,
    "params": {
        "duration": 5,
        "aspect_ratio": "16:9",
        "resolution": "720p",
        "image": false,
        "last_frame": false,
        "reference_images": 0
    },
    "usage": {
        "cost": 0.2574,
        "is_byok": false,
        "cost_details": {
            "upstream_cost": 0.2574,
            "platform_fee": 0,
            "is_byok": false
        }
    },
    "output": {
        "url": "https://files.example.com/media/gen-1795463406-qOWSYdRnX7cEsv8q/0.mp4?X-Amz-Expires=3600&X-Amz-Signature=5f0c9e…",
        "expires_at": "2026-11-23T20:50:41.145Z",
        "mime_type": "video/mp4",
        "bytes": 310368
    }
}

İş nesnesi

idstring

İş kimliği; aynı zamanda istek kaydının kimliği (GET /generation).

objectstring

Her zaman video.

statusstring

queued, in_progress, completed, failed ya da cancelled.

progressinteger

Sağlayıcı bildiriyorsa 0–100.

modelstring

Model; hazır ayarla gerçek model.

providerstring

İşi yürüten sağlayıcı.

created_at

, completed_at (integer | null) — Unix zamanları.

expires_atinteger | null

Lykia'nın dosyayı sileceği an (Unix zamanı). Süreyi platform belirler.

duration_secondsnumber | null

Tamamlanınca videonun uzunluğu.

paramsobject

İsteğin özeti: verildiyse duration, aspect_ratio, resolution, audio; image, last_frame, reference_images için gönderilip gönderilmediği ya da kaç tane olduğu.

errorobject

Yalnız failed ve cancelled işlerde: message, code (örneğin timeout), reason ve sağlayıcı reddini ücretlendirdiyse billed_by_provider: true.

usageobject

İş bitince: USD olarak cost, is_byok ve cost_details. Başarısız ya da iptal edilmiş iş, sağlayıcı ücretlendirmediyse 0 tutar.

outputobject

Tamamlanınca: url (imzalı, bir saat geçerli), expires_at (bağlantının çalışmayı bırakacağı an), mime_type, bytes, biliniyorsa width ve height. Lykia'nın depolaması kullanılamıyorsa url null olur ve content, dosyayı akıtan GET /videos/{id}/content yolunu verir.

İptal edilmiş bir iş:

200 OK
{
    "id": "gen-1795463449-mbcwAk5o21bdfuKi",
    "object": "video",
    "status": "cancelled",
    "progress": 0,
    "model": "bytedance/seedance-1.0-pro",
    "provider": "bytedance",
    "created_at": 1795463449,
    "completed_at": 1795463449,
    "expires_at": null,
    "duration_seconds": null,
    "params": {
        "duration": 5,
        "image": false,
        "last_frame": false,
        "reference_images": 0
    },
    "error": {
        "message": "The job was cancelled",
        "code": "cancelled",
        "reason": "invalid_request"
    },
    "usage": {
        "cost": 0,
        "is_byok": false,
        "cost_details": {
            "upstream_cost": 0,
            "platform_fee": 0,
            "is_byok": false
        }
    }
}

Hatalar

İş yoksa ya da başka bir projeye aitse 404.