HuggingFaceEndpoint denies the token

I have validated the token with the
huggingface_hub.login(“xxx”) (this works: Login successful)
strong textrepoid=“meta-llama/Meta-Llama-3.1-8B”
*HuggingFaceEndpoint (repo_id=repoid, token=“xxx”)
I get the error
Could not authenticate with huggingface_hub. Please check your API token. (type=value_error)

I have tried multiple times with new tokens.

hi @Kapi3
It seems you use langchain. I don’t know whether this might help or not:

If not please share your script and library version.