EN ▾

Uncensored LLM API for developers

Get API key

Open WebUI API: Connect an Uncensored Endpoint

The open-webui api route that most people need is the connection from Open WebUI to a model endpoint. Add a base URL and a key, and the model appears in the picker.

Updated

A chat window connected by a glowing cable to a server, showing a web interface linked to an API endpoint

Quick steps

You can finish this in about two minutes if you already run Open WebUI and have a key. The short version:

  1. Create an account on this site and copy your API key from the key page. New accounts can claim $0.50 of trial credit there, with no payment needed.
  2. In Open WebUI, open the Admin Panel, then Settings, then Connections.
  3. Add a connection in the OpenAI API section. Set the URL to https://api.nsfwgpt.cc/v1 and paste the key.
  4. Save, start a new chat, and choose uncensored in the model selector.

The menu names move around between Open WebUI releases, so if a label differs on your version, look for the section that lists OpenAI API connections. The values stay the same.

Two meanings of open-webui api

The phrase covers two different things, and it is easy to land on the wrong instructions. In the first, Open WebUI is the client and your model lives somewhere else. That is the case this article covers: the interface calls an external OpenAI-compatible API. In the second, you want to call Open WebUI itself from your own scripts, using the API that the application exposes after you create an access key in your account settings. That second API has its own paths and its own documentation, so check the Open WebUI docs for the current details.

The two combine well. Open WebUI sits in front, your scripts call it, and it forwards to the model endpoint you configured. You change the model server in one place, and every script behind the interface follows.

Connect from the admin panel

Go to the connections page and add a new OpenAI-style connection. Three fields matter.

  • URL. Enter https://api.nsfwgpt.cc/v1 including /v1. Do not add /chat/completions; the interface adds the path itself.
  • Key. Paste the bearer key from your account. Open WebUI sends it as Authorization: Bearer <key>.
  • Model IDs. By default Open WebUI reads the list from GET /v1/models, which returns the single model uncensored. Some versions let you list model IDs by hand, which is useful if you want to hide other connections' models.

Most versions have a verify button next to the fields. If it reports success, the URL and key are correct. If you keep another connection to a local runner or another provider, the model picker will show both lists together, and you can give each connection a prefix to tell them apart.

Connect with environment variables

For a Docker setup you can skip the interface and pass the connection at start-up. Open WebUI reads OPENAI_API_BASE_URL and OPENAI_API_KEY:

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

The -v line keeps your chats and settings in a named volume, so recreating the container later does not lose them. Replace YOUR_KEY with your key, and avoid committing the command to a repository with the key inside. A compose file with an .env file that stays out of version control is the tidier route.

Keep in mind that values saved through the admin panel are stored in the app's database, and in some versions they take precedence over the variables after the first run. If you change the variable and nothing happens, change it in the admin panel as well.

Test the endpoint before blaming the interface

When a connection fails, the quickest way to find out why is to bypass Open WebUI. First ask for the model list:

curl https://api.nsfwgpt.cc/v1/models \
  -H "Authorization: Bearer $NSFWGPT_KEY"

You should get JSON with one entry whose ID is uncensored. A 401 means the key is wrong or missing the word Bearer. Then test a streamed chat request:

curl -N https://api.nsfwgpt.cc/v1/chat/completions \
  -H "Authorization: Bearer $NSFWGPT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","stream":true,"messages":[{"role":"user","content":"Name three colours."}]}'

You will see lines starting with data: arrive one by one, ending with a final chunk that carries usage and then [DONE]. If both calls work from the machine running Open WebUI, the problem is in the interface settings. If you run Open WebUI in a container, run the curl command inside that container too, because DNS or proxy rules there can differ from your host.

SymptomLikely causeFix
No models in the pickerURL missing /v1, or key not savedRe-enter the URL as shown above and save again
401 errorWrong or expired keyCopy the key again from the key page
429 with concurrencyMore than 8 requests at once on a full keyWait and retry, or reduce parallel chats
429 with rate_limitedMore than 300 requests per minuteSlow background tasks, see below
Reply stops earlyLow max tokens in the chat settingsRaise it or clear it

Settings worth changing

Open WebUI lets you set a system prompt and advanced parameters per chat, per model or globally. The API passes through temperature, top_p, stop sequences, seed and the frequency and presence penalties, so those controls in the interface have a real effect.

For long-form writing, try a temperature of 0.8 to 1.0 and a mild frequency penalty if the model repeats phrases. For factual or code tasks, lower the temperature to 0.2 to 0.4. The context window is 100,000 tokens, shared between your prompt and the reply. In practice that means a very long chat can hold a lot, but each turn resends the history, and you pay input price for it every time. Start a new chat when the scene changes.

Leave the maximum tokens field empty unless you have a reason. The completion can use the rest of the window, and a cap that is too low is the most common cause of replies that stop mid-sentence.

The model is tuned to answer without content refusals for lawful adult use. That is a property of the model and not of Open WebUI, so you do not need a special jailbreak prompt in the system field. A plain description of the role you want is enough.

Streaming, tools and JSON mode

Streaming works over server-sent events and Open WebUI uses it by default for chat, so replies appear as they are produced. Tool calling and JSON mode are available on the API as well. Whether the interface uses them depends on the feature: functions and tools defined in Open WebUI can use the model's tool calling, and your own scripts can use both directly. A script that asks for structured output looks like this:

from openai import OpenAI

client = OpenAI(base_url="https://api.nsfwgpt.cc/v1", api_key="YOUR_KEY")

r = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Return a JSON object with keys a and b."}],
    response_format={"type": "json_object"},
)
print(r.choices[0].message.content)

Because only one model is offered, there is nothing to configure per task. The same uncensored ID serves chat, tool calls and JSON replies.

Shared instances, limits and cost

One key is shared by everyone on your Open WebUI instance. A full key allows 8 concurrent requests and 300 per minute; the trial key allows 2 and 60. A family or small team will rarely notice, but a larger group can. A streamed reply holds its slot until it finishes, so a few people reading long answers can fill the eight slots.

Background tasks are a hidden source of requests. Open WebUI can generate chat titles and tags with a model after each exchange, which adds calls you did not type. In the admin settings you can choose a separate task model or switch these features off, so they do not compete with your conversation for slots or credit.

Cost is modest. Price is $0.15 per 1M input tokens and $0.50 per 1M output tokens. A chat turn with 3,000 tokens of history and a 400-token reply costs 3,000 x $0.15 / 1,000,000 = $0.00045 for input plus 400 x $0.50 / 1,000,000 = $0.0002 for output, so $0.00065. Top-ups start at $20 and are paid in USDT on TRC20 or USDC on Base. Credit never expires. See the pricing page for bonuses, the quickstart for the raw request format, and the key page to claim the trial. Prompts are not used for training.

Start with trial credit

Email and password, key on screen right away.

Questions and answers

What URL do I enter in Open WebUI?

Enter https://api.nsfwgpt.cc/v1 as the OpenAI API URL, with your key. Do not append the chat completions path.

Which model ID will I see?

One model, uncensored. Open WebUI fills the list from the models endpoint, so it appears in the selector after you save the connection.

Can several people use one connection?

Yes, but they share the key limits: 8 concurrent requests and 300 requests per minute on a full key. Over the limit the API returns HTTP 429.

Does the endpoint support images in Open WebUI?

No. The API is text only, with no image, audio or video generation and no embeddings.

Your key is one form away

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