# Basic auth on HF API

**URL:** <https://discuss.huggingface.co/t/basic-auth-on-hf-api/51006>\
**Category:** 🤗Hub\
**Created:** [August 16, 2023, 7:13pm UTC](https://discuss.huggingface.co/t/basic-auth-on-hf-api/51006 "2023-08-16T19:13:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nealxgs](https://avatars.discourse-cdn.com/v4/letter/n/7bcc69/32.png) [@nealxgs](https://discuss.huggingface.co/u/nealxgs)\
**Post date:** [August 16, 2023, 7:13pm UTC](https://discuss.huggingface.co/t/basic-auth-on-hf-api/51006/1 "2023-08-16T19:13:27Z")

</div>

Hi,

I was trying to access llama v2 using /api/models which is gated and requires auth. Bearer token works but was wondering if basic auth is also supported. Basic auth seems to have worked for some time in the past few weeks but stopped working recently.

Thank you.

---

<div class="post-metadata">

**Author:** ![severo](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/severo/32/27449_2.png) [@severo](https://discuss.huggingface.co/u/severo)\
**Post date:** [August 18, 2023, 2:05pm UTC](https://discuss.huggingface.co/t/basic-auth-on-hf-api/51006/2 "2023-08-18T14:05:30Z")

</div>

Indeed, basic auth is no more supported. You have to use the API token (`authorization: Bearer hf_...`) mechanism
