程式設計助手
OpenCode 設定
在 OpenCode 中將 Modelflare 設定為 OpenAI 相容提供者。
1.建立API金鑰
Section titled “1.建立API金鑰”建立一個 Modelflare API 金鑰,其非預設群組可以存取 gpt-5.6-sol。
2.安裝OpenCode
Section titled “2.安裝OpenCode”choco install opencodeopencode --versioncurl -fsSL https://opencode.ai/install | bashopencode --version3. 建立opencode.json
Section titled “3. 建立opencode.json”輸入您的專案目錄,然後執行適合您的系統的命令。
$config = @'{ "$schema": "https://opencode.ai/config.json", "model": "modelflare/gpt-5.6-sol", "provider": { "modelflare": { "npm": "@ai-sdk/openai-compatible", "name": "Modelflare", "options": { "baseURL": "https://modelflare.dev/v1" }, "models": { "gpt-5.6-sol": { "name": "GPT 5.6 Sol" } } } }}'@$utf8NoBom = New-Object System.Text.UTF8Encoding -ArgumentList $false[System.IO.File]::WriteAllText( (Join-Path (Get-Location) "opencode.json"), $config, $utf8NoBom)cat > opencode.json << 'EOF'{ "$schema": "https://opencode.ai/config.json", "model": "modelflare/gpt-5.6-sol", "provider": { "modelflare": { "npm": "@ai-sdk/openai-compatible", "name": "Modelflare", "options": { "baseURL": "https://modelflare.dev/v1" }, "models": { "gpt-5.6-sol": { "name": "GPT 5.6 Sol" } } } }}EOF4. 連接您的 API 金鑰
Section titled “4. 連接您的 API 金鑰”在同一專案目錄中啟動OpenCode:
opencode輸入 /connect,選擇 **其他 **,將提供者 ID 設定為 modelflare,然後貼上您的 Modelflare API 金鑰。
5.選擇型號並測試
Section titled “5.選擇型號並測試”輸入/models,選擇modelflare/gpt-5.6-sol,然後傳送:
Reply with one short greeting.正常回覆表示設定完成。