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.
FalOptions (class AiSdk\Fal\FalOptions) is the immutable configuration object passed to FalProvider. All constructor parameters are readonly. Use FalOptions::fromArray() to build one (called internally by Fal::create()), or construct one manually if you need to wire FalProvider directly.
Constants
| Constant | Value | Description |
|---|---|---|
DEFAULT_BASE_URL | 'https://fal.run' | The default fal.ai REST API base URL. |
PROVIDER_NAME | 'fal' | The string identifier returned by FalProvider::name(). |
Constructor Parameters
Your fal.ai API key. When using
FalOptions::fromArray(), this is resolved from $config['apiKey'] first, then the FAL_API_KEY environment variable.The API base URL. Any trailing slash is stripped automatically. When using
FalOptions::fromArray(), this falls back to the FAL_BASE_URL environment variable before using the hardcoded default.Extra HTTP headers included in every request alongside the
Authorization header. Useful for adding custom tracing or routing headers.Maximum time in milliseconds to wait while polling for a transcription result before timing out.
How many milliseconds to wait between each poll when checking the status of a video generation job.
Total millisecond timeout for a complete video generation job (defaults to 5 minutes). If this limit is exceeded, polling stops and an error is raised.
An optional
AiSdk\Support\Sdk instance used for internal SDK metadata. Typically omitted; set automatically when the SDK wires up the provider.Methods
FalOptions::fromArray()
Static factory method that builds a FalOptions instance from an associative config array, falling back to environment variables for apiKey and baseUrl.
Associative array of configuration values. All keys are optional when environment variables provide the required values. Accepts the same keys as the constructor:
apiKey, baseUrl, headers, transcriptionPollTimeoutMs, videoPollIntervalMs, videoPollTimeoutMs, sdk.A fully constructed, immutable
FalOptions instance.FalOptions instance and is called automatically by Fal::create().
authHeaders()
Returns the merged authorization header array used internally by all model classes when making HTTP requests.
An array containing
['Authorization' => 'Key {apiKey}'] merged with any extra headers defined at construction time. Custom headers are appended after the authorization header.