I’m encountering an issue with the OpenAI node (using the “Message a Model” operation) and would appreciate any insights on how to fix it.
I have set up the node to send a simple text message. As you can see in the attached screenshot, the parameters are filled out:
Type: Text
Role: User
Prompt: Hi
However, when I click “Execute step”, it fails with this output:
Bad request - please check your parameters
messages must be a non-empty array, got null
It seems like the node is sending a null payload instead of the array of messages I configured in the UI.
Additional Context:
I am using a custom model name (CSU/PRO/GLM-5.1) via a custom base URL.
Has anyone experienced this UI glitch or payload formatting issue before? Is there a workaround to ensure the node correctly packages the messages into the JSON array?
Thanks in advance for your help!
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
@CuO think i can actually pin it now. , I researched into it more, n8ns v2 message a model targets openais newer Responses api, which sends the prompt in an input field, not a messages array. your custom gateway almost certainly only speaks the older chat/completions api, so it receives a body with no messages key and hands back exactly that, got null, so its not really your config. two ways round it, use the legacy openai node (1.4, it still hits chat/completions) if you can pick the node version, or the http request node straight to your gateways /chat/completions with the messages array. same v2 responses-api root cause as this solved thread
This is a known behavior that occasionally surfaces when using custom base URLs and custom model names (like CSU/PRO/GLM-5.1), as the node’s internal validation logic may fail to recognize the custom model, leading it to send an incomplete or null payload:
1)In recent n8n versions, the Base URL has been moved from the node parameters to the Credentials settings.
Go to Credentials →→ Select your OpenAI credential.
Ensure the Base URL is entered there (e.g., https://your-proxy-url.com/v1).
Crucial: Ensure you include the /v1 suffix if your provider requires it, as some gateways fail to route requests correctly without it.
2)The model name CSU/PRO/GLM-5.1 contains slashes. Some versions of the OpenAI node attempt to validate the model name against a known list or a /models endpoint. If the validation fails or the custom name triggers a parsing error, the node may “give up” on constructing the payload.
Try wrapping the model name in an expression (click the gear icon →→ Expression) and enter it as a string: {{ "CSU/PRO/GLM-5.1" }}. This sometimes bypasses UI-level validation glitches.
3)If the native OpenAI node continues to send a null payload, the most reliable fix is to use the HTTP Request node. This bypasses n8n’s internal OpenAI wrapper and allows you to send the exact JSON the API expects.