You should see a token api_XXXXXXXX or api_org_XXXXXXX .
However, /huggingface.co/settings/token only provides READ and WRITE tokens. Using them produces
{“error”:“Authorization header is invalid, use ‘Bearer API_TOKEN’”}
And the CURL examples state:
“Authorization: Bearer ${HF_API_TOKEN}”
which is what the READ and WRITE tokens start with unlike the api… tokens mentioned in the getting started.
Could this be because I’m current signed up for the free plan. But it states “Try Inference API: CPU
Up to 30k input characters /month”
It should look something like this (for the GPT2 endpoint):
$ curl -X POST "https://api-inference.huggingface.co/models/gpt2" \
--header "Authorization: Bearer <YOUR READ API TOKEN HERE>" \
-d '{"inputs": "Hi, my name is "}'
[{"generated_text":"Hi, my name is ive only a few hours away from this game and I have just finished buying a pack of 8 and am not in one of your queue anymore. I have been playing with 2-3 players and am a huge die roll"}]