How do you use the whoami endpoint?
The whoami endpoint is listed on your public facing API page here:Hub API EndpointsHowever I cannot curl this endpoint.  It always returns unauthorized.There’s a been a stackoverflow question hanging around that matches my issue exactly, so I’ll link it here:stackoverflow.comHugging face whoami endpoint returns unauthorizedcurl, huggingface-transformersasked bydmigoon09:14PM - 31 Jan 22 UTCIs this endpoint intended to be usable?  If so, how?My intent was to check token validity before trying to use them to run models, so that I could quickly identify bad tokens.Thanks for any help.
2022-03-18T13:29:37Z
Hey there! Thanks for raising!The endpoint was updated towhoami-v2, it seems we missed updating that doc page. Here is a working examplecurl https://huggingface.co/api/whoami-v2 -H "Authorization: Bearer your_token"Note that we also have a Python library with awhoamimethod you can use if that’s useful.huggingface_hub/src/huggingface_hub at main · huggingface/huggingface_hub · GitHub