1. Go to this page and download the library: Download flixly/sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
flixly / sdk example snippets
use Flixly\Flixly;
use Flixly\FlixlyError;
$flixly = new Flixly(['api_key' => getenv('FLIXLY_API_KEY')]);
try {
$gen = $flixly->generateAndWait([
'model' => 'flux-dev',
'prompt' => 'A cat in a top hat, oil painting style',
'type' => 'TEXT_TO_IMAGE',
'input' => ['aspect_ratio' => '1:1', 'resolution' => '1K'],
]);
echo $gen['data']['output_url']; // cdn.flixly.ai URL
} catch (FlixlyError $e) {
error_log("Flixly: {$e->getErrorCode()} {$e->getMessage()}");
}
$flixly->generate([
'model' => 'veo-3-fast',
'prompt' => 'Cinematic shot of mountains at dawn',
'type' => 'TEXT_TO_VIDEO',
'webhook_url' => 'https://example.com/flixly-webhook',
]);
$body = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_FLIXLY_SIGNATURE'] ?? '';
$timestamp = $_SERVER['HTTP_X_FLIXLY_TIMESTAMP'] ?? '';
$valid = Flixly::verifyWebhookSignature(
getenv('FLIXLY_WEBHOOK_SECRET'),
$timestamp,
$signature,
$body // raw body — do NOT json_decode + re-encode, that breaks the signature
);
if (!$valid) {
http_response_code(401);
exit;
}
$event = json_decode($body, true);
// $event['event'] => "generation.completed" or "generation.failed"
// $event['id'] => task id
// $event['output_url'] => cdn.flixly.ai URL on success