- NSFW Video API
- Does OpenWebUI Have an API? Yes, in Two Directions
Does OpenWebUI Have an API? Yes, in Two Directions
Does openwebui have an api? Yes, and the question has two meanings: Open WebUI exposes an API of its own, and it can also use someone else's API as its model backend. This page explains both and shows how they fit together.

Two different APIs people mean
When someone asks whether Open WebUI has an API, they could be asking about either of two directions. Mixing them up is the main reason setup guides feel confusing, so it helps to separate them first.
- Inbound: your program sends requests to Open WebUI. It acts as a server with endpoints for chat, models and files, protected by an API key you generate inside the app.
- Outbound: Open WebUI sends requests to a model server so that its chat window has something to talk to. This is the connection you configure under Admin Settings.
So the short answer is yes to both. The project documents an API with an OpenAI-style chat endpoint, and it supports connecting to any server that speaks the OpenAI protocol. Details such as exact paths and key handling can change between versions, so check the documentation for the release you run.
This site provides the model on the outbound side: a hosted, OpenAI-compatible text API with the single model ID uncensored. It is not Open WebUI and does not run it for you. Open WebUI is software you host yourself.
Using Open WebUI's own API
Open WebUI lets a signed-in user create an API key in their account settings. With that key you can call its endpoints from scripts. The chat endpoint follows the OpenAI shape, so existing client code can often be pointed at it. The route documented by the project at the time of writing is /api/chat/completions; confirm against your version.
# Open WebUI running locally on port 3000, key created in Settings > Account
curl http://localhost:3000/api/chat/completions \
-H "Authorization: Bearer $OPENWEBUI_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored","messages":[{"role":"user","content":"Summarize this scene in one line."}]}'
Note that here the model name is whichever model Open WebUI has registered. If you connected this API as the backend, that name is uncensored. The key in this request is an Open WebUI key, not the model API key. They are two separate credentials with two separate jobs.
Why use the inbound API at all? It is useful when you want Open WebUI's extras behind your program, such as its stored knowledge collections, its per-user accounts or its model presets, and you would like to reach them without a browser.
Using an outside API as the backend
The other direction is the one most people need. Open WebUI has a section for OpenAI-compatible connections where you enter a URL and a key. For this service the values are:
- URL:
https://api.nsfwvideo.top/v1 - Key: the one from the key page
- Model:
uncensored, discovered automatically throughGET /v1/models
Step by step: open Admin Settings, go to Connections, add an OpenAI API connection, paste the URL and key, save, and choose the model in a new chat. If you prefer a command line start, set the environment variables OPENAI_API_BASE_URL and OPENAI_API_KEY when launching the container.
docker run -d -p 3000:8080 \
-e OPENAI_API_BASE_URL=https://api.nsfwvideo.top/v1 \
-e OPENAI_API_KEY=$API_KEY \
-v open-webui:/app/backend/data \
ghcr.io/open-webui/open-webui:main
Be aware that Open WebUI saves many settings to its database on first start. If you later change an environment variable and nothing happens, edit the connection in the admin panel instead. The quickstart has the request format the backend expects if you want to verify it with curl.
Chaining the two
You can use both directions at once. Your application calls Open WebUI's inbound API with an Open WebUI key, Open WebUI forwards the chat to the backend you configured, and the reply flows back. That arrangement makes sense in a few situations: a team already runs Open WebUI with accounts and wants scripts to share its presets, or you want one place that holds persona settings for both humans and programs.
It adds a hop. Every request now crosses your Open WebUI server before reaching the model API, so there is one more thing to keep running, patch and secure. Rate limits also stack in an unobvious way: the backend key allows 8 concurrent requests and 300 per minute for a full key, and every user and script going through your Open WebUI instance shares that allowance. If the backend answers with HTTP 429, with error code rate_limited or concurrency, the failure will usually show up as an error in Open WebUI and in your caller.
When to skip Open WebUI and call the API directly
If all you need is a script that generates text, such as outlines, shot descriptions or draft narration, Open WebUI is unnecessary. This service is a normal OpenAI-compatible endpoint, so the standard SDK talks to it directly.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwvideo.top/v1", api_key=os.environ["API_KEY"])
resp = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": "You write concise shot lists for short films."},
{"role": "user", "content": "Shot list for a ninety second chase through a night market."},
],
temperature=0.7,
)
print(resp.choices[0].message.content)
Direct calls give you streaming over SSE, tool calling, JSON mode and every sampling parameter without an intermediate layer. Open WebUI is the better pick when you want a chat interface for people, with history, accounts and presets. A script is the better pick for batch work. The API produces text only: it does not render video, images or audio, so for a video project it supplies the written parts such as scripts and prompts for other tools. The video pipeline page goes into that use.
A quick decision guide
- You want a chat window for yourself or a team: run Open WebUI and add the outbound connection.
- You want scripts to reuse Open WebUI presets or accounts: use its inbound API with an Open WebUI key.
- You want batch text generation: call the model API directly with the OpenAI SDK and skip the extra layer.
- You want images or voice: neither Open WebUI nor this text API will produce them by themselves. Connect separate tools for that step.
Whichever path you pick, the model-side facts stay the same: a 100,000-token context window shared by prompt and reply, tool calling and JSON mode available, and a hard rule against sexual content involving minors.
Security notes for exposing either API
Treat both keys as secrets. The Open WebUI key grants whatever the creating user can do inside your instance; the model API key spends your prepaid balance. Do not paste either into client-side code or public repositories.
- Put Open WebUI behind HTTPS if it is reachable beyond your own machine.
- Create separate Open WebUI keys per script so you can revoke one without breaking the others.
- Rotate the model API key if it ever appears in a log or a screenshot.
- Watch the
X-Balance-USDresponse header on the backend to see spend per call.
On privacy, prompts sent to this API are not used for training. Open WebUI itself stores chat history in its own database on your server, so your hosting choices determine who can read that.
What it costs to run this setup
Open WebUI is free software you host; your cost is the server plus the tokens. Tokens are billed at $0.15 per 1M input and $0.50 per 1M output, from prepaid credit with no subscription. Take a chat turn with 3,000 input tokens and 500 output tokens: 3,000 x $0.15 / 1M = $0.00045 for input and 500 x $0.50 / 1M = $0.00025 for output, a total of $0.0007. A thousand such turns cost $0.70.
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, USDT on TRC20 or USDC on Base. Failed or refused requests are not charged, and credit never expires. New users can claim a $0.50 trial for 7 days with one click and no payment details. See the pricing page for the full picture.
A reminder on content: the model is tuned to answer without content refusals for lawful adult use, and sexual content involving minors is never allowed.
More guides
Questions and answers
Does Open WebUI have an API of its own?
Yes. You can create an API key in your account settings and call its endpoints, including an OpenAI-style chat route. Confirm the exact paths in the documentation for your version.
Can Open WebUI use an external OpenAI-compatible API?
Yes. Add it under Admin Settings, Connections with the base URL and key. For this service the URL is https://api.nsfwvideo.top/v1 and the model is uncensored.
Are the Open WebUI key and the model API key the same?
No. The first authorizes calls to your Open WebUI server. The second authorizes calls to the model API and spends your balance.
Do I need Open WebUI to use this API?
No. Any OpenAI SDK or HTTP client can call it directly. Open WebUI is just one convenient chat interface.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.