Plugboard
Use the ChatGPT, Claude, Copilot and OpenCode Go logins in your OpenCode server from any app: an OpenCode V2 plugin serving OpenAI, Anthropic and Gemini compatible APIs.
1
7,223
近 7 天 4.9k
46.1
生态多维模型
2 小时前
2026-10-21
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugboard@0.62.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugboard@0.62.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-plugboardOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Use the models you already log in to in OpenCode (ChatGPT, Claude, GitHub Copilot, OpenCode Go and the rest) from any app that speaks the OpenAI, Anthropic or Gemini API.
Plugboard is an OpenCode V2 plugin. It opens an HTTP listener inside your OpenCode server and answers those APIs with your connected providers. Each app gets its own key, model list and limits. Tool calls go back to your app; OpenCode never runs them.
Documentation: https://jjjermiah.github.io/opencode-plugboard
Install
bunx opencode-plugboard@latest init --fast anthropic/claude-haiku-4-5
This adds plugboard to your global OpenCode config (~/.config/opencode/opencode.jsonc), creates a key for one app, allows every model you are logged in to, and prints the key. Use a model you are logged in to; without --fast, call a model id from GET /v1/models. Restart OpenCode, then run opencode api get /api/agent once so it loads the plugin. To write the entry by hand instead:
{
"plugins": [
{
"package": "opencode-plugboard@0.62.1",
"options": {
"keys": { "my-app": "{env:PLUGBOARD_KEY_MY_APP}" },
"models": "all",
"aliases": { "fast": "anthropic/claude-haiku-4-5" }
}
}
]
}
First request
export PLUGBOARD_KEY=<the key init printed>
curl -s http://127.0.0.1:4010/v1/chat/completions \
-H "Authorization: Bearer $PLUGBOARD_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "fast", "messages": [{"role": "user", "content": "reply with exactly: pong"}]}' \
| jq -r '.choices[0].message.content'
Any SDK works the same way: set its base URL to http://127.0.0.1:4010/v1 (Anthropic and Gemini SDKs: http://127.0.0.1:4010) and its API key to your plugboard key.
What it serves
| API | Endpoints |
|---|---|
| OpenAI Chat Completions | POST /v1/chat/completions |
| OpenAI Responses | POST /v1/responses, GET/DELETE /v1/responses/{id}, GET /v1/responses/{id}/input_items |
| Anthropic Messages | POST /v1/messages, POST /v1/messages/count_tokens |
| Gemini | POST /v1beta/models/{model}:generateContent, :streamGenerateContent, :countTokens |
| Files | /v1/files (OpenAI and Anthropic), /upload/v1beta/files and /v1beta/files (Gemini) |
| Legacy completions | POST /v1/completions |
| Models | GET /v1/models, GET /v1/models/{id} |
Streaming, tool calls, structured output, images, PDFs and reasoning output work through the usual SDK calls.
Works with
OpenAI, Anthropic and Google SDKs for Python, JavaScript, Go, .NET and Rust; LangChain, LlamaIndex, pydantic-ai, the Vercel AI SDK, CrewAI and other agent frameworks; Open WebUI, LibreChat, n8n, Dify and Home Assistant; Claude Code, Codex CLI, Gemini CLI, Aider, Cline, Continue and Zed. Setup for each: client pages.
Features
- Per-app keys and rules: each app has its own model scope, system prompt, endpoints and caps.
- Aliases and fallbacks: short model names, and chains that move to the next model when one fails.
- Limits, budgets and caching: concurrency, request rate, daily or monthly spend, and a response cache.
- Tools, structured output, images and files.
- History, usage and monitoring: per-app usage, a dashboard, a TUI page and Prometheus metrics.
- Serving other machines from an always-on OpenCode server.
Plugboard is 0.x: a minor release can change an option or a default. Read the changelog before you move the pin.
Project
Security policy · Contributing · Changelog
MIT licensed. Not affiliated with or endorsed by OpenAI, Anthropic, Google, GitHub or Microsoft.
同类生态推荐
Llm Proxy
opencode-llm-proxy
Local AI gateway for OpenCode with tool/function calling — use any model via OpenAI, Anthropic, or Gemini API format
Magic Compact
magic-compact
Lossless context compression plugin for OpenCode.
Websearch
opencode-websearch
Web search plugin for OpenCode