Search by

runapi-ai / ltx-video

runapi

RunAPI LTX Video Composer package for PHP applications

v0.0.1 2026-11-30 12:56 UTC

This package is auto-updated.

Last update: 2026-11-30 13:12:41 UTC


README

Packagist License

The LTX Video PHP SDK is the language-specific package for LTX Video on RunAPI. Use this package when your application needs Composer installs, associative-array request bodies, task status lookup, and consistent RunAPI errors in PHP.

This README is the PHP package guide for the public ltx-video-php split repository. For model details, use https://runapi.ai/models/ltx-video; for API reference, use https://runapi.ai/docs/api/ltx-video/text-to-video; for SDK docs, use https://runapi.ai/docs/resources/sdks.

Install

composer require runapi-ai/ltx-video

Quick start

<?php

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

use RunApi\LtxVideo\LtxVideoClient;

$client = new LtxVideoClient(); // reads RUNAPI_API_KEY

$imageToVideoTask = $client->imageToVideo->create([
    'model' => 'ltx-2.5-fast-image-to-video',
    'duration_seconds' => 6,
    'fps' => 24,
    'output_resolution' => '720p',
    'prompt' => 'Make it golden hour',
    'seed' => 1,
    'source_image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
]);

$task = $client->textToVideo->create([
    'model' => 'ltx-2.5-fast-text-to-video',
    'aspect_ratio' => '16:9',
    'duration_seconds' => 6,
    'fps' => 24,
    'output_resolution' => '720p',
    'prompt' => 'A precise product render on white marble',
    'seed' => 1,
]);

$status = $client->textToVideo->get($task->id);

$result = $client->textToVideo->run([
    'model' => 'ltx-2.5-fast-text-to-video',
    'aspect_ratio' => '16:9',
    'duration_seconds' => 6,
    'fps' => 24,
    'output_resolution' => '720p',
    'prompt' => 'A serene mountain lake at dawn',
    'seed' => 1,
]);

echo $result->videos[0]->url . PHP_EOL;

Use create() to submit a task and return quickly, get() to fetch the latest task state, and run() when a script should create and poll until completion. In web request handlers, prefer create() plus webhook or later get() polling so a worker is not held open.

RunAPI-generated file URLs are temporary. Download and store generated files in your own durable storage within the retention window; do not treat returned URLs as long-term assets.

Language notes

Pass request parameters as associative arrays with snake_case keys. The available resources are textToVideo, imageToVideo, audioToVideo. Keep RUNAPI_API_KEY in the environment or your secret manager; never commit API keys or callback secrets.

Links

License

Licensed under the Apache License, Version 2.0.