---
title: "n8n OpenAI compatible API setup for uncensored models"
canonical: https://unrestrictable.ai/guides/n8n
generated: 2026-11-16T02:57:39.340Z
source: https://unrestrictable.ai/guides/n8n
base_url: https://api.unrestrictable.ai/v1
---

# Run an uncensored model inside n8n

Point n8n’s OpenAI credential at a new Base URL, add the OpenAI Chat Model under an AI Agent, type the model id, turn off the Responses API, fix the errors.

Steps checked October 25, 2026 · prices as of November 16, 2026

n8n's OpenAI credential has a Base URL field, and that field is the whole bridge to this API. Set it, hang the OpenAI Chat Model sub-node under an AI Agent, type an uncensored build's id, and your workflows run on it. The guide walks that path, then the mistakes that stop the credential test or the first run. Field labels were taken from n8n's source on 25 October 2026.

If a build with its refusal training stripped out is new to you, read [abliterated vs uncensored](https://unrestrictable.ai/blog/abliterated-vs-uncensored) first, then return to wire one in.

## What you need

- A key from the [console](https://app.unrestrictable.ai/console). Keys begin with `sk-unr-`; the balance is prepaid, with top-ups from $10.
- An n8n instance with the AI nodes: AI Agent and OpenAI Chat Model, or the Basic LLM Chain.
- A model id from the [models page](https://unrestrictable.ai/models); `glm-5.3-flash-uncensored` is used below.
- To try a build before you build a workflow, chat with it at [/chat](https://unrestrictable.ai/chat), free each day without an account, or in Telegram through [the bot](https://unrestrictable.ai/telegram).

## Two things people mean by n8n OpenAI-compatible API

Search for the phrase and you get two unrelated setups mixed together. In one, a workflow calls an outside model. In the other, a workflow is published so that other software can call it as if it were OpenAI. Only the first is covered here: this API serving as the model behind n8n's AI nodes.

Every label below was checked against the n8n source on GitHub on 25 October 2026, when n8n@2.44.6 was current. The documentation for these nodes still omits the Base URL field; the code has it.

## Four credential fields

The [OpenAI credential](https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/credentials/OpenAiApi.credentials.ts) in n8n carries four inputs. Set them as follows:

- API Key: sk-unr-live-… From the console; copy it when it appears, it is shown only once
- Organization ID (optional): (empty) This API ignores it
- Base URL: https://api.unrestrictable.ai/v1 Takes the place of https://api.openai.com/v1
- Add Custom Header: off Leave off; nothing extra is required

Saving runs a test: a GET to `/models` beneath the Base URL. The call costs nothing here, and it is identical to the curl in the terminal section further down. From node version 1.1 onward the OpenAI Chat Model reads its Base URL from the credential rather than from a node option.

## Wire the model into a workflow

1. Make a key in the [console](https://app.unrestrictable.ai/console) if you have not already.
2. Start the workflow with a trigger; a chat trigger is handy for testing. Add an **AI Agent** node after it.
3. Click the agent's **Chat Model** connector and attach an **OpenAI Chat Model** sub-node.
4. In that sub-node, create a fresh OpenAI credential from the table above and save. The test passes.
5. Change the **Model** field from **From List** to **ID** and enter an id, such as `glm-5.3-flash-uncensored`.
6. Switch **Use Responses API** off.
7. If you want them, open **Options** and set **Maximum Number of Tokens** and **Sampling Temperature**.
8. Return to the agent, write your instructions into the **System Message** option, and run it.

Steps 5 and 6 are the ones that trip people up. The next two sections explain each.

## Why the id goes in by hand

Against OpenAI's own URL, n8n filters the From List dropdown down to OpenAI chat models. Against any other Base URL, the [model search in the node](https://github.com/n8n-io/n8n/blob/master/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/methods/loadModels.ts) shows every id that `/models` returns. For this API that means everything your key may call, the 170 uncensored builds included. You can search that list, but ID mode is faster and cannot be misclicked.

A [community thread](https://community.n8n.io/t/how-to-connect-an-openai-compatible-model-to-ai-agent/162897) about this very setup ended on the same answer: set the model by ID. If you would rather shorten the dropdown, open the key in the console and list your ids under **Models**. `/models` then returns that list alone, and the key is barred from every other id.

## Why Use Responses API goes off

Node version 1.3 of the [OpenAI Chat Model](https://github.com/n8n-io/n8n/blob/master/packages/@n8n/nodes-langchain/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.ts) ships with **Use Responses API** enabled. Enabled, n8n speaks OpenAI's Responses protocol rather than Chat Completions.

Disable it. Every build here is exercised daily at `/v1/chat/completions`, so that is the route proven to work. The Built-in Tools under the same switch (web search, file search, code interpreter) execute on OpenAI's infrastructure and play no part in this setup.

## Agent, chain and tools

The AI Agent in the source today (node version 3.1) requires only the Chat Model connection. Memory and Tool are optional, so an agent with nothing else attached behaves as a plain chat step. The [AI Agent docs page](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/) still asks for at least one tool; should your n8n build insist, the Basic LLM Chain takes the same OpenAI Chat Model sub-node and never asks for tools.

Tools only pay off when the build handles tool calls reliably. The node itself warns as much once the Base URL is changed: tool calling and JSON output are not guaranteed on non-OpenAI models. Try one tool on your chosen build before a workflow relies on it.

One message you will not meet is "Tools Agent requires Chat Model which supports Tools calling". The source raises it only when the attached sub-node has no tool binding whatsoever, and the OpenAI Chat Model always carries one.

## Three builds for unattended work

A workflow fires with nobody watching, and fires often, so the cost of a run weighs more than it does in a chat window. Three builds, with the catalog's figures at render time and the day's result from [the daily real-model check](https://unrestrictable.ai/proof), which puts the same fixed prompt to each model every day:

| Model | Build | Input $/M | Output $/M | Context | Wire formats |
| --- | --- | --- | --- | --- | --- |
| [GLM-5.3 Flash Uncensored](https://unrestrictable.ai/models/glm-5.3-flash-uncensored) glm-5.3-flash-uncensored | Uncensored | $0.1053 | $0.3685 | — | openai |
| [GLM-5.3 Uncensored](https://unrestrictable.ai/models/glm-5.3-uncensored) glm-5.3-uncensored | Uncensored | $0.282 | $0.846 | — | openai |
| [DeepSeek V4.1 Flash Abliterated](https://unrestrictable.ai/models/deepseek-v4.1-flash-abliterated) deepseek-v4.1-flash-abliterated | Abliterated | $0.8488 | $1.6975 | — | openai |

Prices per million tokens, read from the live catalog on 2026-11-16.

| Model id | Today's check | Context window |
| --- | --- | --- |
| [`glm-5.3-flash-uncensored`](https://unrestrictable.ai/models/glm-5.3-flash-uncensored) | Steady since Oct 12 | no figure published |
| [`glm-5.3-uncensored`](https://unrestrictable.ai/models/glm-5.3-uncensored) | Steady since Oct 12 | no figure published |
| [`deepseek-v4.1-flash-abliterated`](https://unrestrictable.ai/models/deepseek-v4.1-flash-abliterated) | Steady since Oct 19 | no figure published |

Context windows from the catalog as of 2026-11-16; check results from /proof when the page was built.

Put the busy steps on the flash build first; promote a step to the full build when its output is not good enough. Switching is one field, the id in the sub-node. Every member of the family is listed on the [uncensored GLM page](https://unrestrictable.ai/uncensored/glm).

## The price of a thousand runs

A worked case: 1,000 runs, each one sending roughly 1,500 tokens of instructions plus trigger data and receiving 400 tokens back.

| Model | 1,000 runs | 30,000 runs |
| --- | --- | --- |
| [GLM-5.3 Flash Uncensored](https://unrestrictable.ai/models/glm-5.3-flash-uncensored) | $0.31 | $9.16 |
| [GLM-5.3 Uncensored](https://unrestrictable.ai/models/glm-5.3-uncensored) | $0.76 | $22.84 |
| [DeepSeek V4.1 Flash Abliterated](https://unrestrictable.ai/models/deepseek-v4.1-flash-abliterated) | $1.95 | $58.56 |

Worked out at render from catalog prices on 2026-11-16: runs times 1,500 times the input rate, plus runs times 400 times the output rate.

When the agent uses tools it sends several requests per run, and each repeats the conversation so far. Scale the figure by the steps your agent takes. The [pricing page](https://unrestrictable.ai/pricing) lists each per-token rate.

## Test the key from a terminal

n8n's credential test sends exactly this request. It is free, so run it in a shell, or in an HTTP Request node with the same URL and header.

```bash
curl https://api.unrestrictable.ai/v1/models \
  -H "Authorization: Bearer sk-unr-live-…"
```

A 200 carrying a list of ids confirms both the key and the Base URL. A 401 tells you how the key is wrong:

```
HTTP 401
{"error":{"message":"No API key was sent.","type":"authentication_error","param":null,"code":"invalid_api_key"}}
```

```
HTTP 401
{"error":{"message":"The API key is not valid.","type":"authentication_error","param":null,"code":"invalid_api_key"}}
```

Bodies captured from the API on 25 October 2026.

## When n8n reports an OpenAI credential error

### The credential test does not pass

Look at the Base URL before anything else: it must read `https://api.unrestrictable.ai/v1`, with the `/v1`. Then the key: it has to come from this console, not from another provider's dashboard. That exact mix-up was the opening reply in the community thread linked above.

### No results in the model list

n8n fills the list from `/models` under the Base URL, and a URL missing `/v1` returns nothing. In ID mode the list is irrelevant.

### 404 model_not_found

The Model field holds an id the catalog does not have. Paste it from the curl response above or from the [models page](https://unrestrictable.ai/models).

```
HTTP 404
{"error":{"message":"No such model: glm-5.3-flash-uncensord.","type":"not_found_error","param":null,"code":"model_not_found"}}
```

### 402 insufficient_balance

Your prepaid balance has run out. Add funds in the console; nothing is billed for a request that was refused.

```
HTTP 402
{"error":{"message":"The prepaid balance does not cover this request. Top up at … to continue.","type":"insufficient_quota","param":null,"code":"insufficient_balance"}}
```

### "Bad request - please check your parameters"

This is n8n's wording when it cannot parse the error it received. The node's [common issues page](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/common-issues/) recommends repeating the call in an HTTP Request node, where the full body is visible. The [docs page](https://unrestrictable.ai/docs) has the Base URL, key format and model ids for other clients too.

## Questions

### Which field in n8n takes a custom OpenAI Base URL?

Base URL, the third field on the OpenAI credential, under API Key and Organization ID. Its default is https://api.openai.com/v1; put https://api.unrestrictable.ai/v1 there instead.

### Will the n8n OpenAI Chat Model accept a model OpenAI does not offer?

Yes. Once the credential’s Base URL points elsewhere, the sub-node lists whatever ids that endpoint returns and takes any id you type in ID mode. See every uncensored id.

### What can replace OpenAI behind the n8n AI Agent?

Any endpoint that speaks the OpenAI chat format, plugged in through the credential. This one serves uncensored and abliterated builds and charges per token against a prepaid balance. See the per-token rates.

### Must the AI Agent have a tool attached?

Not in the current source: the Chat Model is the only required connector. On a version that demands one, the Basic LLM Chain runs the same sub-node without tools.

### Is n8n-openai-bridge the same thing?

No. That community project goes the other way, publishing n8n workflows as an OpenAI-compatible endpoint. Here a workflow consumes a model.

Every model above is on the [uncensored model list](https://unrestrictable.ai/models) with its live price per million tokens. [Per-token pricing](https://unrestrictable.ai/pricing) sets the whole catalog side by side, and the [family directory](https://unrestrictable.ai/uncensored) groups the builds by base model.

[Get a key](https://app.unrestrictable.ai/console) Prepaid from $10, no subscription.

## New models and price changes, once a month.

New uncensored builds with their prices, price moves, and what the daily model check found.
