Keys / Cloudflare

CLOUDFLARE_API_TOKEN

The Cloudflare API token your app, Wrangler or CI calls the Cloudflare API with.

Expires
you choose, or never
API
create, list, roll and delete, with a token that can edit API tokens

Get it

Create one on dash.cloudflare.com/profile/api-tokens. The steps aren't recorded yet.

Set it

CLOUDFLARE_API_TOKEN=...

The TypeScript, Python and Go SDKs read it when you don't pass a token, and Wrangler reads it in CI and other automation. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Create a new token with the same permissions, IP filters and expiration. keypin rotate refuses a Global API Key or a Wrangler login; it replaces API tokens only.
  2. Deploy it everywhere that reads CLOUDFLARE_API_TOKEN.
  3. Check that nothing still uses the old token, then delete it.
  4. Or select Roll in the old token's menu: the new one keeps its permissions, but the old one stops working at once.
Sources, checked 2026-11-16