How to add extra_body parameters to the OpenAI Chat Model node?

I’m using the OpenAI Chat Model node to connect to an OpenAI-compatible API (specifically, I’m working with a model that requires a custom thinking parameter). Like this:
extra_body={“thinking”: {“type”: “auto”}}
when using LangChain, this is handled very cleanly by passing the custom parameters to an extra_body argument.
My question is: What is the correct way to add this custom thinking parameter to the request body when using the n8n OpenAI Chat Model node?

Describe the problem/error/question

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.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

I think you can use the HTTP node instead of the community Open AI node. You can give it a try.

If that, I won’t be able to use the output parser. why n8n don’t support the extra_body option? :sleepy_face:

you can submit your issue

If you need both custom parameters and output parsing, you would need to implement your own parsing logic in a Code node after the HTTP Request node.

-OpenAI Chat Model node: Has Output Parser, but does not support arbitrary custom parameters in the request body.

-HTTP Request node: Supports custom parameters, but does not have Output Parser; you must handle parsing manually if needed.