# Create a Hugging Face API Token

To be able to interact with the Hugging Face community, you need to create an API token. Let's take a look at the steps.

1. Sign up for Hugging Face  
    If you haven't gotten an account yet, sign up here: [https://huggingface.co/join](https://huggingface.co/join)
    
2. Hover over the account icon in the upper right corner and choose "settings"
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722413832673/099eb427-0cf0-49f6-94c2-95320b0c95b4.jpeg align="center")
    
3. From the left menu, choose "Access Tokens"
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722413686541/5f2ab53c-27c8-4d60-a187-b8f1e112038e.png align="center")
    
4. Then, choose "Create New Token"
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722413991370/6056748e-21d3-43f8-abd8-f473308d4a8b.png align="center")
    
5. For most cases, I choose "Fine-grained" and give it these three permissions:
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722414037406/72eec60a-f9a0-48de-b783-87d5b6dc8af4.png align="center")
    
6. Copy the token and store it somewhere safe (don't worry I've deleted the token from the screenshot below).
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722414126645/be55bab7-62a7-4d19-8187-ba362951746f.png align="center")
    

## Store the Token in a Google Colab Notebook

Cool! You now have access to Hugging Face repos via this token. But how do you use the token? Well, in a Google Colab notebook, you do the following:

1. Select the key icon.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722414589830/041c09de-d20c-4f27-98b8-843e7c779928.png align="center")
    
2. Select "Add new secret".
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722414628261/346df73f-f104-43b8-806e-269e2c3c0954.png align="center")
    
3. Use the following:  
    Name: `HF_TOKEN`  
    Value: `[your token]`
    
4. Then select the toggle to grant "Notebook access"
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722414646316/7bb2ae11-61c0-48ae-8de8-b54e155305fa.png align="center")
    

From within a code block you can now access the token like this:

```python
userdata.get('HF_TOKEN')
```
