CORTEXFLOW · FREE FOREVER

Automation

Fix n8n Assistant's 400 reasoning_effort Error on OpenAI-Compatible Endpoints

Fix n8n Assistant's 400 reasoning_effort Error on OpenAI-Compatible Endpoints
FIG. 01 — Fix n8n Assistant's 400 reasoning_effort Error on OpenAI-Compatible EndpointsSCALE 16:9

You self-host n8n, point n8n Assistant at an OpenAI-compatible endpoint — a gateway, Langdock, or a local proxy — and the setup completes without a single warning. Then your first message to the Assistant dies with a 400 error about reasoning_effort and function tools. The error reads like a model problem, but it is a routing problem: how you configured the Assistant decides which API shape n8n uses, and one of those shapes cannot carry this request. By the end of this post you will know why the UI setup path triggers the error, how to fix it with environment-based configuration, and how to verify the fix.

Quick definitions: n8n Assistant is the built-in AI assistant in self-hosted n8n (the instance-ai module) that builds and edits workflows using tools. reasoning_effort is the parameter that controls how much a reasoning model thinks before answering. Chat Completions (/v1/chat/completions) and the Responses API (/v1/responses) are two different OpenAI API shapes — and some reasoning models reject the combination of function tools plus reasoning_effort on Chat Completions while accepting it on Responses.

The symptom: a 400 on your first Assistant message

The reported failure looks like this (n8n 2.48.5, Docker, Postgres, Langdock endpoint with a Daytona sandbox):

Error: 400 Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.

The setup itself appears complete — no errors while configuring. The failure only shows up when you send a message. Swapping models does not help: the reporter hit the same error with gpt-6.1-terra, gpt-6-luna, and gpt-5.6-sol, with only the model name in the message changing. That model-independence is your first clue that the model is not the problem.

The root cause: the UI setup path always uses Chat Completions

n8n Assistant has two configuration paths, and they route differently. This was worked out in the community thread and confirmed by the reporter on November 20, 2026:

  • Configured through the Assistant UI with an OpenAI credential that has a custom URL, n8n assigns the internal provider custom. That provider always uses the OpenAI-compatible Chat Completions adapter. There is no /responses discovery or fallback negotiation on that path.
  • Configured through the container environment with an explicit openai/ model, n8n takes a different path and tries Responses first.

The Assistant always sends function tools (that is how it builds workflows), and it sets a default reasoning effort for OpenAI models. On the UI path, that combination lands on /v1/chat/completions, where reasoning models reject it with the 400 above. The error message even names the two exits: use /v1/responses, or set reasoning_effort to none. The fix below takes the first exit properly, and keeps the second as a workaround.

Pick your fix

FixWhat changesTrade-off
A. Environment setup (preferred)Model configured via N8N_INSTANCE_AI_MODEL with an openai/ prefixKeeps reasoning; reporter-confirmed
B. Reasoning off (workaround)N8N_INSTANCE_AI_REASONING_EFFORT=none, UI setup staysAssistant answers without reasoning effort

Before you start

You need a self-hosted n8n with n8n Assistant enabled, access to the n8n container’s environment (your .env file or docker-compose.yml), and your provider’s base URL and API key. Replace these placeholders everywhere below:

  • <your-model> — your provider’s model ID, for example gpt-5.6-sol
  • <your-base-url> — the provider’s base URL, for example https://your-gateway.example.com/v1
  • <your-api-key> — the API key for that endpoint

Step 1 - Confirm you are hitting this bug

Check three things. First, the error mentions both reasoning_effort and /v1/chat/completions. Second, you set up the Assistant through the UI with a custom endpoint URL. Third, your model is a reasoning model. If all three hold, continue. If your error names a different parameter or endpoint, you have a different bug — do not apply this fix blindly.

Step 2 - Configure the Assistant model through the environment

Set these three variables on the n8n service:

N8N_INSTANCE_AI_MODEL=openai/<your-model>
N8N_INSTANCE_AI_MODEL_URL=<your-base-url>
N8N_INSTANCE_AI_MODEL_API_KEY=<your-api-key>

Here is what each one does:

  • N8N_INSTANCE_AI_MODEL selects the model in provider/model format. The openai/ prefix is the load-bearing part: it puts the Assistant on the path that tries Responses first, instead of the UI path’s Chat-Completions-only custom provider.
  • N8N_INSTANCE_AI_MODEL_URL points n8n at your OpenAI-compatible endpoint. Use the base URL only — do not append /responses or /chat/completions; n8n appends the right path itself.
  • N8N_INSTANCE_AI_MODEL_API_KEY is the key for that endpoint.

This matches n8n’s own Assistant setup documentation, which configures the Assistant through environment variables and uses N8N_INSTANCE_AI_MODEL_URL for local or custom OpenAI-compatible endpoints. Leave your existing sandbox variables untouched — this fix only changes how the model is selected.

Warning: If you previously set N8N_INSTANCE_AI_REASONING_EFFORT while experimenting, remove it for this fix. The environment path works without it, and leaving a stale value in place makes the verification step ambiguous.

Step 3 - Recreate the container and check the variables landed

Apply the change:

docker compose up -d

