Skip to content

Using AICentOS with OpenCode

Install OpenCode

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

Configure AICentOS

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

Important

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

Launch

bash
cd my-project
opencode

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