Utiliser AICentOS avec OpenCode
Installer OpenCode
bash
npm install -g opencode-ai@latestbash
brew install opencodebash
scoop install opencodeConfigurer AICentOS
- Obtenez votre cle API sur https://www.aicentos.com/console/token
- Definissez la variable d'environnement :
bash
export AICENTOS_TOKEN=sk-xxxpowershell
$env:AICENTOS_TOKEN="sk-xxx"- Creez
opencode.jsona la racine de votre projet ou dans~/.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
Remplacez sk-xxx par votre token reel obtenu depuis la console AICentOS.
Demarrage
bash
cd my-project
opencodeUne fois lance, selectionnez un modele sous le fournisseur AICentOS pour commencer.