← Back to Skills Marketplace
dolphins1123

open-webui-api 操作技能

by ken · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
275
Downloads
0
Stars
1
Active Installs
4
Versions
Install in OpenClaw
/install claw-openwebui-api
Description
整合 Open WebUI RAG 知識庫 API,讓 OpenClaw 能自動上傳文件和查詢知識庫。
README (SKILL.md)

---

name: Claw_OpenWebUI_API slug: claw-openwebui-api author: kuanlin.huang version: 1.0.3 description: | 整合 Open WebUI RAG 知識庫 API,讓 OpenClaw 能自動上傳文件和查詢知識庫。 triggers:

  • "openwebui"

  • "rag"

  • "知識庫"

  • "上傳文件"

  • "搜尋知識庫" metadata: openclaw: emoji: "🦞" requires: env: ["OPENWEBUI_URL", "OPENWEBUI_API_KEY"] bins: ["python3", "requests"] install:

    • id: pip kind: pip package: requests label: Install requests library

---

Claw_OpenWebUI_API

讓 OpenClaw 調用 Open WebUI 的 RAG 知識庫 API。

功能

  • 📤 上傳文件到知識庫
  • 🔍 搜尋知識庫
  • 💬 對話時自動引用知識庫
  • 📊 列出知識庫內容

前置需求

  1. Open WebUI 已安裝並運行
  2. 已建立知識庫
  3. 取得 API Token

安裝

# 安裝技能
git clone https://github.com/你的帳號/Claw\\\_OpenWebUI\\\_API.git \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API

設定

環境變數(必須設定)

# 必需設定環境變數
export OPENWEBUI\\\_URL="http://你的伺服器IP:3000"
export OPENWEBUI\\\_API\\\_KEY="你的API\\\_Token"

取得 API Token

  1. 登入 Open WebUI
  2. 進入設定 → 帳號
  3. 產生 API Token

或設定檔

編輯 \\\~/.openclaw/openclaw.json

{
  "skills": {
    "Claw\\\_OpenWebUI\\\_API": {
      "url": "http://192.168.0.176:3000",
      "api\\\_key": "your\\\_api\\\_token"
    }
  }
}

使用方式

🚀 OpenClaw 指令(自然語法)

安裝技能後,可以直接用自然語法呼叫:

# 設定環境變數(只需設定一次)
小蝦,設定 OPENWEBUI\\\_URL 為 http://127.0.0.1:3000
小蝦,設定 OPENWEBUI\\\_API\\\_KEY 為 your-jwt-token

# 上傳檔案到知識庫
小蝦,上傳 note.txt 到知識庫 test3
小蝦,把 report.pdf 上傳到知識庫 mydocs

# 列出知識庫
小蝦,列出所有知識庫
小蝦,有哪些知識庫?

# 查詢檔案
小蝦,查詢上傳的檔案列表

# 對話(自動引用知識庫)
小蝦,用 Qwen3-4B 問關於 test3 的內容

📝 Bash 指令(直接執行)

# 設定環境變數
export OPENWEBUI\\\_URL="http://127.0.0.1:3000"
export OPENWEBUI\\\_API\\\_KEY="your-jwt-token"

# 列出知識庫
\\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/claw-openwebui.sh list-knowledge

# 上傳檔案到知識庫(需指定知識庫名稱)
\\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/claw-openwebui.sh upload-rag /path/to/file.txt test3

# 發送聊天
\\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/claw-openwebui.sh chat "Qwen3-4B-Instruct-2507-4bit" "你好"

📜 Python 指令(可選)

# 上傳 PDF 文件
python3 \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/scripts/upload.py --file /path/to/document.pdf

# 上傳多個文件
python3 \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/scripts/upload.py --file file1.pdf --file file2.docx

搜尋知識庫

python3 \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/scripts/search.py --query "關於 OpenClaw 的設定"

對話(知識庫增強)

