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.
Fal (class AiSdk\Fal) is the top-level static entry point. It manages a singleton FalProvider instance so you do not need to construct providers manually across your application.
Fal::create()
Creates a new FalProvider from the given config array, sets it as the singleton default, and returns it.
Optional associative configuration array. Accepted keys:
The newly created
FalProvider instance. This instance is also stored as the singleton returned by future Fal::default() calls.Fal::default()
Returns the current singleton FalProvider, creating one from environment variables if none exists yet.
Fal::create() has not been called), the singleton is lazily initialised by calling Fal::create() with an empty config array and resolving credentials from the environment.
The current singleton
FalProvider instance.Fal::model()
Delegates to Fal::default()->model($modelId) and returns the appropriate model instance based on usage context.
The fal.ai route segment that identifies the model, e.g.
fal-ai/flux/schnell.A
Model instance resolved from the singleton FalProvider.Fal::model() is a shorthand for Fal::default()->model(). The correct way to use a model is by passing the result to a generation call such as Generate::image()->model(Fal::model('fal-ai/flux/schnell')). See FalProvider for details on the provider internals.Fal::reset()
Clears the singleton instance. Useful in tests to reset state between test cases.
reset(), the next call to Fal::default() or Fal::model() will create a fresh provider from the environment.
