Documentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/fal/llms.txt
Use this file to discover all available pages before exploring further.
aisdk/fal is the official fal.ai provider for the PHP AI SDK. It wires fal.ai’s hosted model infrastructure directly into the Generate::* fluent API, so you can produce images, synthesize speech, transcribe audio, and render video from PHP using the same unified interface as every other PHP AI SDK provider.
The package is distributed as a Composer package (aisdk/fal) and requires no separate HTTP configuration — authentication, endpoint routing, and response parsing are all handled for you. It is aligned feature-for-feature with the JavaScript @ai-sdk/fal reference implementation.
Supported Modalities
| Modality | Description | Endpoint |
|---|---|---|
| Image | Text-to-image generation | fal.run (synchronous) |
| Speech | Text-to-speech synthesis | fal.run (synchronous) |
| Transcription | Audio-to-text transcription | fal.run (synchronous) |
| Video | Text-to-video and image-to-video generation | queue.fal.run (async, polled) |
Language (chat/completions) and embedding modalities are not implemented for fal in this package. Attempting to use them will throw a
NoSuchModelException.Model IDs
Model IDs follow fal’s route-segment convention — they are the path portion of the fal API URL for that model. For example:fal-ai/flux/schnell— fast text-to-imagefal-ai/minimax/speech-02-hd— high-definition speech synthesisfal-ai/wizper— speech transcriptionfal-ai/kling-video/v1/standard/text-to-video— text-to-video generation
Fal::model() and the provider will construct the correct request URL automatically.
Endpoints
The package uses two fal.ai endpoints depending on the modality:fal.run— used for image, speech, and transcription requests. Responses are returned synchronously in a single HTTP round-trip.queue.fal.run— used for video generation. Jobs are submitted to the fal queue and polled automatically until a result is available (or the configured timeout is reached). You receive the final$result->video->urlvalue once the job completes.
What Is Not Supported
Language (LLM chat) and embedding modalities are not available through the fal.ai platform in this package. CallingFal::model() in a language or embedding context will throw NoSuchModelException.
Get Started
Installation
Add
aisdk/fal to your project with Composer and set up your API key.Quickstart
Generate your first image, speech, transcription, and video in minutes.
Configuration Overview
Explore all configuration options including base URL overrides and poll timeouts.
Image Models
Browse supported fal image models and generation parameters.
