How to get a GitHub API key

Checked by hand 2026-10-30

  1. Open the new fine-grained token page. GitHub first asks you to confirm it is you with your two-factor code or an emailed code; that is normal. Then type a name for the token.
  2. Pick an expiration, choose which repositories it can reach, and add only the permissions your app needs. Then click Generate token at the bottom of the page.
  3. Click Generate token in the box that opens. GitHub shows the token only once, on the next page.

What you end up with

  • GITHUB_TOKEN

Do it in one click with Footgun Keys