Using NBility with OpenCode
Install OpenCode
bash
npm install -g opencode-ai@latestbash
brew install opencodebash
scoop install opencodeConfigure NBility
- Get your API Key from https://nbility.dev/console/token
- Set the environment variable:
bash
export NBility_TOKEN=sk-xxxpowershell
$env:NBility_TOKEN="sk-xxx"- Create
opencode.jsonin your project root or~/.config/opencode/:
json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"nbility-anthropic": {
"npm": "@ai-sdk/anthropic",
"name": "nbility-anthropic",
"options": {
"baseURL": "https://nbility.dev/v1",
"apiKey": "{env:NBility_TOKEN}"
},
"models": {
"claude-sonnet-4-6": {
"name": "claude-sonnet-4-6"
}
}
},
"nbility-openai": {
"npm": "@ai-sdk/openai-compatible",
"name": "nbility-openai",
"options": {
"baseURL": "https://nbility.dev/v1",
"apiKey": "{env:NBility_TOKEN}"
},
"models": {
"gpt-5.2-codex": {
"name": "gpt-5.2-codex"
}
}
}
}
}Important
Replace sk-xxx with your actual Token from the NBility console.
Launch
bash
cd my-project
opencodeOnce launched, select a model under the NBility provider to start coding.