OpenCode
OpenCode is an AI coding agent for the terminal. This guide shows you how to set it up with KiosAPI.Prerequisites
- Node.js 18+ — check with
node --version - A KiosAPI API key (starts with
sk-) created in the group matching your models —Codex-Pro/Codex-Plusfor gpt-5.x/gpt-6,Claude-Kirofor Claude,Geminifor Gemini (see Choosing a Token Group)
Installation
Install OpenCode globally:Configuration
1. Set environment variables
Windows (PowerShell):~/.bashrc or ~/.zshrc:
2. Config file
Create or edit~/.config/opencode/config.json:
sk-xxx with your actual KiosAPI key.
Usage
Interactive mode
Direct question
Specify a model
Troubleshooting
Authentication Error
- Verify
OPENAI_API_KEYis set correctly:echo $OPENAI_API_KEY - Ensure the key starts with
sk- - Check that
apiBasein the config file matches the environment variable
Model Not Found
- Check the model name is valid on the KiosAPI models page
- Ensure the model is included in your token group
