Skip to content

Install opencode first

Official Documentation

Using Node.js

npm install -g opencode-ai

Configure Provider

https://opencode.ai/docs/providers/

Configure two locations
Provider Configuration (create this file if it doesn't exist)
~ represents the user's home directory, for example C:\Users\admin on Windows
~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://www.kkiai.com/v1"
      }
    }
  }
}
Here I replaced the existing anthropic address
API Key Configuration
~/.local/share/opencode/auth.json

{
  "google": {
    "type": "api",
    "key": "1111111111111111111"
  },
  "anthropic": {
    "type": "api",
    "key": "sk-xxxxxxxxxxxxx"
  }
}
Open Terminal

image.png

Enter /models

image.png

Select a model from anthropic

image.png

Start Using

image.png