OpenCode
Third-Party Scaffolding — Privacy & Security Warning
Third-party scaffoldings may be serving your data outside your environment. For privacy and cybersecurity refusal optimization, use CAI to obtain the best performance.
OpenCode is an open-source, terminal-based AI coding assistant. It supports OpenAI-compatible providers, which means the Alias API can be plugged in directly without any proxy.
Support Disclaimer
Alias Robotics does not provide support for developments or integrations related to OpenCode. This page documents API compatibility only. Alias simply allows usage of the Alias API through your preferred scaffolding.
Setup
1. Get your Alias API Key
An ALIAS_API_KEY (format: sk-...) can be obtained from either of the following:
- CAI PRO — full cybersecurity AI platform with access to
alias1and other models. - Alias LLMs — acquire
alias2-miniand other Alias language models directly.
2. Install OpenCode
npm install -g opencode-ai
Or via Homebrew (macOS):
brew install sst/tap/opencode
3. Configure the Alias provider
OpenCode uses a ~/.config/opencode/config.json file. Add a custom OpenAI-compatible provider pointing to the Alias API:
{
"provider": {
"alias": {
"api": "https://api.aliasrobotics.com:666/",
"name": "Alias Robotics",
"env": ["ALIAS_API_KEY"]
}
},
"model": "alias/alias1"
}
Then export your key:
export ALIAS_API_KEY="sk-your-alias-api-key-here"
4. Run OpenCode
opencode
OpenCode will pick up the configured provider and route requests to the Alias API.
Alternative: environment variable approach
If you prefer not to edit the config file, OpenCode also respects standard OpenAI environment variables:
export OPENAI_API_KEY="sk-your-alias-api-key-here"
export OPENAI_BASE_URL="https://api.aliasrobotics.com:666/"
opencode --model alias1
Notes
- Use
alias1for best cybersecurity performance, oralias0for a faster, lighter alternative. - Token usage and billing appear in your Alias account dashboard.