Skip to content

Using FishXCode with OpenCode

Install OpenCode

bash
npm install -g opencode-ai@latest
bash
brew install opencode
bash
scoop install opencode

Configure FishXCode

  1. Get your API Key from https://fishxcode.com/console/token
  2. Set the environment variable:
bash
export FISHXCODE_TOKEN=sk-xxx
powershell
$env:FISHXCODE_TOKEN="sk-xxx"
  1. Create opencode.json in your project root or ~/.config/opencode/:
json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "fishxcode-anthropic": {
      "npm": "@ai-sdk/anthropic",
      "name": "fishxcode-anthropic",
      "options": {
        "baseURL": "https://fishxcode.com/v1",
        "apiKey": "{env:FISHXCODE_TOKEN}"
      },
      "models": {
        "claude-sonnet-4-6": {
          "name": "claude-sonnet-4-6"
        }
      }
    },
    "fishxcode-openai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "fishxcode-openai",
      "options": {
        "baseURL": "https://fishxcode.com/v1",
        "apiKey": "{env:FISHXCODE_TOKEN}"
      },
      "models": {
        "gpt-5.2-codex": {
          "name": "gpt-5.2-codex"
        }
      }
    }
  }
}

Important

Replace sk-xxx with your actual Token from the FishXCode console.

Launch

bash
cd my-project
opencode

Once launched, select a model under the FishXCode provider to start coding.