PHPackages                             flixly/sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. flixly/sdk

ActiveLibrary[API Development](/categories/api)

flixly/sdk
==========

Official Flixly AI SDK for PHP. Generate images, video, audio, and chat completions through Flixly's public API.

v0.1.0(1mo ago)02MITPHPPHP &gt;=7.4

Since Jun 5Pushed 1mo agoCompare

[ Source](https://github.com/Softforge-Digital/flixly-php-sdk)[ Packagist](https://packagist.org/packages/flixly/sdk)[ Docs](https://www.flixly.ai/developers)[ RSS](/packages/flixly-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

flixly/sdk (PHP)
================

[](#flixlysdk-php)

Official PHP SDK for the [Flixly](https://www.flixly.ai) AI API. Targets PHP 7.4+ so it drops cleanly into WordPress plugins and modern PHP backends.

Install
-------

[](#install)

```
composer require flixly/sdk
```

Requirements:

- PHP 7.4 or newer
- `ext-curl`, `ext-json`, `ext-hash` (all standard)

No other dependencies. Drop-in compatible with WordPress.

Quick start
-----------

[](#quick-start)

```
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()}");
}
```

Get an API key at [www.flixly.ai/dashboard/settings/api-keys](https://www.flixly.ai/dashboard/settings/api-keys).

Webhooks (recommended for video / slow models)
----------------------------------------------

[](#webhooks-recommended-for-video--slow-models)

```
$flixly->generate([
    'model'        => 'veo-3-fast',
    'prompt'       => 'Cinematic shot of mountains at dawn',
    'type'         => 'TEXT_TO_VIDEO',
    'webhook_url'  => 'https://example.com/flixly-webhook',
]);
```

In your webhook handler:

```
$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
```

The webhook secret is shown once when you create the API key. Store it on your server like any other secret.

Rate limits
-----------

[](#rate-limits)

Every successful response includes parsed rate-limit info:

```
$res = $flixly->listModels();
print_r($res['rateLimit']);
// ['limit' => 60, 'remaining' => 42, 'resetAtSec' => 1735056000]
```

When a `FlixlyError` is thrown, the rate-limit info is on the exception:

```
try {
    $flixly->generate(['model' => 'flux-dev', 'prompt' => 'hi']);
} catch (FlixlyError $e) {
    $rl = $e->getRateLimit();
    if ($e->getHttpStatus() === 429 && $rl !== null) {
        $wait = max(0, $rl['resetAtSec'] - time());
        sleep($wait);
        // retry
    }
}
```

Chat (OpenAI-compatible)
------------------------

[](#chat-openai-compatible)

```
$res = $flixly->chat([
    'model'    => 'gpt-5-4-mini',
    'messages' => [
        ['role' => 'user', 'content' => 'Explain async/await in one sentence.'],
    ],
]);

echo $res['data']['choices'][0]['message']['content'];
```

Streaming chat is omitted from the PHP SDK by design — most PHP consumers (WordPress plugins, REST endpoints) don't run long-lived streaming inside a request handler. Use the JS SDK or raw curl if you need SSE.

Configuration
-------------

[](#configuration)

```
new Flixly([
    'api_key'    => 'flx_live_...',
    'base_url'   => 'https://www.flixly.ai',  // default
    'timeout_ms' => 120000,                   // default 2 minutes
]);
```

License
-------

[](#license)

MIT

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00d3f265e6aaae7081631b9a54fae04a3663ec1c54aae9c1bc9cc6ae362679ee?d=identicon)[hmzlife](/maintainers/hmzlife)

---

Tags

wordpressaiimage-generationvideo-generationflixly

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/flixly-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/flixly-sdk/health.svg)](https://phpackages.com/packages/flixly-sdk)
```

###  Alternatives

[wordpress/mcp-adapter

Adapter for Abilities API, letting WordPress abilities to be used as MCP tools, resources or prompts

887184.7k8](/packages/wordpress-mcp-adapter)[sybrew/the-seo-framework

An automated, advanced, accessible, unbranded and extremely fast SEO solution for any WordPress website.

47884.4k](/packages/sybrew-the-seo-framework)[wordpress/wp-ai-client

An AI client and API for WordPress to communicate with any generative AI models of various capabilities using a uniform API.

11723.9k3](/packages/wordpress-wp-ai-client)[marceloeatworld/falai-php

\#1 PHP client for the fal.ai serverless AI platform, compatible with Laravel and native PHP, built on Saloon v4

106.1k](/packages/marceloeatworld-falai-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
