EN ▾
Get API key

Open WebUI and n8n: Connect Chat to an Uncensored API

Open WebUI gives you a chat window, n8n gives you automation, and both can use the same OpenAI-compatible endpoint. Here is how to configure each one, and how to chat from an n8n workflow.

Updated

Chat window and workflow board linked by a cable to one API server, showing Open WebUI and n8n sharing an endpoint

Key points

  1. In Open WebUI, add the base URL and key under Admin Settings, Connections, or set two environment variables in Docker.
  2. In n8n, either override the base URL in the OpenAI credential or use an HTTP Request node.
  3. Use the model ID uncensored in both tools.
  4. Keep n8n loops under 8 concurrent requests and turn on retry for 429 responses.

What you are setting up

If you landed here by typing openwebui how to chat n8n, you are probably trying to do two related things: talk to a model in Open WebUI, and call the same model from n8n workflows. Both tools can point at any server that follows the OpenAI chat completions format, so one account covers both.

Open WebUI is a self-hosted chat interface. n8n is a workflow automation tool where you wire nodes together. The API behind them is the same in each case:

  • Base URL: https://api.nofilteraichat.com/v1
  • Model ID: uncensored
  • Auth: an Authorization: Bearer header carrying your key

You need a key first. The API key page walks through sign-up and the one-click $0.50 trial credit, which is enough to test everything below.

Part one: Open WebUI

Option A: the admin panel

If Open WebUI is already running, sign in as an admin and open the Admin Settings, then Connections. Add a new OpenAI API connection with these values:

  1. URL: https://api.nofilteraichat.com/v1
  2. Key: your API key
  3. Save, then use the verify button if your version has one.

Menu names shift a little between releases, so look for the section that lists OpenAI-style connections. After saving, start a new chat and open the model picker. The model uncensored should appear, because Open WebUI loads the list from GET /v1/models.

Option B: environment variables in Docker

If you are starting fresh, pass the settings when you launch the container:

docker run -d --name open-webui -p 3000:8080 \
  -e OPENAI_API_BASE_URL="https://api.nofilteraichat.com/v1" \
  -e OPENAI_API_KEY="$NOFILTER_API_KEY" \
  -v open-webui:/app/backend/data \
  ghcr.io/open-webui/open-webui:main

Open http://localhost:3000, create the first local account, and the model will be waiting in the picker. Note that Open WebUI stores connection settings in its database after first launch. If you change the variables later and nothing happens, edit the connection in the admin panel instead.

Tuning a chat

In the chat controls you can set temperature, top_p, a stop sequence and a system prompt. These pass through to the model. For fiction and roleplay, a temperature between 0.7 and 1.0 gives livelier prose. For factual questions, go lower. If the model starts repeating phrases, raise the frequency penalty a little.

Part two: n8n with the OpenAI node

n8n has a native OpenAI credential. Its configuration includes a Base URL field, which defaults to the official server. Change it and the node talks to your endpoint:

  1. In n8n, create a new credential of type OpenAI.
  2. Paste your API key.
  3. Set the Base URL to https://api.nofilteraichat.com/v1.
  4. Save and attach the credential to an OpenAI Chat Model node or an AI Agent workflow.

The catch is the model field. Some nodes show a dropdown filled from the models list, and some limit the choices to known names. If you cannot select uncensored, switch the field to expression mode and type the ID by hand. If your n8n version still refuses it, use the HTTP Request approach in the next section, which has no such restriction.

With the credential working, you can attach the chat model to an AI Agent node and give it tools. Tool calling is supported by the API (tools, tool_choice, and results as role: "tool"). As with any open-weight model, test the agent on real inputs and keep tool descriptions short and literal.

Part three: chat from an HTTP Request node

The most predictable option is a plain HTTP Request node. It shows exactly what is sent, and it works in every n8n version. Configure the node like this:

  • Method: POST
  • URL: https://api.nofilteraichat.com/v1/chat/completions
  • Authentication: Header Auth, with name Authorization and value Bearer YOUR_KEY (store it as a credential, not in the node)
  • Send Body: on, content type JSON

