Skip to main content

OpenAI-Compatible

Overview​

Open WebUI connects to any server or provider that implements the OpenAI-compatible API. This guide covers how to set up connections for popular cloud providers, gateways, and local servers.

For OpenAI itself (or Azure OpenAI), see the dedicated OpenAI guide.

Official Partners​

Explore our official partners and their setup guides:

  • ai&: AI inference from Japan: Bring open-weight models to your team's workspace with inference hosted in Japan, usage-based pricing and a straightforward OpenAI-compatible connection. A strong fit for teams building and deploying AI in Japan.

Protocol-Oriented Design​

Open WebUI is built around Standard Protocols. Instead of building specific modules for every individual AI provider (which leads to inconsistent behavior and configuration bloat), Open WebUI focuses on protocols like the OpenAI Chat Completions Protocol.

This means that while Open WebUI handles the interface and tools, it expects your backend to follow the universal Chat Completions standard.

  • We Support Protocols: Any provider that follows widely adopted API standards is natively supported. We also support Open Responses.
  • We Avoid Proprietary APIs: We do not implement provider-specific, non-standard APIs in the core to maintain a universal, maintainable codebase. For unsupported providers, use a pipe or a middleware proxy like LiteLLM or OpenRouter to bridge them.

For a detailed explanation of this architectural decision, see our FAQ on protocol support.


Important: Connection Verification May Fail for Some Providers

Saving a connection does not test it. Clicking the Verify Connection button beside the URL field calls the provider's /models endpoint using a standard Bearer token and reports Server connection verified. Some providers do not implement the /models endpoint at all or use non-standard authentication for it. In these cases:

  • The connection verification will fail with an error (e.g., 400, 401 or 403).
  • This does not mean the provider is incompatible: chat completions will still work.
  • You just need to manually add model names to the Model IDs allowlist in the connection settings.

Providers with known /models issues:

Provider/models works?Action Needed
AnthropicYes, built-in compatibility layerAuto-detection works
GitHub ModelsNo, uses non-standard pathAdd model IDs manually to the whitelist
PerplexityNo, endpoint doesn't existAdd model IDs manually to the whitelist
MiniMaxNo, endpoint doesn't existAdd model IDs manually to the whitelist
OpenRouterYes, but returns thousands of modelsStrongly recommend adding a filtered allowlist
Vercel AI GatewayYesAuto-detection works; filtering is recommended if you only want specific gateway models
Google GeminiYesAuto-detection works
DeepSeekYesAuto-detection works
MistralYesAuto-detection works
GroqYesAuto-detection works

How to add models manually: In the connection settings, find Model IDs, type the model ID, and click the + icon, then save. The models will then appear in your model selector even though the connection verification showed an error.


Step 1: Add Your Provider Connection​

  1. Open Open WebUI in your browser.
  2. Go to Settings > Connections (admin section) and find the Manage OpenAI API Connections list.
  3. Click Add Connection.
  4. Fill in the URL and API Key for your provider (see tabs below). The URL field will suggest common provider endpoints as you type.
  5. If your provider doesn't support /models auto-detection, add your model IDs to the Model IDs allowlist. After a successful Verify Connection, the Model IDs field suggests the provider's model IDs as you type.
  6. Click Save.
tip

If running Open WebUI in Docker and your model server is on the host machine, replace localhost with host.docker.internal in the URL.

Enable/Disable Connections

Each connection has a toggle switch that lets you enable or disable it without deleting the connection. This is useful for temporarily deactivating a provider while preserving its configuration.

Cloud Providers​

tip

See the dedicated Anthropic (Claude) guide for a full step-by-step walkthrough.

Anthropic (Claude) offers an OpenAI-compatible endpoint. Open WebUI includes a built-in compatibility layer that automatically detects Anthropic URLs and handles model discovery: just plug in your API key and models are auto-detected. Note that this is intended for testing and comparison. For production use with full Claude features (PDF processing, citations, extended thinking, prompt caching), Anthropic recommends their native API.

SettingValue
URLhttps://api.anthropic.com/v1
API KeyYour Anthropic API key from console.anthropic.com
Model IDsAuto-detected, leave empty or filter to specific models

