10000: Auth Error when connecting with Workers AI

I'm getting constant
10000: Authentication Error
when trying to connect with Workers AI locally, (doesn't happen in prod)

 InferenceUpstreamError: 10000: Authentication error
    at Ai._parseError (cloudflare-internal:ai-api:181:24)
    at async Ai.run (cloudflare-internal:ai-api:154:19)


...
 const response = await env.AI.run("@cf/baai/bge-m3", {
       text: [chunks[i]],
});
...


It happens completely at random times, one time it will work and other times it will give this error. I searched the error on Google, and it seems like it's happening with a lot of people in diff parts of code where they interact with workers locally, and it's still not resolved.

I have tried using the Rest API too for the same, but still get this error at random times.
Was this page helpful?