Generated from the Valves class by python3 build.py; edit the
descriptions in src/80_pipe.py, not here. Set them in Open WebUI under
Admin → Functions → the pipe → Valves. Valves are global to the function,
not per user.
| Valve | Type | Default | What it does |
|---|---|---|---|
ANTHROPIC_API_KEY |
str | (empty) | Anthropic API key (pay-per-token), from the Claude Console. The path Anthropic's docs name for products built on the Agent SDK, and the only credential to use on an instance with more than one user. Leave empty to use CLAUDE_CODE_OAUTH_TOKEN or inherit from the backend env. |
CLAUDE_CODE_OAUTH_TOKEN |
str | (empty) | Single-user installs only. Long-lived Claude Pro/Max/Team OAuth token from claude setup-token, authenticating your own subscription for your own use. Takes priority over ANTHROPIC_API_KEY (the key is unset so it can't override). Anthropic's docs say SDK-based products should use an API key and its position on subscription use has changed before; treat this path as unsupported and subject to change. Never set it on an instance other people use: routing their requests through your plan is what Anthropic's terms forbid. |
MODEL |
str | claude-haiku-4-5 |
Claude model ID (e.g. claude-haiku-4-5, claude-sonnet-4-6, claude-opus-4-7). |
TASK_MODEL |
str | claude-haiku-4-5 |
Model that answers Open WebUI's background tasks (chat title, tags, follow-up suggestions) when a chat on this pipe has no Task Model set in Admin > Settings > Interface. One short call with no tools per task. Empty answers nothing: Open WebUI then titles the chat with its first message. |
MODELS |
str | (empty) | Comma-separated EXTRA Claude model IDs to expose as separate picker entries (e.g. claude-haiku-4-5,claude-opus-4-8). Each gets its own model named by ID; the base entry still uses MODEL. |
INLINE_TOOL_DETAILS |
bool | True |
Render tool inputs/thinking as inline Detailsblocks in the message text. The web UI shows these as collapsibles, but some mobile clients (e.g. Conduit) render the raw tags as text - set False there; tool activity still appears via status events. |
PERMISSION_MODE |
str | bypassPermissions |
Permission mode: "default", "acceptEdits", "bypassPermissions", "plan", or "dontAsk". |
ALLOWED_TOOLS |
str | Read,Write,Edit,Bash,Glob,Grep,WebSearch,WebFetch |
Comma-separated tools auto-approved without prompting. |
WORKDIR_ROOT |
str | /tmp/claude-agent-pipe |
Root directory for per-chat workspaces (one subdir per chat) and the pipe's session metadata. Must be writable by the Open WebUI process; make it persistent so sessions survive restarts. Blank falls back to the default. |
CLAUDE_CONFIG_DIR |
str | (empty) | Directory the Claude Code CLI keeps its own state in (session transcripts, settings) — the CLAUDE_CONFIG_DIR it is started with. Empty inherits the process default, $HOME/.claude. In a container, set a persistent path (e.g. <WORKDIR_ROOT>/claude-config) or every session dies with the container; note SETTING_SOURCES=user then reads CLAUDE.md and settings.json from here, not from ~/.claude. |
GATEWAY_CONTRACT_PATH |
str | (empty) | Path to a rules file (e.g. ~/gateway/AGENTS.md) appended to the system prompt when a chat is rooted outside WORKDIR_ROOT (a #repo: session), where the agent would otherwise load only that repo's CLAUDE.md and never see the gateway's Hard Rules. Empty disables the append. |
ASK_USER |
bool | True |
Register the ask_user tool: the agent can pause mid-turn and show a multiple-choice form (Open WebUI's request:user_input event). Clients without a socket session (mobile apps, API callers) get the questions as markdown in the reply and answer in the next message instead. |
ASK_USER_WAIT_MINUTES |
int | 30 |
How long a turn waits for an ask_user form (1-240 minutes). The form itself never expires; this only ends the wait for a form that can no longer answer (the chat was switched or reloaded), after which the agent repeats the questions as text and ends the turn. Open WebUI's WEBSOCKET_EVENT_CALLER_TIMEOUT cuts the wait first if it is shorter, with the same outcome. |
ASK_USER_REARM_SECONDS |
int | 60 |
Re-send an unanswered ask_user form every N seconds (10-110; 0 disables). A re-send reaches only the sessions that have not yet received the form (a tab or device opened after it fired), so a form already on screen is never replaced and a half-typed answer survives. The web client drops a form that arrives while the chat is not open or the reply is not yet in view, and never says so; the questions are also streamed into the reply, and an answer typed into the chat is delivered to the waiting form. Conduit dismisses its form after 2 minutes; that cancel is recognised by its timing and the form goes back to that session at the next re-send. |
SESSION_SEARCH |
bool | True |
Register search_chats / read_chat: the agent can look up the calling user's earlier chats in this Open WebUI (read-only sqlite over the chat table, scoped to that user). Only sqlite deployments; leave on elsewhere, the tools then report themselves unavailable. |
REMOTE_MCP_SERVERS |
str | (empty) | Remote MCP servers attached to every turn, as a JSON object name -> {"url": "https://...", "headers": {...}}. Example: {"linear": {"url": "https://mcp.linear.app/mcp", "headers": {"Authorization": "Bearer lin_api_..."}}}. Header values are credentials and live in Open WebUI's database like the keys above; they reach Claude Code through a 0600 file, never its command line. Names must be lowercase [a-z0-9_-]; plain http only to localhost. Each server's tools are allowed as mcp__ and arrive deferred, so the agent finds them through ToolSearch. A malformed entry is logged and skipped; the rest still load. |
CHAT_DB_PATH |
str | (empty) | Path to Open WebUI's webui.db for SESSION_SEARCH. Empty resolves DATA_DIR/webui.db from the running Open WebUI. |
MAX_TURNS |
int | 30 |
Maximum agent turns per user message. 0 disables the cap. |
CONTEXT_WINDOW_TOKENS |
int | 200000 |
FALLBACK context window (tokens) for the post-turn 'Done · X/Y (N%)' status line, used only when the SDK's live context query fails (which otherwise supplies the real per-model window). 0 disables the fallback suffix. |
COLD_RESUME_GUARD |
bool | False |
Hold a message sent to a large chat that has sat idle past the prompt cache's lifetime, and reply with a warning plus a pickup note for a new chat instead of running the agent. Resuming such a chat re-processes its whole context as a cache write (2x the input price), so one message can cost as much as a long conversation. The next reply goes ahead regardless (continue sends the held message); a message starting with '/resume' skips the check. Chats from clients that send no chat id (Conduit) are never held. |
COLD_RESUME_IDLE_MINUTES |
int | 60 |
Minutes since a chat's last completed turn after which COLD_RESUME_GUARD treats it as cold. 60 matches the 1-hour prompt cache; lower warns on chats that may still be warm. |
COLD_RESUME_MIN_CONTEXT_TOKENS |
int | 150000 |
Smallest context (tokens, as of the chat's last turn) that COLD_RESUME_GUARD holds. Below it, re-processing a cold chat costs too little to be worth interrupting for. |
EFFORT |
str | (empty) | Default effort level for agent turns: low|medium|high|xhigh|max. Empty = SDK default (high). The chat's Reasoning Effort field (Controls > Advanced Params) overrides it for that chat; a message starting with '/effort ' overrides both for that turn. |
TASK_BUDGET_TOKENS |
int | 0 |
Per-turn token budget the model is made aware of and paces itself against (output_config.task_budget). API minimum is 20000 — smaller nonzero values are ignored. 0 disables. |
FALLBACK_MODEL |
str | (empty) | Model to retry with if the primary model fails or is unavailable (SDK fallback_model). Empty disables. |
MAX_BUFFER_MB |
int | 32 |
Maximum size (MiB) of a single stream-json message read back from the Claude Code CLI. The SDK's own default is 1 MiB, which a Read of any attachment over ~780 KiB blows past once base64 expansion (~1.34x) and the JSON envelope are counted — killing the message reader mid-response. 32 MiB clears the 10 MiB image-attachment cap with room to spare and matches the Anthropic API's own 32 MB request-body ceiling, so the framer stops rejecting payloads the API would have accepted. 0 falls back to the SDK default. |
SCAN_TMP_ARTIFACTS |
bool | False |
Also scan /tmp for files the agent created during the turn and attach them to the reply (the agent often writes there from habit). /tmp is shared by every user of the host, so a file another chat wrote in the same window would be attached too — enable on single-user hosts only. |
MAX_ARTIFACTS_PER_TURN |
int | 25 |
Maximum new files uploaded and linked in one turn (1-500). The cap prevents runaway checkouts or exports from linking thousands of files into one message; one incident linked 29,122 files, and the 500 ceiling keeps that runaway unreachable. |
MAX_INLINE_IMAGES |
int | 8 |
Maximum uploaded images rendered inline in one turn (1-50); later images become download links. Inline images come out of the MAX_ARTIFACTS_PER_TURN budget, so that valve must be at least this high for the full count to render. The cap prevents image-heavy messages from locking the browser tab, which the same incident did with 1,972 inline images. |
PUBLIC_BASE_URL |
str | (empty) | Absolute origin for artifact links, e.g. https://chat.example.com. Empty falls back to the WEBUI_URL environment variable, then to relative URLs. Native clients (Conduit) cannot resolve relative links. |
SETTING_SOURCES |
str | (empty) | Comma-separated Claude Code setting sources to load: any of "user", "project", "local". Empty (default) loads NONE — each chat runs from a clean baseline and does NOT inherit the backend user's ~/.claude/ or the workdir's .claude/ config. Add "user" to load ~/.claude/CLAUDE.md and ~/.claude/settings.json (persistent context for single-user setups). WARNING: settings.json can define hooks that execute code and permission grants — only enable on instances you trust and control. Avoid on multi-user/public deployments. |
REPO_MAP |
str | (empty) | Comma-separated name=path allowlist of repos a chat may run in, e.g. app=/srv/app,notes=/home/me/notes. Start a chat's FIRST message with #repo: to set its cwd to that path for the whole chat (loads the repo's CLAUDE.md via the project setting source). Unknown names error in-chat. Empty disables the feature. Grants nothing new — bypassPermissions already reaches these paths; this only controls cwd. |