Local Servers​

Llama.cpp runs efficient, quantized GGUF models locally with an OpenAI-compatible API server. See the dedicated Llama.cpp guide for full setup instructions (installation, model download, server startup).

SettingValue
URLhttp://localhost:10000/v1 (or your configured port)
API KeyLeave blank

Quick start:

./llama-server --model /path/to/model.gguf --port 10000 --ctx-size 1024 --n-gpu-layers 40
Connection Timeout Configuration

If your server is slow to start or you're connecting over a high-latency network, you can adjust the model list fetch timeout:

# Raise the timeout for slower connections. The default is 10 seconds, and an empty value disables it
AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST=30

If you've saved an unreachable URL and the UI becomes unresponsive, see the Model List Loading Issues troubleshooting guide for recovery options.


Forward cookies

Advanced > Forward cookies decides whether the cookies from the browser request are sent on to this server. It is off by default.

Turn it on only for a server you control that authenticates the person behind the request by cookie, typically one sitting inside your own network behind the same sign-on. Everything the browser holds for your Open WebUI domain goes with the request, session cookie included, so a third-party endpoint should never have this on.

This changed: connections using the Session or OAuth auth types used to forward cookies unconditionally. They no longer do. If such a connection stops authenticating after an upgrade, switch this on.

OAuth auth type

With Auth set to OAuth, Open WebUI sends the access token from the user's SSO sign-in to this server as a bearer token. A chat in the browser uses the sign-in of that browser session. When that session has no token, or the request has no browser session at all (an API call with an API key or bearer token), the user's most recent SSO sign-in is used. A user who never signed in through SSO sends no token.

The Provider Setting​

Every OpenAI connection has a Provider dropdown, hidden behind Advanced in the connection dialog. It is a hint about what the server on the other end actually is. Open WebUI cannot tell a llama.cpp server from a LiteLLM proxy by looking at /v1/chat/completions, since both answer it the same way, so the dropdown is how you tell it, and each option switches on the extras that server supports.

Default works for any plain OpenAI-compatible server. Choosing the option that names your server turns on its extras, and for llama.cpp servers and DeepSeek's API those include sending reasoning back and continuing a reply, as the table shows.

OptionWhat it changes
DefaultNothing. The connection is treated as a plain OpenAI-compatible endpoint.
Azure OpenAIRequests are rewritten into Azure's deployment-based URL form with an api-version parameter, so the connection needs an API Version and the deployment names listed under Model IDs. Also switched on automatically for Azure-looking URLs, see the Azure OpenAI tab under Cloud Providers.
llama.cppUnlocks the model management panel, the green Loaded marker and the admin Eject button in the model selector, and the extra model details on the model rows. Stored reasoning is also replayed to the server as a reasoning_content field, which llama.cpp routes through the chat template. The option names the request format, so hosted servers that speak it, such as DeepSeek's API (whose thinking mode needs the reasoning sent back), use it too. When you click Continue Response, Open WebUI adds continue_final_message: true and add_generation_prompt: false to the request so the server continues the last reply. Connections left at Default do not send these fields, and neither does an API Type of Responses. If Continue Response on a llama.cpp server repeats earlier text or starts a fresh reply, set this option. See the llama.cpp guide and reasoning models.
LM StudioUnlocks the same model management panel, loaded markers and model details, minus deleting models and minus the Eject button.
vLLM and OpenRouterStored reasoning is sent back to the model on later turns. See reasoning models.
LiteLLMRequests arriving at Open WebUI's own Anthropic Messages endpoint are forwarded to LiteLLM as-is instead of being converted to Chat Completions and back. Nothing changes for chats started inside Open WebUI.
Where the dropdown is not shown

The Provider dropdown belongs to OpenAI connections only. Ollama connections are recognised on their own, and the connections users add in Tether do not offer it.


Managing Local Models from Open WebUI​

Two provider types go beyond plain chat completions: setting Provider on the connection tells Open WebUI which management API the server speaks, which unlocks a model management panel for admins.

Open it from Settings > Models (admin section), the ⋯ menu, then Manage.

llama.cppLM Studio
List the server's modelsYesYes
Download a model by refYesYes
Load / unload a modelYesYes
Delete a cached modelYesNo

