Every model OpenCode has connected appears in Open WebUI's model picker through a single OpenAI-compatible connection — no per-model API keys inside Open WebUI. Streaming works; tool calling support depends on Open WebUI's own feature set.
- OpenCode with
opencode-llm-proxyinstalled - A running Open WebUI instance (native or Docker)
Localhost is fine if Open WebUI runs on the same machine:
opencodeFor Docker or a remote Open WebUI, bind to all interfaces and set a token:
OPENCODE_LLM_PROXY_HOST=0.0.0.0 \
OPENCODE_LLM_PROXY_TOKEN=some-long-random-token \
opencode- Settings → Connections → OpenAI API
- Set API Base URL to
http://127.0.0.1:4010/v1 - Leave API Key blank, or set it to your
OPENCODE_LLM_PROXY_TOKEN - Save
Running Open WebUI in Docker on the same host? Use http://host.docker.internal:4010/v1 and start the proxy with OPENCODE_LLM_PROXY_HOST=0.0.0.0. On a different host, use the OpenCode host's LAN IP.
All your OpenCode models should now appear in the model picker. Start a chat and send a message. You can also verify the connection directly:
curl http://127.0.0.1:4010/v1/models- No models listed: the base URL is wrong or the proxy is unreachable from the Open WebUI container/host. Confirm with the
curlabove from the same environment Open WebUI runs in. - Docker cannot reach the host: use
host.docker.internal(same machine) or the real LAN IP (different machine), and ensure the proxy is bound to0.0.0.0. - 401 responses: the API key in Open WebUI must match
OPENCODE_LLM_PROXY_TOKEN.
- Set a token whenever the proxy is bound beyond
127.0.0.1. - Do not expose the proxy to the public internet.
- See security.md for full guidance.