Set the body to the following, using an expression for the user text:

{
  "model": "uncensored",
  "messages": [
    { "role": "system", "content": "You are a concise story assistant for adult fiction writers." },
    { "role": "user", "content": "{{ $json.prompt }}" }
  ],
  "temperature": 0.8,
  "max_tokens": 600
}

The reply text sits at choices[0].message.content. In the next node, read it with the expression {{ $json.choices[0].message.content }}. The same response also holds a usage block, so you can log token counts to a sheet or a database.

A typical workflow is a webhook trigger, this HTTP node, and a reply node that returns the text. Another common one reads rows from a spreadsheet, generates a draft for each, and writes the results back. You can also test the request outside n8n first with curl:

curl https://api.nofilteraichat.com/v1/chat/completions \
  -H "Authorization: Bearer $NOFILTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","messages":[{"role":"user","content":"Say hello in five words."}]}'

Limits, retries and batches in n8n

A full key allows 8 concurrent requests and 300 requests per minute; a trial key allows 2 and 60. n8n can easily break those numbers, because a node processes every incoming item and may fire them quickly.

In the HTTP Request node, open Options and use Batching: set a batch size of 4 or 6 and an interval of a second or two. Under the node Settings, turn on Retry On Fail with 3 tries and a wait of 5000 ms. That matches the API behaviour: when it is briefly overloaded it returns HTTP 429 with a Retry-After: 5 header. Other 429 codes tell you which limit you hit: rate_limited means too many requests per minute, concurrency means too many at once.

Streaming deserves a note. A streamed request keeps its concurrency slot until the stream ends. In n8n, leave streaming off in the HTTP node, since the workflow waits for the whole answer anyway. Open WebUI streams by default, which is right for a chat window.

Cost of a workflow

Suppose a workflow processes 500 rows, sending 800 input tokens and getting 250 output tokens for each. Input: 500 × 800 = 400,000 tokens, which costs 400,000 × $0.15 / 1,000,000 = $0.06. Output: 500 × 250 = 125,000 tokens, which costs 125,000 × $0.50 / 1,000,000 = $0.0625. The run totals $0.1225, about 12 cents. See the pricing page for top-ups.

Troubleshooting

SymptomLikely causeFix
Open WebUI shows no modelsWrong URL or keyUse the base URL ending in /v1; test GET /v1/models with curl
Docker env changes ignoredSettings already storedEdit the connection in Admin Settings
401 from n8nHeader value missing the word BearerValue must read Bearer, a space, then the key
Open WebUI in Docker cannot reach a local proxylocalhost points at the containerUse the host address, not localhost
429 in the middle of a loopToo many parallel itemsBatch the HTTP node and enable retry
Model not foundName typed wronglyThe only ID is uncensored

Remember the product limits when you design a flow: text chat only, a 100,000 token window shared by prompt and reply, and an 8 MB request body. There is no embeddings endpoint, so keep any vector search on another service. The quickstart has the full request reference, and the integration guide covers more front ends. Prompts sent through the API are not used for training.

The hard rule applies in every tool: no sexual content involving minors. Within lawful adult use, the model is tuned to answer without content refusals, which suits fiction, roleplay and companion apps for adults.

Questions and answers

How do I add a custom OpenAI endpoint to Open WebUI?

Go to Admin Settings, Connections, add an OpenAI API connection with the base URL and your key. Or set OPENAI_API_BASE_URL and OPENAI_API_KEY when you start the Docker container.

Can n8n use a different base URL for OpenAI nodes?

Yes. The OpenAI credential has a Base URL field. If the model dropdown rejects uncensored, type it in expression mode or use an HTTP Request node.

Why does my n8n loop return 429 errors?

You are sending more than 8 parallel requests or more than 300 per minute on a full key. Add batching to the HTTP node and enable Retry On Fail.

Can I use the same key in Open WebUI and n8n at once?

Yes, but both tools share one limit of 8 concurrent requests, so keep workflow batches small while chatting.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key