Everything in the panel is admin-only, and the actions are proxied to the local server rather than run in Open WebUI, so what happens to the files on disk is the server's business.

The connection URL you already use for chat is the right one here: Open WebUI strips a trailing /v1, /api/v1 or /api/v0 before calling the management API, so http://localhost:1234/v1 and http://127.0.0.1:10000/v1 both work unchanged.

From the model selector​

Admins do not have to open the panel to pull a model. Type a model ref into the model selector's search box and Open WebUI offers one Download row per target: Ollama if it is connected, plus every llama.cpp and LM Studio connection, each labelled with the provider it would download from. Arrow keys reach the rows and Enter starts the download. A row in progress shows a percentage and an ✕ to cancel it, and up to three downloads can run at once across all targets.

Loaded models and eject​

Loaded models are marked in the model selector for both provider types. The Eject button that admins see on a loaded row only works for llama.cpp; on an LM Studio model it returns Provider "lmstudio" does not support model unloading, so unload those from the management panel instead.


Required API Endpoints​

To ensure full compatibility with Open WebUI, your server should implement the following OpenAI-standard endpoints:

EndpointMethodRequired?Purpose
/v1/modelsGETRecommendedUsed for model discovery and selecting models in the UI. If not available, add models to the allowlist manually.
/v1/chat/completionsPOSTYesThe core endpoint for chat, supporting streaming and parameters like temperature.
/v1/embeddingsPOSTNoRequired if you want to use this provider for RAG (Retrieval Augmented Generation).
/v1/audio/speechPOSTNoRequired for Text-to-Speech (TTS) functionality.
/v1/audio/transcriptionsPOSTNoRequired for Speech-to-Text (STT/Whisper) functionality.
/v1/images/generationsPOSTNoRequired for Image Generation (GPT-Image) functionality.

Supported Parameters​

Open WebUI passes standard OpenAI parameters such as temperature, top_p, max_tokens (or max_completion_tokens), stop, seed, and logit_bias. It also supports Tool Use (Function Calling) if your model and server support the tools and tool_choice parameters.

How the model ID changes the request​

Before it sends a chat request on any OpenAI-compatible connection, Open WebUI checks the model ID it is about to send. That is the ID after the connection's Prefix ID is removed, and for a custom model it is the base model's ID. The check ignores case and first removes a leading openai. or <region>.openai. (Amazon Bedrock style, for example us.openai.gpt-5). The ID counts as an OpenAI reasoning model when it starts with o followed by a digit (o1, o3-mini, o4-mini) or with gpt- followed by a number of 5 or higher (gpt-5, gpt-5.2, gpt-6).

  • Matching IDs: max_tokens is renamed to max_completion_tokens. If the first message has the system role, it is sent with the developer role instead, or with the user role for IDs starting with o1-mini or o1-preview.
  • Other IDs, on a URL that does not contain api.openai.com: max_completion_tokens is renamed to max_tokens.

This applies to every server, not only OpenAI, so it explains these cases:

  • Your server returns an error about the developer role, or the model does not follow the system prompt, for a model named like gpt-5 or o3. The model ID matches the rule even though the server behind it is not OpenAI. Give the model a different ID on the server or proxy (for example in your LiteLLM config) so it no longer starts with o<digit> or gpt-<5 or higher>.
  • The token limit has no effect for a reasoning model behind a proxy. For a matching ID, the max_tokens value from Advanced Params is sent as max_completion_tokens. Check that your server or proxy accepts that parameter.
  • A proxy model such as openai/gpt-5 gets max_tokens and a system message. Only the openai. form of the provider prefix is removed, so an ID with openai/ does not match. If the upstream API requires max_completion_tokens or the developer role, expose the model under an ID without that prefix.

Step 2: Start Chatting!​

Select your connected provider's model in the chat menu and get started!

That's it! Whether you choose a cloud provider or a local server, you can manage multiple connections, all from within Open WebUI.


Enjoy building your perfect AI setup!

This content is for informational purposes only and does not constitute a warranty, guarantee, or contractual commitment. Open WebUI is provided "as is." See your license for applicable terms.