Skip to main content

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

ModalityDescriptionEndpoint
ImageText-to-image generationfal.run (synchronous)
SpeechText-to-speech synthesisfal.run (synchronous)
TranscriptionAudio-to-text transcriptionfal.run (synchronous)
VideoText-to-video and image-to-video generationqueue.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-image
  • fal-ai/minimax/speech-02-hd — high-definition speech synthesis
  • fal-ai/wizper — speech transcription
  • fal-ai/kling-video/v1/standard/text-to-video — text-to-video generation
Pass any valid fal model route to 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->url value 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. Calling Fal::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.

Build docs developers (and LLMs) love