協定:OpenAI 相容
- Base URL:
https://api.orcarouter.ai/v1(包含/v1)
安裝
設定
設定檔:~/.config/opencode/opencode.json。
google/gemini-2.5-flash 或
anthropic/claude-opus-4.8。模型 ID 一律使用 vendor/model 格式。
執行
OK。
注意事項
- base URL 必須包含
/v1。 - 模型引用使用
provider/model格式。由於 provider 名稱為orcarouter,而模型 ID 本身也帶有vendor前綴,因此 引用為三段:orcarouter/orcarouter/auto(或指定特定模型時為orcarouter/anthropic/claude-opus-4.8)。
VS Code 擴充功能: OpenCode 的官方 VS Code 擴充功能(
sst-dev.opencode)
會在編輯器內執行 CLI,並共用同一份 opencode.json——沒有
獨立的編輯器內端點設定。只要依上述方式設定一次,擴充功能
就會沿用。啟用思考/推理
在模型的options 中設定 reasoningEffort:
reasoningEffort 也能規避上述的 temperature 警告——
啟用思考後,temperature = 1 是合法的,因此 400 會消失。若要
使用 Anthropic 原生控制,@ai-sdk/anthropic provider 接受
thinking: { type: "enabled", budgetTokens: N }。