OpenCode
Support: pay-as-you-go Xiaoku APIs are supported.
Install the CLI
Node.js 20+ is required.
bash
npm install -g @opencode-ai/opencode-cliCheck: opencode --version
Configure
Option 1 (CLI, recommended)
bash
opencode config set api.provider openai
opencode config set api.key XIAOKU_API_KEY
opencode config set api.baseUrl https://api-ai.xiaoku.ai/v1
opencode config set model deepseek-v4-proOption 2 (interactive)
Run opencode auth, choose the OpenAI provider, and enter the settings when prompted.
Use
Run opencode to start, or opencode --tui for TUI mode.
VS Code extension
Search the VS Code marketplace for the OpenCode AI extension and install it. Add this to settings.json:
json
{
"opencode.apiKey": "XIAOKU_API_KEY",
"opencode.baseUrl": "https://api-ai.xiaoku.ai/v1",
"opencode.model": "deepseek-v4-pro"
}