# Pwn AI Providers Openwebui

> Drive PWN::AI::Providers::OpenWebUI from pwn_eval.

- Skill: `0dayinc/pwn-ai-providers-openwebui` (Agent Skill)
- Install (CLI): `npx get-skill add 0dayinc/pwn-ai-providers-openwebui`
- Raw SKILL.md: https://api.skillmd.com/api/skills/0dayinc/pwn-ai-providers-openwebui/raw
- Safety review: pending
- Works with: any agent that reads SKILL.md (Claude Code, Claude.ai, Cursor, Codex, Windsurf, 60+ more)
- Category: Coding & Dev Tools
- Author: 0dayInc (https://skillmd.com/u/0dayinc)
- Updated: 2026-12-02
- Page: https://skillmd.com/skills/0dayinc/pwn-ai-providers-openwebui

---

---
name: pwn-ai-providers-openwebui
description: Drive PWN::AI::Providers::OpenWebUI from pwn_eval.
license: MIT
allowed-tools: [pwn, pwn_eval]
metadata:
  bundled: true
  generated: false
  preserve: true
  module: PWN::AI::Providers::OpenWebUI
  source: pwn/ai/providers/open_web_ui.rb
---

# PWN::AI::Providers::OpenWebUI

Client for Open WebUI's REST API via PWN::HTTP::TransparentBrowser (:rest). Live Open WebUI routes (gateway base_uri, no trailing slash): GET /api/v1/models OpenAI-compat model list (:data) POST /api/v1/chat/completions OpenAI-compat chat (SSE when stream:true) POST /api/chat/completions alias of the above GET /ollama/api/tags proxied Ollama tags (:models) POST /ollama/api/chat proxied Ollama chat (NDJSON when stream:true) POST /ollama/api/embed proxied embeddings (see PWN::AI::Memory::Index) Bare /api/chat and bare /v1/* are NOT API routes on stock Open WebUI — they 405 or return the SPA HTML shell.

## When to use

Call `PWN::AI::Providers::OpenWebUI` from `pwn_eval` when the task needs this module.
Do not reimplement it in shell.

## Catalog authentication

Use the gateway's `ai.openwebui.base_uri` and a gateway-issued API key or JWT
in `ai.openwebui.key`. For `get_models` and `get_model` only, an authorized
operator can instead exchange their own IdP access token. First confirm that
the gateway administrator enabled exchange and explicitly listed the OAuth client
in its trusted client IDs. Configure its HTTPS `base_uri`, `ai.openwebui.oauth.provider`
(the gateway's provider ID) and `enroll: true`. Run `get_models` in a private
foreground terminal; enter the IdP token only at the masked prompt. It is sent
directly over verified TLS to that gateway and never persisted by PWN.

Only the gateway-issued bearer, finite expiry and gateway URI are cached.
`get_model` uses the same session as `get_models`, including when it looks up a
missing detail in the gateway's lists. Neither operation retries a denied or
expired session with `key:`. On denial, disabled exchange, redirect or MFA, stop
and use normal web sign-in. Do not put the IdP token in `key:`. Chat and other
noncatalog calls still need the gateway-issued key/JWT.

## How to call

```ruby
PWN::AI::Providers::OpenWebUI.get_models(non_interactive: true).length
```

## Public methods

- `obtain_oauth_bearer_token` (explicit operator exchange; returns a secret)
- `get_models`
- `get_model`
- `chat_with_tools`
- `chat`
- `authors`
- `help`

## Source

`pwn/ai/providers/open_web_ui.rb`

## Verification

The example counts rows from the gateway's model list or proxied tag catalog.
It does not initiate an exchange or test generation permissions.

