# Invalid credentials in Authorization header

**URL:** <https://discuss.huggingface.co/t/invalid-credentials-in-authorization-header/147157>\
**Category:** Course\
**Created:** [March 24, 2025, 9:09am UTC](https://discuss.huggingface.co/t/invalid-credentials-in-authorization-header/147157 "2025-03-24T09:09:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DivyanshJain](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@DivyanshJain](https://discuss.huggingface.co/u/DivyanshJain)\
**Post date:** [March 24, 2025, 9:09am UTC](https://discuss.huggingface.co/t/invalid-credentials-in-authorization-header/147157/1 "2025-03-24T09:09:25Z")

</div>

Dear Team,

I am currently enrolled in the Agents course and encountered an error while attempting to run the Smol\_Agents notebook. Specifically, I received an error when using `model=HfApiModel()` with my free Hugging Face API key.

Could you please assist me in resolving this issue?  
++++++++++++++++++++++++++++++++++++++++++++++++++  
**Error:**  
Invalid credentials in Authorization header  
++++++++++++++++++++++++++++++++++++++++++++++++
