OpenCode
OpenCode should treat CoAIWork as an OpenAI Compatible Provider.
Configuration Values
| Item | Value |
|---|---|
| Base URL | https://coaiwork.com/v1 |
| Request path relative to Base URL | /chat/completions |
| Default model | gpt-5.4 |
| Authentication | CoAIWork API token |
| Protocol | OpenAI Chat Completions |
| Project config file | opencode.json in the project root |
Because the base URL already includes /v1, OpenCode requests /chat/completions. The full URL is https://coaiwork.com/v1/chat/completions.
Recommended opencode.json
{
"provider": {
"coaiwork": {
"npm": "@ai-sdk/openai-compatible",
"name": "CoAIWork",
"options": {
"baseURL": "https://coaiwork.com/v1"
},
"models": {
"gpt-5.4": {
"name": "gpt-5.4"
}
}
}
},
"model": "coaiwork/gpt-5.4"
}
macOS
curl -fsSL https://opencode.ai/install | bash
opencode
Then run /connect and provide:
- provider id:
coaiwork - API key:
<YOUR_TOKEN>
Create opencode.json in the project root and run:
opencode
Linux
curl -fsSL https://opencode.ai/install | bash
opencode
Then run /connect, set provider id to coaiwork, and enter your token.
Windows
npm install -g opencode-ai
opencode
Then run /connect, set provider id to coaiwork, and enter your token.