Keys / Fly.io

FLY_API_TOKEN

The Fly.io token flyctl deploys with in CI, and your scripts call the Machines API with.

Starts with
FlyV1 fm2_
Expires
you choose with --expiry; 20 years by default
API
create, list and revoke, with fly tokens

Get it

Create one on fly.io/dashboard. The steps aren't recorded yet.

Set it

FLY_API_TOKEN=FlyV1 fm2_...

flyctl reads it when FLY_ACCESS_TOKEN isn't set; elsewhere, the app passes it in. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Run fly tokens create deploy for one app, or fly tokens create org, with the same scope as the old token.
  2. Deploy it everywhere that reads FLY_API_TOKEN. Keep the FlyV1 part and the space.
  3. Check that nothing still uses the old token, then find its ID with fly tokens list, or fly tokens list --scope org for an org token, and run fly tokens revoke <id>.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16