Overview
There are two main reasons to use key-based authentication:- When calling ready-to-use models
- In headless remote environments or CI/CD (where GitHub authentication is not available)
Generating the keys
Navigate to our dashboard keys page and generate a key from the UI fal.ai/dashboard/keysPermissions
Permissions control what a key can do. When you create a key, you select a preset or a custom permission list. A permission name has parts that colons separate, for examplemodels:requests:submit, serverless:apps:write, or models:list.
Presets
A preset is a permission list that fal curates for a common case. If you only consume ready-to-use models, use theAPI preset.
If you are not sure which preset to select, start with
API. You can create a
second key with more permissions when you need one.Custom policies
If no preset matches your case, select the exact permissions the key needs. A custom policy is useful when you must grant one narrow capability, such as a key that only submits requests to your own app.Allowed models
You can limit a key to a list of models in the Allowed models tab when you create the key. You cannot change the limit after creation. A key with this limit can only call the models on the list.How a key resolves its permissions
A key resolves its permissions under one of two contracts:- A preset key stores only the preset name. fal curates the presets and can refine a definition, and the key follows the live definition. A change to the preset applies to the key at its next request.
- A custom policy key stores the full permission list. The list is a snapshot from the moment of creation, and fal does not redefine it.
Expiration
When you create a key, you can set it to expire after a period from 1 hour to 1 year, or never. The keys page shows an Expiring soon badge before a key expires, and an Expired badge after. An expired key cannot authenticate requests. To replace it, create a new key.Legacy scopes
Keys created before presets carry the legacyADMIN or API scope, and they continue to work. An ADMIN key has full access to the account, and the closest preset is FULL. An API key can call models, and the closest preset is API. To move a legacy key to the preset model, create a new key with a preset and revoke the old key.