Error with AI Workers

Hi All!.

I got this error in Ai Workers when i trying to use the openai/Whisper worker.

Command: curl https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/ai/run/@cf/openai/whisper -X POST -H "Authorization: Bearer TOKEN" --data-binary @audio.mp3

ERROR:
{"errors":[{"message":"TypeError: Cannot read properties of undefined (reading 'value')","code":1000}],"success":false,"result":{},"messages":[]}

If i change the format to .wav i got other error:
Error:
{"errors":[{"message":"InferenceUpstreamError: ERROR 3010: Invalid or incomplete input for the model","code":1000}],"success":false,"result":{},"messages":[]}

Anyone can transcribe an audio correctly??

Regards.

1 Like

You will need the following:

ACCOUNT_ID='0000000000000000...'
TOKEN='abcdefghijk...'
https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/ai/run/@cf/openai/whisper -X POST -H "Authorization: Bearer ${TOKEN}" --data-binary @audio.mp3

You can find your TOKEN via the Cloudflare dashboard (search for token creation). You can find your ACCOUNT_ID (a 32 character long hex number) via the dashboard and/or via a simple curl for https://api.cloudflare.com/client/v4/accounts endpoint.