Authentication
Every request proves who it is with an API key, sent as a Bearer token in the Authorization header.
Bearer API keys
Send your key in the Authorization header of every request: Authorization: Bearer fr_live_…. A request without a valid key gets 401 unauthorized.
The API answers keys only. A signed-in browser session from framera.ai is refused on /v1, so a key is always needed and your users' sessions can never be used to spend your balance.
Key prefixes
| Prefix | What it is |
|---|---|
fr_live_ | An API key from the developer console. Real results, charged to your balance on success. |
aiv_ | Keys made on framera.ai before the developer platform keep working, with every permission. |
Restricted keys
Give each app or service a key that can do only what it needs. When you create a key in the console you can set:
- Permissions:
all, or any offilms,avatars,ugc,images,tools,audioandswap, one per product. Every key can read jobs, models, balance and events;readalone gives a read-only key, which cannot upload files or create anything. Managing webhook endpoints needsall. A create the key may not make gets403 permission_deniedwithdetails.reason: "key_permission". - A monthly spend limit in dollars. A create that would take the key's spending this month past it is refused with
403 permission_deniedanddetails.reason: "key_monthly_limit", until the next month or until you raise it. - Allowed IP addresses, single addresses or IPv4 CIDR ranges such as
198.51.100.0/24. Requests from anywhere else get403 permission_deniedwithdetails.reason: "ip_not_allowed".
Rotating and revoking keys
To change a key without downtime:
- Create a new key with the same permissions in the console.
- Deploy it to your servers alongside the old one, then switch your app to the new key.
- Check the old key's Last used time in the console. When it stops moving, revoke it.
Revoking takes effect at once: the next request with that key gets 401 unauthorized. Jobs it already started carry on and finish normally.
Never use a key in a browser or mobile app
If your users start jobs from your app, have the app call your backend, which checks the user and then calls Framera with your key. If a key leaks, revoke it in the console straight away and create a new one.