Acquire a Free Hugging Face Account & Set Up an API Token
To use Hugging Face’s open‑source models and share your own work, you need a free Hugging Face account and an API token. The token lets your local scripts securely download models, datasets, or upload your own.
✅ Step 1: Sign Up
Visit huggingface.co/join.
Create an account using your email, GitHub, or Google.
Confirm your email to activate the account.
✅ Step 2: Create an API Token
Go to your profile menu → Settings.
Click Access Tokens in the sidebar.
Click New token.
Give it a name like study-buddy-token.
For most projects, role = Read is enough (or Write if you plan to push models).
Click Generate token.
You’ll see your token — copy it right away. Keep it safe and private.
✅ Step 3: Login from the Command Line
Run:
Paste your token when prompted.
Your credentials are saved to ~/.huggingface so your Python scripts can connect automatically.
✅ Step 4: Test Your Setup
Try this quick check in Python:
You should see your username and plan info. If so, your account and token are ready!
🔒 Tip: Never share your API token in public notebooks or GitHub. If you do, delete it and make a new one immediately.
➡️ Next: With your account connected, you can choose a foundation model and start building in Chapter 2!
Last updated