python3 \\\~/.openclaw/workspace/skills/Claw\\\_OpenWebUI\\\_API/scripts/chat.py --message "如何安裝 OpenClaw?"

API 端點

方法 端點 功能
GET /api/v1/models 列出模型
POST /api/v1/files/upload 上傳檔案
GET /api/v1/files 列出已上傳檔案
POST /api/v1/rag 搜尋知識庫

架構

Claw\\\_OpenWebUI\\\_API/
├── SKILL.md
├── scripts/
│   ├── upload.py      # 上傳文件
│   ├── search.py      # 搜尋知識庫
│   ├── chat.py        # 對話+知識庫
│   └── list\\\_files.py  # 列出檔案
└── README.md

範例

Python 程式碼

import requests

OPENWEBUI\\\_URL = "http://192.168.0.176:3000"
API\\\_KEY = "your\\\_token"

headers = {
    "Authorization": f"Bearer {API\\\_KEY}"
}

# 搜尋知識庫
def search\\\_knowledge(query):
    response = requests.post(
        f"{OPENWEBUI\\\_URL}/api/v1/rag",
        headers=headers,
        json={"query": query}
    )
    return response.json()

# 上傳檔案
def upload\\\_file(file\\\_path):
    with open(file\\\_path, 'rb') as f:
        files = {'file': f}
        response = requests.post(
            f"{OPENWEBUI\\\_URL}/api/v1/files/upload",
            headers=headers,
            files=files
        )
    return response.json()

常見問題

Q: 需要認證嗎?

A: 是的,需要從 Open WebUI 取得 API Token

Q: 支援哪些檔案格式?

A: PDF、Word、Excel、PPT、TXT、Markdown 等

Q: 如何取得 API Token?

A: 登入 Open WebUI → 設定 → 帳號 → API Token

授權

MIT License

---

Author: kuanlin.huang Version: 1.0.3