Compose recreates the n8n service when its environment changes. Confirm the two non-secret variables arrived:

docker compose exec n8n printenv N8N_INSTANCE_AI_MODEL N8N_INSTANCE_AI_MODEL_URL

You should see openai/<your-model> and your base URL. Do not print the API key into logs or support tickets — if the first two variables are right, the key was applied by the same mechanism.

Step 4 - Verify with a new Assistant conversation

Open the editor and start a new Assistant conversation — the thread’s confirmed test used a fresh conversation, not the failed one. Send a message that makes the Assistant use its tools, such as asking it to draft a small workflow.

Success looks like this: the Assistant responds and works, with no 400. If the same reasoning_effort error comes back naming /v1/chat/completions, the environment path fell back to Chat Completions for your endpoint. Check which endpoint your provider actually received the request on, then apply Fix B below.

Fix B - Keep the UI setup and turn reasoning effort off

If you must keep the UI-configured credential, take the error message’s second exit:

N8N_INSTANCE_AI_REASONING_EFFORT=none

Recreate the container (docker compose up -d) and test a new conversation. With reasoning effort set to none, the rejected parameter combination disappears and the Chat Completions path works.

The trade-off is real: the Assistant answers without a reasoning budget, which can mean weaker multi-step workflow building. Treat this as a workaround that unblocks you today, and prefer Fix A when you can change the container environment. A third option from the same thread: a non-reasoning model on your endpoint works with tools on Chat Completions, at the cost of giving up reasoning models entirely.

Prevent it next time

  • Configure the Assistant model via environment variables, not the UI credential, whenever you use a custom endpoint. The environment path is the documented one, and it is the only path that tries Responses first.
  • Keep the base URL clean. N8N_INSTANCE_AI_MODEL_URL takes the base URL with no /responses or /chat/completions suffix. Appending either one reintroduces routing confusion.
  • Send one test message after every n8n upgrade or model change. This failure hides until the first real message, so make that message a deliberate test instead of your first real request.
  • Write down your setup path. The UI gives no sign that it routes differently from the environment setup. One line in your runbook — model, endpoint, and “configured via env” — saves the next person this exact debugging session.

Honest limits

This fix is verified on one reported setup: n8n 2.48.5 with Langdock, where the reporter confirmed on November 20, 2026 that the environment configuration works without any reasoning-effort override. The “tries Responses first” behavior comes from a source check in that thread, and the same reply warns the path can fall back to Chat Completions — if your provider has no Responses API, or rejects tools plus reasoning there too, Fix B or a non-reasoning model is your answer. The N8N_INSTANCE_AI_REASONING_EFFORT variable does not appear in the Assistant setup documentation as of November 29, 2026; it comes from the thread’s source analysis, so treat Fix B as a workaround rather than a documented setting. Routing behavior may also change in later n8n releases — the thread itself flags that the UI-versus-environment difference is unclear and may be revisited.

FAQ

I set N8N_INSTANCE_AI_MODEL_URL to my provider’s /v1/responses URL and it still fails. Why?

The variable takes the base URL, and n8n appends the API path itself. Remove the /responses (or /chat/completions) suffix, recreate the container, and test again.

Does this affect AI Agent nodes or the OpenAI Chat Model node?

No. This bug is specific to n8n Assistant’s own model configuration. Custom-endpoint failures inside workflow nodes are a different problem — for Agent Builder specifically, see Fix n8n Agent Builder Failing with Custom OpenAI-Compatible Endpoints.

Will N8N_INSTANCE_AI_REASONING_EFFORT=none hurt Assistant quality?

It removes the reasoning budget, so expect weaker planning on multi-step builds. It is a valid unblock, but the environment setup in Fix A keeps reasoning and is the better long-term configuration.

I use n8n Cloud. Can I apply this?

This guide is for self-hosted n8n, where you control the container environment. The reported error and both fixes come from a self-hosted setup.

Key Takeaways

  1. The 400 is a routing bug, not a model bug — the same error appears across reasoning models because the UI setup path always sends tools plus reasoning_effort to /v1/chat/completions.
  2. The UI path assigns the internal custom provider, which never tries /v1/responses; the environment path with an openai/ model prefix tries Responses first.
  3. The confirmed fix is three variables: N8N_INSTANCE_AI_MODEL=openai/<your-model>, N8N_INSTANCE_AI_MODEL_URL=<base URL>, and N8N_INSTANCE_AI_MODEL_API_KEY, followed by a container recreate.
  4. N8N_INSTANCE_AI_REASONING_EFFORT=none unblocks the UI path but trades away reasoning quality — a workaround, not the destination.

Next step: check how your Assistant model is configured right now. If it came from the UI with a custom URL, move it to the three environment variables in Step 2 and send one test message in a new conversation — that single message tells you whether the routing is fixed.

DOC. CF-RSS-001 · FORMAT: XML

Want more like this?

Practical tutorials on AI agents, automation, and chatbots — straight to your reader.

Subscribe via RSS

Doc. CF-NL-001 · Dispatch

Get the next build in your inbox

One practical email per new post. No spam, unsubscribe anytime.

One email per new post. No spam. Unsubscribe anytime.