🌍 Global Mirror — Visit original CN site →
Skip to main content

OpenAI

Overview

Open WebUI makes it easy to connect to OpenAI and Azure OpenAI. This guide will walk you through adding your API key, setting the correct endpoint, and selecting models — so you can start chatting right away.

For other providers that offer an OpenAI-compatible API (Google Gemini, Mistral, Groq, DeepSeek, and many more), see the OpenAI-Compatible Providers guide. For Anthropic's Claude models, see the dedicated Anthropic (Claude) guide.


Important: Protocols, Not Providers

Open WebUI is a protocol-centric platform. While we provide first-class support for OpenAI models, we do so mainly through the OpenAI Chat Completions API protocol.

We focus on universal standards shared across dozens of providers, with experimental support for emerging standards like Open Responses. For a detailed explanation, see our FAQ on protocol support.


Step 1: Get Your OpenAI API Key


Step 2: Add the API Connection in Open WebUI

Once Open WebUI is running:

  1. Go to the ⚙️ Admin Settings.
  2. Navigate to Connections > OpenAI > Manage (look for the wrench icon).
  3. Click ➕ Add New Connection.
  • Connection Type: External
  • URL: https://api.openai.com/v1
  • API Key: Your secret key (starts with sk-...)

Advanced Configuration

  • Model IDs (Filter):

    • Default (Empty): Auto-detects all available models from the provider.
    • Set: Acts as an Allowlist. Only the specific model IDs you enter here will be visible to users. Use this to hide older or expensive models.
  • Prefix ID:

    • If you connect multiple providers that have models with the same name (e.g., two providers both offering llama3), add a prefix here (e.g., groq/) to distinguish them. The model will appear as groq/llama3.
  1. Click Save ✅.

This securely stores your credentials.

Connection Timeout Configuration

If your API provider is slow to respond or you're experiencing timeout issues, you can adjust the model list fetch timeout:

# Increase timeout for slow networks (default is 10 seconds)
AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST=15

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

OpenAI Connection Screen


Step 3: Start Using Models

Once your connection is saved, you can start using models right inside Open WebUI.

🧠 You don't need to download any models — just select one from the Model Selector and start chatting. If a model is supported by your provider, you'll be able to use it instantly via their API.

Here's what model selection looks like:

OpenAI Model Selector

Simply choose GPT-4, o3-mini, or any compatible model offered by your provider.


All Set!

That's it! Your OpenAI API connection is ready to use.

If you want to connect other providers, see the Anthropic (Claude) guide or the OpenAI-Compatible Providers guide for Google Gemini, Mistral, Groq, DeepSeek, and more.

If you run into issues or need additional support, visit our help section.

Happy prompting! 🎉