Usage Guidance
What to check before installing: - This skill appears to do what it says: talk to an Open WebUI instance, upload/list files, and query RAG. There is no sign of exfiltration to unknown endpoints in the code — network calls are only made to OPENWEBUI_URL. - Fix or confirm environment/dependency declarations: you must set OPENWEBUI_URL and OPENWEBUI_API_KEY (the skill will not work without them). Also ensure python3 and the requests package are installed. The bash wrapper uses curl and jq — install those (or avoid using the bash wrapper) or the script will fail. - The package metadata is inconsistent (some manifests claim no env vars, meta.json shows different version, requires.bins lists a Python package as a binary). Treat this as sloppy packaging rather than proof of malice, but ask the author to correct the manifests or run the code in a sandbox first. - Security hygiene: only point OPENWEBUI_URL at servers you trust (prefer local or LAN instances). Treat the API key like any JWT/secret: do not reuse a high-privilege token if you can create a scoped token. If unsure, run the scripts manually in a controlled environment to verify behavior before granting the skill to an autonomous agent. - If you want higher assurance, request the publisher to: (1) fix manifest (declare OPENWEBUI_API_KEY as primaryEnv), (2) declare required binaries (curl, jq, python3), and (3) provide a canonical install instruction or packaged release.
Capability Analysis
Type: OpenClaw Skill Name: claw-openwebui-api Version: 1.0.3 The skill bundle is a legitimate integration for the Open WebUI API, allowing the agent to manage knowledge bases and upload files. All scripts (claw-openwebui.sh and the Python scripts in /scripts) perform standard REST API operations using user-provided environment variables for authentication and endpoint configuration. No evidence of data exfiltration, obfuscation, or malicious prompt injection was found; the code logic is transparent and aligns with the stated purpose.
Capability Assessment
Purpose & Capability
The scripts and SKILL.md clearly implement Open WebUI RAG actions and legitimately need OPENWEBUI_URL and OPENWEBUI_API_KEY. However registry-level metadata at the top of the package summary said 'Required env vars: none' while SKILL.md and _meta.json declare OPENWEBUI_URL and OPENWEBUI_API_KEY. The requires.bins entry lists ['python3','requests'] which is incoherent (requests is a Python package, not a binary). The bash script uses curl and jq but neither is declared as required. These mismatches mean the declared requirements do not reliably represent what the skill actually needs to operate.
Instruction Scope
The SKILL.md and included scripts limit actions to contacting the Open WebUI endpoint, listing/uploading files, creating knowledge collections, and invoking chat/search endpoints. They require reading local files when uploading (expected). The instructions do not instruct the agent to read unrelated system files or exfiltrate data to other endpoints. Overall the runtime behavior stays within the stated purpose, but the README/SKILL.md instruct users to clone and set environment variables with explicit examples that point to local or LAN URLs.
Install Mechanism
There is no high-risk download/install step: SKILL.md suggests installing the Python requests package (pip). The package includes shell and Python scripts (no remote install from arbitrary hosts). However the bundled metadata/install information is inconsistent (SKILL.md has a pip entry; registry said no install spec). Also the bash script depends on curl and jq (not installed by pip) — missing declared dependencies may lead to runtime failures or accidental behavior when fallback occurs.
Credentials
The code legitimately needs OPENWEBUI_URL and OPENWEBUI_API_KEY (a single API credential) and no other secrets. But the package metadata presented in multiple places is inconsistent: some places list no required env vars, others list the two vars. The skill does not request unrelated credentials, which is good, but the inconsistent declaration (and missing primaryEnv setting) is a red flag that manifests were not maintained correctly and could confuse automated permission checks.
Persistence & Privilege
The skill is not always:true, is user-invocable, and does not request elevated/persistent system-wide privileges. It does not modify other skills or system configs. Autonomy (disable-model-invocation:false) is the platform default and is not, by itself, an additional concern here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install claw-openwebui-api
  3. After installation, invoke the skill by name or use /claw-openwebui-api
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.3
- Added Bash script claw-openwebui.sh for direct shell usage and automation. - Expanded installation and usage instructions to include both OpenClaw natural language commands and new Bash command-line examples. - Updated documentation to reflect Bash usage and clarify setup steps. - Changed skill author to kuanlin.huang and incremented version to 1.0.3.
v1.0.2
- Author name updated from 南極磷蝦 to Ken. - Version number updated to 1.0.2. - Unified variable and path formatting by adding extra backslashes for escaping. - Minor edits to example values and comments for clarity. - No changes to functionality or API usage.
v1.0.1
- No functional changes; documentation formatting and minor text adjustments only. - Installation section was removed from the documentation. - Example default host/IP changed from LAN IP to localhost (127.0.0.1) in some config code blocks. - No code or feature changes in this release.
v1.0.0
- Initial release of Claw_OpenWebUI_API. - Integrates Open WebUI RAG knowledge base API for automatic file upload and knowledge retrieval. - Provides scripts to upload documents, search the knowledge base, and enhanced chat features using knowledge base content. - Requires environment variables OPENWEBUI_URL and OPENWEBUI_API_KEY. - Supports various document formats, including PDF, Word, Excel, PPT, TXT, and Markdown.
Metadata
Slug claw-openwebui-api
Version 1.0.3
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 4
Frequently Asked Questions

What is open-webui-api 操作技能?

整合 Open WebUI RAG 知識庫 API,讓 OpenClaw 能自動上傳文件和查詢知識庫。 It is an AI Agent Skill for Claude Code / OpenClaw, with 275 downloads so far.

How do I install open-webui-api 操作技能?

Run "/install claw-openwebui-api" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is open-webui-api 操作技能 free?

Yes, open-webui-api 操作技能 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does open-webui-api 操作技能 support?

open-webui-api 操作技能 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created open-webui-api 操作技能?

It is built and maintained by ken (@dolphins1123); the current version is v1.0.3.

💬 Comments