Methods:
$client->createVideo(...)
$client->listVideos(...)
$client->getVideo(...)
$client->retrieveVideoContent(...)
$client->getVideoDownloadUrl(...)
$client->cancelVideo(...)
$client->deleteVideo(...)
$client->listVideoModels(...)
$client->getAsyncJobWebSocketUrl(...)
$client->getVideoWebSocketUrl(...)
$client->asyncJobs()->websocketUrl(...)
Example
<?php
require 'vendor/autoload.php';
use AIStats\Sdk\AIStats;
$apiKey = getenv('AI_STATS_API_KEY');
$client = new AIStats($apiKey);
$job = $client->createVideo([
'model' => 'openai/gpt-video-1',
'prompt' => 'A calm ocean at dusk'
]);
$jobs = $client->listVideos([
'status' => 'queued,completed',
'limit' => '2',
]);
$websocketUrl = $client->getVideoWebSocketUrl($job['id'], 1500);
The create response is an async job record. Poll status before attempting content or signed download retrieval.
Use $client->getVideoWebSocketUrl(...) when you want to subscribe to the documented /v1/async/video/{id}/ws lifecycle stream instead of polling only.
Use $client->asyncJobs()->websocketUrl("video", $job['id'], ...) when you want the generic async-jobs resource helper.
Use $client->getAsyncJobWebSocketUrl("video", $job['id'], ...) when you want the same generic helper without going through the resource object.
$client->cancelVideo(...) is exposed, but the public video cancel route currently returns a structured 501 not_implemented_yet error while provider-level cancellation is standardized. Last modified on May 6, 2026