feat: add OpenCode Zen provider (opencode/ prefix)#753
feat: add OpenCode Zen provider (opencode/ prefix)#753mqyang56 wants to merge 1 commit intosipeed:mainfrom
Conversation
Add support for OpenCode Zen as a new LLM provider gateway. - Protocol prefix: opencode/ - Default API base: https://opencode.ai/zen/v1 - Supports 30+ models (GPT-5, Claude, Gemini, etc.) via OpenAI-compatible API - Update all README variants and config.example.json with usage examples
There was a problem hiding this comment.
Pull request overview
This PR adds OpenCode Zen as a new LLM provider to PicoClaw, enabling users to access 30+ AI models (GPT-5, Claude, Gemini, etc.) through a single API key via the OpenCode Zen gateway. The implementation follows the established pattern for OpenAI-compatible providers by reusing the existing HTTPProvider infrastructure with zero new dependencies.
Changes:
- Added
opencodeprotocol prefix support with default API basehttps://opencode.ai/zen/v1 - Updated test coverage to include the new provider
- Added configuration examples across documentation files
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/providers/factory_provider.go |
Added opencode to OpenAI-compatible providers case and registered default API base URL |
pkg/providers/factory_provider_test.go |
Added test case for opencode protocol in default API base test |
config/config.example.json |
Added example configuration for OpenCode Zen with sample model and API key placeholder |
README.md |
Added OpenCode Zen to provider table and included vendor-specific configuration example |
README.zh.md |
Added OpenCode Zen to provider table and included vendor-specific configuration example in Chinese |
README.vi.md |
Added OpenCode Zen to provider table (missing vendor-specific config example) |
README.pt-br.md |
Added OpenCode Zen to provider table (missing vendor-specific config example) |
README.ja.md |
Added OpenCode Zen to provider table (missing vendor-specific config example) |
README.fr.md |
Added OpenCode Zen to provider table (missing vendor-specific config example) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [キーを取得](https://cerebras.ai) | | ||
| | **Volcengine** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [キーを取得](https://console.volcengine.com) | | ||
| | **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - | | ||
| | **OpenCode Zen** | `opencode/` | `https://opencode.ai/zen/v1` | OpenAI | [キーを取得](https://opencode.ai/zen) | |
There was a problem hiding this comment.
The vendor-specific configuration example for OpenCode Zen is only included in README.md and README.zh.md, but is missing from this Japanese variant. For consistency, the configuration example section should be added following the same pattern used in the English and Chinese versions (showing the JSON config and the note about getting API keys).
| | **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [Obtenir Clé](https://cerebras.ai) | | ||
| | **Volcengine** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Obtenir Clé](https://console.volcengine.com) | | ||
| | **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - | | ||
| | **OpenCode Zen** | `opencode/` | `https://opencode.ai/zen/v1` | OpenAI | [Obtenir Clé](https://opencode.ai/zen) | |
There was a problem hiding this comment.
The vendor-specific configuration example for OpenCode Zen is only included in README.md and README.zh.md, but is missing from this French variant. For consistency, the configuration example section should be added following the same pattern used in the English and Chinese versions (showing the JSON config and the note about getting API keys).
| | **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [Lấy Khóa](https://cerebras.ai) | | ||
| | **Volcengine** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Lấy Khóa](https://console.volcengine.com) | | ||
| | **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - | | ||
| | **OpenCode Zen** | `opencode/` | `https://opencode.ai/zen/v1` | OpenAI | [Lấy Khóa](https://opencode.ai/zen) | |
There was a problem hiding this comment.
The vendor-specific configuration example for OpenCode Zen is only included in README.md and README.zh.md, but is missing from the other language variants (README.vi.md, README.pt-br.md, README.ja.md, and README.fr.md). For consistency, the configuration example section should be added to all README variants following the same pattern used in the English and Chinese versions.
| | **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [Obter Chave](https://cerebras.ai) | | ||
| | **Volcengine** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Obter Chave](https://console.volcengine.com) | | ||
| | **ShengsuanYun** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - | | ||
| | **OpenCode Zen** | `opencode/` | `https://opencode.ai/zen/v1` | OpenAI | [Obter Chave](https://opencode.ai/zen) | |
There was a problem hiding this comment.
The vendor-specific configuration example for OpenCode Zen is only included in README.md and README.zh.md, but is missing from this Portuguese variant. For consistency, the configuration example section should be added following the same pattern used in the English and Chinese versions (showing the JSON config and the note about getting API keys).
nikolasdehor
left a comment
There was a problem hiding this comment.
Clean, minimal provider addition. The opencode protocol reuses the existing HTTPProvider (OpenAI-compatible), adds a default API base, updates docs across 6 languages, adds example config, and has test coverage.
No concerns — this follows the exact same pattern as every other OpenAI-compatible provider in the codebase. LGTM.
Summary
Closes #752
Adds OpenCode Zen as a new LLM provider. OpenCode Zen is a curated model gateway by the OpenCode team supporting 30+ models (GPT-5, Claude, Gemini, etc.) via a single API key.
opencode/https://opencode.ai/zen/v1(OpenAI-compatible)HTTPProviderChanges
pkg/providers/factory_provider.go— addopencodecase and default API basepkg/providers/factory_provider_test.go— add test coverageconfig/config.example.json— add example entryREADME*.md(6 languages) — update vendor table and add config snippetTest plan
go test ./pkg/providers/ -run TestCreateProviderFromConfigpasses