Skip to content

About

OpenCode V2 plugin: serve OpenAI, Anthropic and Gemini compatible APIs from your OpenCode server's provider logins, with per-app keys, fallbacks, limits, caching and usage stats.

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,356 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


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.65.2",
      "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.

About

OpenCode V2 plugin: serve OpenAI, Anthropic and Gemini compatible APIs from your OpenCode server's provider logins, with per-app keys, fallbacks, limits, caching and usage stats.

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages