aisdk / fal
Official fal provider for the PHP AI SDK.
Fund package maintenance!
v0.8.0
2026-07-15 12:23 UTC
Requires
- php: ^8.3
- aisdk/core: ^0.8.0
Requires (Dev)
- laravel/pint: ^1.18
- nyholm/psr7: ^1.8
- pestphp/pest: ^3.0 || ^4.0
- phpstan/phpstan: ^2.0
- rector/rector: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The fal provider package for the PHP AI SDK supports image, speech, transcription, and video generation via fal.run and queue.fal.run, aligned with @ai-sdk/fal.
Installation
composer require aisdk/fal
Configuration
| Variable | Purpose |
|---|---|
FAL_API_KEY |
Primary API key. |
FAL_KEY |
Fallback key name (matches upstream). |
FAL_BASE_URL |
Override default https://fal.run. |
Authorization header: Authorization: Key <api-key>.
Usage
Model ids are fal route segments (for example fal-ai/flux/schnell).
use AiSdk\Generate; use AiSdk\Fal; $result = Generate::image() ->model(Fal::image('fal-ai/flux/schnell')) ->prompt('A minimal desk lamp.') ->run();
Generate::speech() ->model(Fal::speech('fal-ai/minimax/speech-02-hd')) ->input('Hello') ->run();
Video generation submits to queue.fal.run and polls until a video.url is available (timeouts configurable via videoPollIntervalMs / videoPollTimeoutMs).
Language and embedding modalities are not implemented on fal in this package and throw NoSuchModelException.
Documentation
Community
- Contributing
- Support
- For private security reports, email security@phpaisdk.com.
License
MIT.