Files
open-webui-docs/docs/getting-started/quick-start/starting-with-openai.mdx
DrMelone e0b71f1dbf OR
2025-12-30 15:01:32 +01:00

113 lines
4.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
sidebar_position: 2
title: "Starting With OpenAI"
---
## Overview
Open WebUI makes it easy to connect and use OpenAI and other OpenAI-compatible APIs. This guide will walk you through adding your API key, setting the correct endpoint, and selecting models — so you can start chatting right away.
---
## Step 1: Get Your OpenAI API Key
To use OpenAI models (such as GPT-4 or o3-mini), you need an API key from a supported provider.
You can use:
- OpenAI directly (https://platform.openai.com/account/api-keys)
- Azure OpenAI
- Any OpenAI-compatible service (e.g., LocalAI, FastChat, Helicone, LiteLLM, OpenRouter etc.)
👉 Once you have the key, copy it and keep it handy.
For most OpenAI usage, the default API base URL is:
https://api.openai.com/v1
Other providers use different URLs — check your providers documentation.
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
## 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**.
<Tabs>
<TabItem value="standard" label="Standard / Compatible" default>
Use this for **OpenAI**, **DeepSeek**, **OpenRouter**, **LocalAI**, **FastChat**, **Helicone**, **LiteLLM**, etc.
* **Connection Type**: External
* **URL**: `https://api.openai.com/v1` (or your provider's endpoint)
* **API Key**: Your secret key (usually starts with `sk-...`)
</TabItem>
<TabItem value="azure" label="Azure OpenAI">
For Microsoft Azure OpenAI deployments.
1. Find **Provider Type** and click the button labeled **OpenAI** to switch it to **Azure OpenAI**.
2. **URL**: Your Azure Endpoint (e.g., `https://my-resource.openai.azure.com`).
3. **API Version**: e.g., `2024-02-15-preview`.
4. **API Key**: Your Azure API Key.
5. **Model IDs (Deployments)**: You **must** add your specific Deployment Names here (e.g., `my-gpt4-deployment`).
</TabItem>
</Tabs>
### 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.
:::tip OpenRouter Recommendation
When using **OpenRouter**, we **highly recommend**:
1. **Use an allowlist** (add specific Model IDs). OpenRouter exposes thousands of models, which can clutter your model selector and slow down the admin panel if not filtered.
2. **Enable Model Caching** (`Settings > Connections > Cache Base Model List` or `ENABLE_BASE_MODELS_CACHE=True`). Without caching, page loads can take 10-15+ seconds on first visit due to querying a large number of models. See the [Performance Guide](/tutorials/tips/performance) for more details.
:::
* **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`.
4. Click **Save** ✅.
This securely stores your credentials.
![OpenAI Connection Screen](/images/getting-started/quick-start/manage-openai.png)
---
## Step 3: Start Using Models
Once your connection is saved, you can start using models right inside Open WebUI.
🧠 You dont need to download any models — just select one from the Model Selector and start chatting. If a model is supported by your provider, youll be able to use it instantly via their API.
Heres what model selection looks like:
![OpenAI Model Selector](/images/getting-started/quick-start/selector-openai.png)
Simply choose GPT-4, o3-mini, or any compatible model offered by your provider.
---
## All Set!
Thats it! Your OpenAI-compatible API connection is ready to use.
With Open WebUI and OpenAI, you get powerful language models, an intuitive interface, and instant access to chat capabilities — no setup headaches.
If you run into issues or need additional support, visit our [help section](/troubleshooting).
Happy prompting! 🎉