I encountered the following message when trying to select a model in the n8n OpenAI Chat Model node. How should I resolve this?
It looks like you’re running in a browser like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the dangerouslyAllowBrowser option to true, e.g., new OpenAI({ apiKey, dangerouslyAllowBrowser: true }); https://help.openai.com/en/articles/5112595 best practices for api key safety
This error occurs because n8n is running in a browser-like environment (e.g., self-hosted via a local/dev setup or a misconfigured Docker instance), and the OpenAI SDK blocks API calls from such environments by default to prevent credential exposure. Here’s how to fix it
Root Cause
The OpenAI SDK detects a browser-like environment and refuses to load the model list, throwing the dangerouslyAllowBrowser error. This typically happens when n8n is self-hosted and the server-side environment is not properly detected.
Fix Options (in order of recommendation)
Option 1 — Re-create your OpenAI Credentials (most common fix)
-Go to Credentials in n8n’s left sidebar
-Delete your existing OpenAI credential
-Click Add Credential → OpenAI API
-Paste your API key again and save with a new name (e.g., OpenAI Prod 2)
-Go back to your OpenAI Chat Model node and re-select the new credential from the dropdown
-The model list should reload automatically
Option 2 — Update n8n to the latest version
Older n8n versions have known bugs where credentials or the browser environment check misbehaves. Run
# For Docker
docker pull n8nio/n8n
docker-compose up -d
# For npm
npm update -g n8n
Option 3 — Set the N8N_RUNNERS_MODE environment variable (self-hosted)
If you’re running n8n via Docker or a server, ensure it’s not inadvertently running in a browser context by adding this to your environment config:
EXECUTIONS_PROCESS=main
Then restart your n8n instance.
Option 4 — Type the model name manually
As a quick workaround while you fix the root cause, switch the Model field from From list to Expression or Fixed (manual) and type the model name directly (e.g., gpt-4o-mini). This bypasses the dropdown loading issue entirely
Hi @waltho1123 Welcome! that “Could not load list” error on gpt-5-mini happens because the model-fetch call hits the browser check — switch the model field from “From list” to “By ID” and type the model name directly, bypasses the SDK list call entirely.
plug your OpenAI creds into the model node — notice "mode":"id" with "value":"gpt-4o-mini" typed manually instead of fetched from the list, that skips the browser-environment SDK call completely.