Forge apps works in development but generates error in production

Am creating an AI app using forge , when I deploy and install the app in developemt and test it , it works perfectly . But in production it fails. Here is my oce:

export const generateDescription = async ({
}) => {
 const response = await api.fetch(
      OpenAIUrl + "/engines/text-davinci-003/completions",
        body: bodyInJSON,
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${OpenAIApiKey}`,

I have alos include permissions in my manifest.yml

        - ''

This is the error,I get from the app:

{ "message": "URL not included in the external fetch backend permissions: undefined/engines/text-davinci-003/completions. Visit for more information.", "name": "REQUEST_EGRESS_ALLOWLIST_ERR", "status": 403 }

Where and how is OpenAIUrl set/defined? (The error message suggests it is undefined in your production environment, so maybe it comes from an environment variable that is not (yet) set there?)

This how I have defined them

const OpenAIApiKey = process.env.OPEN_AI_KEY;
const OpenAIUrl = process.env.OPEN_AI_URL;

Then it seems highly likely that the variable(s) is/are not set in production (yet) - Forge environment variables are defined per environment (--environment <environment> CLI option).


So in the case of production how should I set them?

As linked:

Or check the CLI reference.

:exclamation: Note that you have to redeploy the app for a new/changed variable to be picked up (again, per environment).

Could it be related to: Forge app in production keeps giving webtriger URLs from DEV ???