cf_token, api gateway

I've been really struggling to get the ai gateway to work, I can't seem to get an api token that has the correct permissions.

curl https://gateway.ai.cloudflare.com/v1/{redacted}/{redacted}/workers-ai/@cf/huggingface/distilbert-sst-2-int8 \
 --header 'Authorization: Bearer {redacted}' \
 --header 'Content-Type: application/json' \
 --data '{ "text": "Cloudflare docs are amazing!" }'

gives me an error
{"success":false,"result":[],"messages":[],"error":[{"code":2009,"message":"Unauthorized"}]}
Was this page helpful?