bitsrun

Open WebUI custom OpenAI endpoint with your own model

Connect Open WebUI to a custom OpenAI endpoint that runs your own open model, private and billed per second. Step-by-step settings, a test and fixes.

Updated

On this page

This page shows how to add a custom OpenAI endpoint to Open WebUI, so its chat screen talks to an open model you deployed on BitsRun instead of a hosted chatbot. At the end you will pick your own model in Open WebUI's model menu and chat with it. It takes about 5 minutes once you have an endpoint.

Checked against the Open WebUI docs on 2026-11-14 (latest release v0.13.3).

What you get

Chat UIOpen WebUI, on your laptop or server
ModelAny chat model you deployed on BitsRun, for example qwen3:8b
Connection typeOpen WebUI's OpenAI API connection (BitsRun is OpenAI-compatible)
Cost when idleNothing. The endpoint sleeps and wakes on the next message
PrivacyPrompts and replies are never logged or stored by BitsRun (Privacy)

Before you start

  • A BitsRun chat endpoint. If you do not have one yet, follow Deploy your first model or Deploy an Ollama model to the cloud.
  • Its base URL, from the Copy button on the endpoint card. It looks like https://<endpoint-id>.endpoint.bitsrun.com/v1, where <endpoint-id> is your endpoint's id.
  • An API key that starts with brk_. See API keys. Below, brk_your_key stands for your key.
  • Open WebUI running, with an admin account. Install steps are on the Open WebUI quick start.

How to add a custom OpenAI endpoint in Open WebUI

  1. Open Open WebUI in your browser and sign in as an admin.

  2. Go to Settings > Connections (the admin section) and find the Manage OpenAI API Connections list.

  3. Select Add Connection.

  4. In URL, paste your base URL, ending in /v1:

    https://<endpoint-id>.endpoint.bitsrun.com/v1
  5. In API Key, paste brk_your_key.

  6. If the form offers a button to verify the connection, select it to check the URL and key.

  7. Optional: if your model does not show up, type your model name (for example qwen3:8b) under Model IDs and select +. Normally Open WebUI reads it from /v1/models, which lists the one model your endpoint serves.

  8. Select Save.

Your model now appears in the model menu at the top of a new chat.

Set it up with environment variables instead

If you start Open WebUI with Docker, you can pass the connection as environment variables. This is the command from the Open WebUI quick start, with the two OpenAI variables added:

bash
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  -e WEBUI_SECRET_KEY=your-secret-key \
  -e OPENAI_API_BASE_URL=https://<endpoint-id>.endpoint.bitsrun.com/v1 \
  -e OPENAI_API_KEY=brk_your_key \
  --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Test the connection

  1. Start a new chat and pick your model from the model menu.
  2. Send a short message, such as Say hello in five words.
  3. You should see a reply. If the endpoint was asleep, the reply waits while the model wakes (see below).

You can also test the endpoint itself from a terminal, outside Open WebUI:

bash
curl https://<endpoint-id>.endpoint.bitsrun.com/v1/chat/completions \
  -H "Authorization: Bearer brk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"model": "qwen3:8b", "messages": [{"role": "user", "content": "Say hello in five words."}]}'

What happens on the first message after the endpoint sleeps

A sleeping endpoint wakes on the next request. That wait is a cold start, and it is never billed.

Model kindWarm GPU (ran recently)New GPU machine
GGUF models on llama.cppA few seconds to about 40 secondsAbout 2 to 3 minutes
Safetensors chat models on vLLMAbout 40 secondsAbout 3 to 4 minutes

BitsRun holds the request open for up to 8 minutes and sends keep-alive comments on the stream, so the chat simply shows the reply when the model is ready. If your setup sets Open WebUI's AIOHTTP_CLIENT_TIMEOUT, keep it at 600 seconds or more so it covers the full 8-minute wait. A reverse proxy in front of Open WebUI needs a read timeout of at least 10 minutes too. Details are on Cold starts.

Does tool calling work in Open WebUI?

Yes, if the model supports it. BitsRun passes tools, tool_choice and parallel_tool_calls to the model. Check your model with bitsrun size <model> --json and look for "tools": true. See Tool calling.

If something goes wrong

Message or symptomWhat to do
The connection check or a chat fails with 401The key is missing, mistyped or revoked. Paste it again or create a new one.
404 when verifying or chattingCheck the URL ends in /v1 and uses your endpoint id. A key limited to another endpoint also gets 404.
402 payment_requiredYour balance is $0. Add credit in the dashboard.
429 rate_limitedYour account has too many requests open at once. Wait and try again.
Reply shows an error with model_startingThe model took longer than 8 minutes to wake. Send the message again.
400 context_too_longThe chat is longer than the model's memory. Start a new chat, or raise Memory length on the endpoint.

Every code is listed on Error codes.

Frequently asked questions

Can I use a self-hosted model in Open WebUI without running a GPU myself?

Yes. Deploy the model on BitsRun, then add its base URL and brk_ key as an OpenAI API connection in Open WebUI. BitsRun runs the GPU only while the model answers and bills by the second.

Which model name should I pick in Open WebUI?

Pick the one model the endpoint lists. Each BitsRun endpoint serves exactly one model and always uses it, whatever name the request sends.

Can I add more than one BitsRun endpoint to Open WebUI?

Yes. Add one connection per endpoint, each with its own base URL and key.

Why is the first reply slow?

The endpoint was asleep and the model had to load. That takes a few seconds to about 40 seconds on a warm GPU and about 2 to 4 minutes on a new GPU machine, and the wait is not billed.

Next step

Want a different model for chat? See Host a GGUF model as an OpenAI-compatible API. For document search in Open WebUI, read Self-hosted embeddings API. Estimate your monthly bill with the cost calculator, then create your account.

Try it on your own model

Sign up with your email, add $10 of credit and deploy from an Ollama name or a Hugging Face repo. An L4 costs $0.95 an hour, billed per second only while your model is awake. Waking up is never billed, and credit you buy does not expire.