Open WebUI integration
Connect Open WebUI to Plan2API
Open WebUI 0.12 connects to Plan2API through one OpenAI API connection: URL https://api.plan2api.com/v1, your p2a_ key and Connection Type External, with models loaded from /v1/models. Claude, ChatGPT, Gemini and Kimi models from your own plans then show up in the model picker.
- Connection
- OpenAI API, External
- URL
- https://
api.plan2api.com/ v1 - API Type
- Chat Completions
- Free plan
- 50 chat requests a day
Updated
Open WebUI settings for Plan2API
Open WebUI talks to Plan2API through a standard OpenAI API connection, so a single connection brings in Claude, Codex, Gemini and Kimi models from the subscriptions you've hooked up, the same way you'd use a Claude plan as an API in any OpenAI-compatible tool. Here are the exact values to drop into your Open WebUI setup:
| Field | Value |
|---|---|
| Connection Type | External |
| URL | https:// |
| API Key | Your p2a_ |
| API Type | Chat Completions |
| Model IDs (Advanced) | Empty, or only your connected providers' ids |
| Prefix ID (Advanced) | Optional, such as p2a |
| Provider (Advanced) | Default |
Add the Plan2API connection
- Sign up with your Google account, connect at least one subscription (signing in with Claude, entering a one-time device code for ChatGPT Codex, signing in with the Google account that has Google AI Pro or Ultra, or pasting a Kimi Code API key), and copy the
p2a_API key you get after connecting. - In Open WebUI, open
Settings > Admin > Connections, findManage OpenAI API Connections, and click+ Add Connection. - Set
Connection TypetoExternal, puthttps://api.plan2api.com/v1in theURLfield, and paste yourp2a_key into theAPI Keyfield so it goes out in anAuthorization: Bearerheader. - Leave the
API Typetoggle onChat Completions(the default), because requests go toPOST /v1/chat/completionsand Plan2API has no/v1/responsesendpoint. - Click
Verify Connectionbeside the URL field, wait forServer connection verified, then clickSave.
Clicking Save doesn't test your key or URL; Verify Connection calls GET /v1/models with your Bearer token, and that call doesn't count toward the Free plan's 50 chat requests a day.
Choose which models show up
If you leave Model IDs empty under Advanced, Open WebUI calls GET /v1/models and loads every model Plan2API serves, even for providers you haven't connected yet. Pick a model from an unconnected provider and the chat returns HTTP 403 with no_credentials, so fill Model IDs with only the model ids from the subscriptions you've actually connected to keep your model picker clean (once Model IDs is filled, Open WebUI stops calling /models).
You can also set a Prefix ID like p2a under Advanced if you run several OpenAI-compatible connections side by side and want to tell them apart. Open WebUI shows names like p2a.claude/claude-sonnet-5 in the picker and strips the p2a. prefix before sending the request out, whether you're calling Claude, Codex, Kimi or Gemini from a Google AI plan.
Here are the main model ids and prefixes you can add to Model IDs:
| Model id | Subscription | Context window |
|---|---|---|
| claude/ | Claude Pro or Max | 1,000,000 |
| claude/ | Claude Pro or Max | 1,000,000 |
| claude/ | Claude Pro or Max | 200,000 |
| openai/ | ChatGPT plan (Codex) | Listed by GET / |
| gemini/ | Google AI Pro or Ultra | 1,048,576 |
| kimi/ | Kimi Code membership | 1,048,576 |
Run Open WebUI in Docker with Plan2API
When you start the container, pass OPENAI_API_BASE_URL set to https://api.plan2api.com/v1 and OPENAI_API_KEY set to your p2a_ key. If you're wiring up more than one OpenAI-compatible endpoint at once, use OPENAI_API_BASE_URLS and OPENAI_API_KEYS instead, with the values separated by semicolons.
Keep in mind that ENABLE_PERSISTENT_CONFIG defaults to True, which means after the container's first start the settings saved in Open WebUI's database win over environment variables and any later edits have to go through Settings > Admin > Connections (unless you set ENABLE_PERSISTENT_CONFIG=False, where environment variables win and UI edits reset on restart). Also, AIOHTTP_CLIENT_TIMEOUT is unset (no timeout) by default, which suits long reasoning replies, while AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST defaults to 10 seconds.
This command adds OPENAI_API_BASE_URL and your key to Open WebUI's standard Docker quick start command and serves the app at http://localhost:3000:
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://api.plan2api.com/v1 \
-e OPENAI_API_KEY=p2a_your_key \
--name open-webui --restart always \
ghcr.io/open-webui/open-webui:mainGenerate images on Pro and Scale
- In Open WebUI, go to
Settings > Admin > Images. - Set
Image Generation EnginetoDefault (Open AI). - Enter
https://api.plan2api.com/v1as the API Base URL and yourp2a_key as the API key. - Set the model to
gpt-image-2(for model names starting withgpt-image, Open WebUI leaves outresponse_formatand reads theb64_jsonPNG that comes back) and pick an image size ofauto,1024x1024,1536x1024or1024x1536. - If you configure via Docker environment variables instead, set
ENABLE_IMAGE_GENERATION=trueandIMAGE_GENERATION_MODEL=gpt-image-2;IMAGES_OPENAI_API_BASE_URLandIMAGES_OPENAI_API_KEYdefault toOPENAI_API_BASE_URLandOPENAI_API_KEYfrom your chat connection, whileIMAGE_GENERATION_ENGINEdefaults toopenaiandIMAGE_SIZEdefaults to512x512.
Image generation requires a Pro or Scale plan (the Free plan returns HTTP 403 with type plan_limit on POST /v1/images/generations and POST /v1/images/edits), runs on your own connected ChatGPT (Codex) subscription, and takes 15 to 45 seconds per render or up to about 110 seconds at high quality.
Direct Connections for per-user keys
If you share one Open WebUI instance across a team or household and don't want everyone burning through a single shared key, an admin can turn on Direct Connections (which Open WebUI marks experimental) in Settings > Admin > Connections > Direct Connections or by setting ENABLE_DIRECT_CONNECTIONS=true. Once that's on, each user goes to User Settings > Connections and puts in https://api.plan2api.com/v1 and their own p2a_ key, and the browser calls Plan2API straight from the client while keeping the key in the browser's local storage instead of on the Open WebUI server, so every person runs on their own connected subscriptions and plan.
Direct Connections need CORS to work from the browser: Plan2API's API routes send Access-Control-Allow-Origin: * and answer the OPTIONS preflight with 204 (allowing the Authorization and Content-Type headers), so direct browser requests go right through even though Open WebUI's docs warn that strict providers like official OpenAI may block them.
Request limits and Plan2API plans
Every chat message you send in Open WebUI is one chat request, and because Open WebUI turns on title, tag and follow-up generation by default (ENABLE_TITLE_GENERATION, ENABLE_TAGS_GENERATION and ENABLE_FOLLOW_UP_GENERATION all default to True), those background tasks fire extra calls against the task model so a single message in the UI can spend several requests. If you're on the Free plan, either switch those toggles off in Settings > Interface or set TASK_MODEL_EXTERNAL to a model you don't mind spending requests on.
Plan2API Free is $0 (no card needed) and gives you 1 connected subscription, 50 chat requests a day (resetting at 00:00 UTC, with x-plan2api-requests-remaining on responses and HTTP 429 daily_requests on the 51st), 1 request per second with bursts up to 20, and 4 requests at once. Pro is $12 a month or $99 a year with no daily request cap, 3 subscriptions, 10 requests per second (bursts up to 600), 16 requests at once and image generation. Scale is $29 a month or $249 a year with 25 subscriptions and 32 requests at once, as listed on the Plan2API pricing page. Plan2API never bills per token, though your provider's own subscription usage limits still apply, and if you connect more than one account from the same provider, a request that hits a limit moves to the next account before any output is sent (or returns 429 subscription_quota_exhausted with Retry-After if all of them are out, as covered in the API error codes documentation).
Use the AI subscriptions you already pay for as one OpenAI-compatible API key.
- Free: 1 subscription, 50 requests a day, no card
- Pro: $12 a month
FAQ
What URL do I enter in Open WebUI for Plan2API?
Enter https://api.plan2api.com/v1 as the URL, set Connection Type to External, and paste your p2a_ key into the API Key field.
Why does a model in Open WebUI return 403 no_credentials?
When Model IDs is left blank, GET /v1/models returns every model Plan2API serves, including providers you haven't connected to your vault yet. Connect a subscription for that provider in your dashboard, or list only your connected models in the connection's Model IDs field so unconnected ones don't appear in the picker.
Should the API Type be Chat Completions or Responses?
Keep API Type set to Chat Completions. Plan2API serves POST /v1/chat/completions and doesn't have a /v1/responses endpoint.
Do title and tag generation use Plan2API requests?
Yes. Open WebUI's title, tag and follow-up generation run as separate calls on the task model, and every call to a Plan2API model counts as one chat request, which adds up fast on the Free plan's limit of 50 chat requests a day.
Can each Open WebUI user bring their own Plan2API key?
Yes, by turning on Direct Connections in Settings > Admin > Connections > Direct Connections (or ENABLE_DIRECT_CONNECTIONS=true). Each user adds their own p2a_ key in User Settings > Connections, the key stays in their browser's local storage, and Plan2API allows requests from any origin (a wildcard Access-Control-Allow-Origin header) and answers the OPTIONS preflight with a 204, so the browser requests succeed.
Sources
- Open WebUI docs: OpenAI-compatible providersdocs.openwebui.com
- Open WebUI docs: Environment variablesdocs.openwebui.com
- Open WebUI docs: Direct Connectionsdocs.openwebui.com
- Open WebUI docs: OpenAI image generationdocs.openwebui.com
- Open WebUI docs: Quick startdocs.openwebui.com
- Open WebUI releases (GitHub)github.com