xAI Grok Chat Model node always sends presencePenalty with grok-3-mini

On n8n v1.89.2 (self-hosted, Docker) the “xAI Grok Chat Model” node injects the field presencePenalty into the API request even when it is not set in the UI.
The model grok-3-mini-beta rejects that parameter and returns:

It differs from grok-3 (full), which doesn’t complain with the same settings.

To Reproduce

The same request succeeds from curl once presencePenalty is removed.


To Reproduce

  1. Create a new workflow.
  2. Add an AI agent node with xAI Grok Chat Model as model.
  3. Select valid xAI credentials.
  4. Choose Model → grok-3-mini-beta (leave all other fields at their defaults).
  5. Execute the node.

Current behavior

  • The node fails with HTTP 400.
  • Raw payload shows presencePenalty is present although it was never added in the UI and cannot be deleted.

Attempted work-arounds

Attempt Result
Searched under Parameters → Options → Add Option for “Presence Penalty” Not listed as an active property → cannot remove/disable
Manual API call without the field Success

Screenshots

(attached) – shows the node parameters with no properties selected, yet the request still contains presencePenalty.


Additional context

  • Only happens with grok-3-mini-beta and grok-3-mini-fast-beta
  • grok-3 (full) works fine.

Possible fix

Skip or strip presencePenalty when:

  • the selected model is grok-3-mini-beta and grok-3-mini-fast-beta or
  • the UI value is empty/undefined.

If there is a hidden override I missed, please let me know.

Expected behavior

When no value is provided in the UI, the node should omit presencePenalty (or only send it for models that support the option).
Without that field the request succeeds.

Operating System

Ubuntu 24.04.2 LTS

n8n Version

1.89.2

Node.js Version

v20.19.0

Database

SQLite (default)

Execution mode

main (default)

Also encountered the same and try load presencefrequency as {{ null }} but still unable to resolve.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.