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.

Before installing, make sure your environment meets the following prerequisites: PHP 8.3 or higher, Composer (any recent version), and a fal.ai API key obtained from your fal.ai dashboard. No other runtime dependencies need to be configured manually.

Composer Install

1

Require the package

Run the following command in your project root to add aisdk/fal and its dependencies:
composer require aisdk/fal
2

Obtain a fal.ai API key

Sign in to fal.ai and navigate to your account settings to create an API key. Keep this key secure and never commit it to version control.
3

Set the environment variable

Export your API key before running your application. The provider reads FAL_API_KEY automatically:
export FAL_API_KEY=your_key
You can also set this in a .env file and load it with your preferred environment-loading library, or pass it directly as apiKey when calling Fal::create().The provider also recognises FAL_KEY as a fallback key name (matching the upstream JavaScript SDK convention), and FAL_BASE_URL to override the default https://fal.run base URL.

Package Details

PropertyValue
Packagistaisdk/fal
PHP requirement^8.3
Core dependencyaisdk/core ^0.8.0
LicenseMIT
aisdk/core is a required dependency of aisdk/fal and is pulled in automatically by Composer — you do not need to require it separately in your composer.json.

Build docs developers (and LLMs) love