跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    jjjermiah

    Plugboard

    opencode-plugboard·v0.62.1·模型接入

    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.

    GitHub 星标

    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"]
    }

    OpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。


    opencode-plugboard

    Your OpenCode logins, served as an API

    npm license CI OpenSSF Scorecard

    Apps call plugboard with the OpenAI, Anthropic or Gemini API. Plugboard runs inside your OpenCode server, turns each request into an OpenCode session and uses your provider logins.

    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

    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.

    同类生态推荐