Validating Hugging Face API Token

Is there a specific endpoint or method available to verify if a given API token is valid or not ?

I’m working on a project where user has to provide hugging face API token.
Before calling the model, I want to check if provided API is valid or not ?

Hi @kenny91 , the endpoint is api/whoami-v2. I used this one some time ago.

You can also refer to this Stackoverflow thread.