EN ▾
Get API key

Open WebUI Add Model: Connect an OpenAI-Compatible API

To add a model in Open WebUI you create an OpenAI-type connection with a base URL and key, then pick the model from the chat selector. This page walks through each step and the problems people hit.

Updated

A glowing plug connecting a dashboard panel to a server tower, showing a model connection added to a chat interface

Key points

  • Open WebUI treats any OpenAI-compatible endpoint as a connection: base URL, key, done.
  • Use https://api.nsfwmodel.cc/v1 as the URL and uncensored as the model ID.
  • A Docker environment variable can preconfigure the connection for every user.
  • Test the key with curl first, then check the container logs if the model list stays empty.

Add the connection in the admin panel

If you searched open webui add model, the answer is that Open WebUI does not install a hosted model the way it pulls a local one. Instead you add a connection to a service that already runs models, and the models of that service then appear in the selector at the top of the chat. This works for any endpoint that follows the OpenAI API, which includes this one.

You need three things: the base URL https://api.nsfwmodel.cc/v1, an API key, and the model ID uncensored. Get a key on the API key page. New users can claim $0.50 of trial credit there after sign-up, with no payment details, valid for 7 days.

  1. Sign in to Open WebUI with an administrator account.
  2. Open your profile menu and go to Admin Panel, then Settings, then Connections.
  3. In the OpenAI API section, click the plus button to add a connection.
  4. Enter https://api.nsfwmodel.cc/v1 as the URL and paste your key.
  5. Use the verify button next to the fields if your version shows one, then save.

Menu names shift a little between Open WebUI releases, so if a label differs on your install, look for the section titled with OpenAI or "Connections". Once saved, start a new chat and open the model selector. You should see uncensored in the list.

Preconfigure it with Docker

If you run Open WebUI in a container, you can supply the connection through environment variables, so it exists from the first start and every user sees it. This is handy for a team instance where you do not want people pasting keys by hand.

# model ID to select in the UI: uncensored
docker run -d -p 3000:8080 \
  -e OPENAI_API_BASE_URL="https://api.nsfwmodel.cc/v1" \
  -e OPENAI_API_KEY="YOUR_API_KEY" \
  -v open-webui:/app/backend/data \
  --name open-webui \
  ghcr.io/open-webui/open-webui:main

Then visit http://localhost:3000 and create the first account, which becomes the administrator. A caveat about these variables: Open WebUI stores its configuration in the data volume after the first launch, and connection settings saved through the admin panel can take precedence over the variables on later starts. If you change the variable and nothing happens, change the value in the panel instead, or recreate the volume if it holds nothing you need.

If you use Docker Compose, the same two variables go under the environment key of the service. Keep the key in an .env file that is excluded from version control.

Test the key outside Open WebUI first

When something fails, it is faster to separate "the key is wrong" from "Open WebUI is misconfigured". Run the request below from the same machine, or better from inside the container, since that is where the call is actually made.

curl https://api.nsfwmodel.cc/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

curl https://api.nsfwmodel.cc/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "uncensored", "messages": [{"role": "user", "content": "ping"}]}'

The first call returns the model list, which contains uncensored. The second returns a short completion. The service supports exactly two methods, GET /v1/models and POST /v1/chat/completions. If both succeed from the container but Open WebUI still shows nothing, the problem is in the app settings. If they fail, look at the key and the URL. Responses include an X-Balance-USD header, which is a quick way to confirm that the key is live and has credit.

Choose how the model behaves in chat

After the connection works, the model is available, but the defaults matter. Open WebUI lets you set a system prompt and sampling parameters, either globally, per chat or inside a saved model preset. All the common sampling controls are passed through by this API: temperature, top_p, stop, seed and the frequency and presence penalties.

Create a preset for repeatable behavior

In the Workspace area you can create a custom model that wraps uncensored with a fixed system prompt and parameters, then give it a friendly name. This is the right place to put a persona or a writing style so you do not retype it. The underlying model is the same, only the instructions change.

Set sensible limits

The context window is 100,000 tokens for prompt and completion combined. Open WebUI resends the chat history on every message, so a long conversation grows the prompt, and your input token bill grows with it. You do not have to set max_tokens, because the completion can use whatever is left of the window, but a cap is useful if you want replies kept short.

A rough cost example. A chat of 10 messages in which each request averages 3,000 input tokens and 400 output tokens uses 30,000 input and 4,000 output tokens in total. That is 0.03 x $0.15 + 0.004 x $0.50 = $0.0045 + $0.0020 = $0.0065. Prices are $0.15 per 1M input tokens and $0.50 per 1M output tokens, with failed or refused requests not charged.

Fixing the common problems

Most failures fall into a few groups.

The model list is empty

The connection saved but no models show. Check the URL first: it must end in /v1 and not include /chat/completions. A trailing slash is usually fine. Then check that the key has no spaces or line breaks copied with it. If Open WebUI runs in Docker on a machine with strict outbound rules, confirm the container can reach the internet with a curl from inside it.

The chat returns an authorization error

This means the key was rejected. Re-copy it from the API key page, and check that you did not paste it into a field meant for a different connection, such as a local Ollama URL.

A 429 error appears under load

The API answers 429 with the code rate_limited when you exceed the request rate, and with concurrency when too many requests run at once. A trial key allows 2 concurrent requests and 60 per minute. A full key allows 8 concurrent requests and 300 per minute. On temporary overload you also get a 429 with a Retry-After: 5 header, so waiting five seconds and retrying is the right fix. Features in Open WebUI that fire extra background requests, such as automatic title generation, can use up concurrency slots on a trial key, so turning them off or pointing them at a different model helps if you see this on a small key.

Replies stop early or the stream hangs

A streamed request holds its concurrency slot until the stream ends. If you close the tab mid-answer on a flaky network, wait a few seconds for the slot to free before retrying. For deeper parameter details, the quickstart docs list what the endpoint supports.

Sharing the instance with other people

If several people use your Open WebUI, remember that one API key carries one set of limits. Everyone's chats share the same 8 concurrent requests and 300 requests per minute on a full key. For a household or a small team this is plenty. For a public-facing deployment, watch the balance header and top up before it runs out. Top-ups are any whole amount from $20 to $500, with +5% from $50, +10% from $100 and +15% from $200. Payment is by crypto only, in USDT on TRC20 or USDC on Base, and credit never expires. Details are on the pricing page.

Think about who may use the instance. The model answers without content refusals for lawful adult use, and the one fixed rule is no sexual content involving minors. If you invite others, enforce your own access rules in Open WebUI, such as disabling open sign-up and approving accounts by hand. Prompts sent through the API are not used for training, but your Open WebUI database stores chat history on your own server, so protect that volume and back it up if the history matters.

For background on what the endpoint is and what people often get wrong about it, read the myths and facts article.

Questions and answers

Which URL do I enter in Open WebUI?

Use https://api.nsfwmodel.cc/v1 as the OpenAI API URL. Do not add /chat/completions, since the app appends the path itself.

What model name will appear?

The service exposes one model with the ID uncensored. It shows up in the selector once the connection is saved and the key is accepted.

Can I keep my local Ollama models too?

Yes. Open WebUI can hold several connections at once, so local models and this hosted one appear together in the selector.

Does it cost anything to try?

New users can claim $0.50 of trial credit with one click on the API key page. It is one per person, valid for 7 days, and needs no payment details.

Why do I get a 429 error?

You hit the request rate or the concurrency limit. Wait the number of seconds in Retry-After, or lower how many chats run at the same moment.

Your key is one form away

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