Skip to main content
fal automatically injects several environment variables into every runner when it starts. These provide your app with authentication credentials, identity information, lifecycle state, and storage paths without any configuration. You access them via os.getenv() just like any other environment variable. These platform variables are separate from your own secrets, which you configure manually and which are also injected as environment variables. Platform variables are always present on every runner; secrets are specific to what you’ve set. Both are available at runtime (in setup() and endpoint handlers) but not during the image build stage.

Authentication

The FAL_KEY variable is set automatically when your app runs with privileged access (the default for deployed apps). The fal client SDKs read it automatically, so you can call other fal endpoints without any additional configuration.
FAL_KEY is scoped to your account (the app owner). Any fal API calls made with this key are billed to you, not to the end user calling your app. If your app chains calls to marketplace models, you pay for those calls on top of your own runner costs.
FAL_KEY is not available during the image build stage. It is only injected at runtime.

App Identity

These are useful for structured logging, metrics tagging, and conditional logic. For example, you might log the runner ID and region with every request so you can correlate issues in the dashboard.

Lifecycle

fal sets this variable at each stage of the runner lifecycle: SETUP during setup(), RUNNING while serving requests, and TERMINATING after a shutdown signal is received. You can read it to make decisions in shared code paths, but for handling shutdown gracefully, use the handle_exit() and teardown() methods on your App class instead of raw signal handlers.

Storage

fal sets HF_HOME to a path on the persistent /data filesystem so that Hugging Face models are automatically cached across runner restarts. The first runner downloads the model weights, and subsequent runners reuse the cached files without re-downloading.

User Secrets

Any secrets you configure are also injected as environment variables alongside the platform variables listed above.

Managing Secrets

Set, update, and scope secrets per environment via CLI, Dashboard, or Python SDK