Los modelos de imagen rápidos responden al instante; los vídeos se ejecutan de forma asíncrona mediante webhook o sondeo: el mismo cliente y un único método.
Verificación HMAC-SHA256 con marcas de tiempo que protegen frente a repeticiones. Una línea de código, segura desde el primer momento.
Cada respuesta expone las cabeceras X-RateLimit-* como objetos ya analizados, tanto en los aciertos COMO en los errores. Regula tu ritmo antes de llegar a un 429.
El SDK de JS usa fetch nativo + Web Crypto. El SDK de PHP usa curl + ext-hash. Se integran en cualquier entorno.
Elige el lenguaje más cercano a tu stack: todos los SDK exponen la misma superficie, así que el modelo mental es el mismo.
Instalación
npm install @flixly/sdkInicio rápido
import { Flixly } from "@flixly/sdk";
const flixly = new Flixly({ apiKey: process.env.FLIXLY_API_KEY! });
const result = await flixly.generateAndWait({
model: "flux-dev",
prompt: "A cat wearing a top hat, oil painting style",
type: "TEXT_TO_IMAGE",
input: { aspect_ratio: "1:1", resolution: "1K" },
});
console.log(result.data.output_url);
// → https://cdn.flixly.ai/outputs/...Verificar webhooks
// Verify incoming webhooks in your handler
import { Flixly } from "@flixly/sdk";
const valid = await Flixly.verifyWebhookSignature({
secret: process.env.FLIXLY_WEBHOOK_SECRET!,
timestamp: req.headers["x-flixly-timestamp"]!,
signature: req.headers["x-flixly-signature"]!,
body: rawBody, // raw, NOT JSON.parse + re-stringify
});
if (!valid) return res.status(401).end();Instalación
composer require flixly/sdkInicio rápido
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 wearing a top hat, oil painting style',
'type' => 'TEXT_TO_IMAGE',
'input' => ['aspect_ratio' => '1:1', 'resolution' => '1K'],
]);
echo $gen['data']['output_url'];
// → https://cdn.flixly.ai/outputs/...
} catch (FlixlyError $e) {
error_log("Flixly: {$e->getErrorCode()} {$e->getMessage()}");
}Verificar webhooks
// Verify incoming webhooks in your 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
);
if (!$valid) {
http_response_code(401);
exit;
}Lleva Flixly a tus herramientas de automatización actuales: n8n, WordPress, Shopify y muchas más. Sin instalar ningún SDK.
Ver los plugins de plataformas¿Desarrollas en un lenguaje para el que no publicamos SDK? Llama directamente a la API REST: abajo tienes la especificación completa legible por máquinas.
Impórtala en Postman, n8n, Make o la herramienta de generación de código que prefieras.
Documentación endpoint por endpoint, autenticación, límites de peticiones y códigos de error.
Formato de los eventos, verificación de firmas HMAC y política de reintentos. Olvídate del sondeo.
Emite claves con límites de gasto por clave y URL de webhook predeterminadas.