Is it possible that these network requests could be failing because the workflow is executing in a r

Is it possible that these network requests could be failing because the workflow is executing in a restricted region? I've heard of OpenAI blocking some regions, but I'd be surprised if Cloudflare's own AI product would also block.

I'm having a tough time figuring out another reason why these requests would fail so often. Maybe worth noting, but get requests are ok for the most part, the requests that are failing are post.

Here's an example of the type of request I'm talking about.
      const generatedContent = await step.do("Write content", async () => {
        const ai = new OpenAI({
          apiKey: this.env.CLOUDFLARE_AI_TOKEN,
          baseURL: `https://api.cloudflare.com/client/v4/accounts/{my account id}/ai/v1`,
        });

        const result = await ai.chat.completions.create({
          model: "@cf/meta/llama-3.1-8b-instruct",
          messages: [...example]
        })

        return result.choices[0].message.content;
      })
Was this page helpful?