Download the PHP package cjmellor/fal-ai-laravel without Composer
On this page you can find all versions of the php package cjmellor/fal-ai-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package fal-ai-laravel
Fal.ai Laravel Package
A Laravel package for integrating with the Fal.ai API, providing a fluent interface for AI model execution with built-in webhook support, streaming, and Platform APIs.
[!NOTE] Multi-provider support: This package also includes a Replicate.com.
Features
- Fluent API for building model requests
- Queue and Sync execution modes
- Real-time streaming with Server-Sent Events (SSE)
- Webhook support with ED25519 signature verification
- Platform APIs for pricing, usage, analytics, and cost estimation
- Multi-provider architecture
- Replicate Deployments API for auto-scaling inference
[!WARNING] Upgrading from v1.x? Version 2.0 is a complete architectural rewrite with breaking changes. The configuration structure, API methods, and class namespaces have all changed. You must follow the Upgrade Guide to migrate from v1.x to v2.x.
Installation
Install via Composer:
Publish the configuration:
Add your API key to .env:
Basic Usage
Using a Default Model
Set a default model in your config to omit the model ID:
Queue vs Sync Modes
Queue Mode (Default)
Requests are processed asynchronously. Use webhooks or polling to get results.
Best for: Complex generations, batch processing, production workloads.
Sync Mode
Requests block until complete and return the result directly.
Best for: Simple generations, interactive applications, development.
[!WARNING] Sync mode may timeout for complex requests.
Polling Status & Results
For queued requests, poll for status and retrieve results:
Response Helpers
Streaming
Stream responses in real-time using Server-Sent Events:
[!NOTE] Not all models support streaming. Check model documentation.
Webhook Support
Setting a Webhook URL
Adding a webhook automatically uses queue mode:
[!IMPORTANT] Webhook URLs must use HTTPS and be publicly accessible.
Built-in Webhook Route
The package provides a pre-configured route at /webhooks/fal:
Custom Webhook Endpoint
Create your own endpoint with the verification middleware:
Manual Verification
Webhook Payload
Success:
Error:
Platform APIs
Access Fal.ai Platform APIs for pricing, usage, and analytics.
Pricing
Cost Estimation
Usage
Analytics
Delete Request Payloads
Remove stored input/output data for a request:
Fluent API
Dynamic Methods
Method names are converted from camelCase to snake_case:
Bulk Data
Immutable Methods
Create new instances without modifying the original:
Conditional Methods
Configuration
Error Handling
Replicate Driver
This package includes a driver for Replicate.com.
Setup
Add your Replicate API key to .env:
Usage
Model Format
Replicate models can use two formats:
Official Models:
Custom Models (with specific version):
[!NOTE] The
:versionsuffix is only required for custom models. Official Replicate models use justowner/model.
Checking Status
Replicate uses polling for status:
Key Differences from Fal
| Feature | Fal.ai | Replicate |
|---|---|---|
| Queue/Sync modes | Yes | No (always async) |
| Streaming | Yes | No (use polling) |
| Platform APIs | Yes | No |
| Deployments API | No | Yes |
| Webhooks | Yes | Yes |
Replicate Webhooks
Built-in route available at /webhooks/replicate.
Configure webhook verification in .env:
Deployments
Manage Replicate deployments for auto-scaling model inference.
Create a Deployment
Available Hardware: cpu, gpu-t4, gpu-l40s, gpu-l40s-2x, gpu-a100-large, gpu-a100-large-2x, gpu-h100
List Deployments
Get, Update, Delete
Run Predictions via Deployment
Testing
Security
[!IMPORTANT] Webhook Verification:
- Fal.ai: ED25519 signatures with JWKS
- Replicate: HMAC-SHA256 signatures
Always use HTTPS for webhook URLs and keep API keys secure.
Contributing
Contributions are welcome! Please submit a Pull Request.
License
MIT License. See LICENSE for details.
All versions of fal-ai-laravel with dependencies
hosmelq/sse-saloon Version ^0.1.0
illuminate/support Version ^12.0|^13.0
saloonphp/saloon Version ^3.0