Get started

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

PrefixWhat 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 of films, avatars, ugc, images, tools, audio and swap, one per product. Every key can read jobs, models, balance and events; read alone gives a read-only key, which cannot upload files or create anything. Managing webhook endpoints needs all. A create the key may not make gets 403 permission_denied with details.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_denied and details.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 get 403 permission_denied with details.reason: "ip_not_allowed".

Rotating and revoking keys

To change a key without downtime:

  1. Create a new key with the same permissions in the console.
  2. Deploy it to your servers alongside the old one, then switch your app to the new key.
  3. 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

A key in front-end JavaScript, a mobile app or a public repository can be read by anyone, who can then spend your balance. Keep keys on your server, in environment variables or a secrets manager, and call Framera from your own backend.

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.