You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCode + Chinese AI Models: Setup Guide (DeepSeek, GLM, Kimi)
#30
OpenCode + Chinese AI Models: Setup Guide for DeepSeek, GLM & Kimi
OpenCode is a terminal-native AI coding assistant — no IDE required. You interact with it entirely through your shell, making it ideal for SSH sessions, headless servers, and developers who live in the terminal.
Chinese AI models from DeepSeek, Zhipu (GLM), and Moonshot (Kimi) are serious contenders for coding tasks at a fraction of the cost of GPT-4o or Claude. This guide covers the full setup.
Why OpenCode for Chinese Models?
OpenCode works with any OpenAI-compatible API. Since AIWave exposes Chinese models through a standard endpoint, the integration is straightforward — set a base URL and API key, then pick your model.
Practical advantages of the terminal-first approach:
SSH workflows: AI coding on remote servers without forwarding ports or VS Code Remote
Speed: No Electron overhead, responses render directly in terminal
Scripting: Pipe file contents, redirect output, chain with other CLI tools
Terminal sessions use shorter contexts than IDE workflows. Assumptions: 15 prompts per session, 1K input + 500 output tokens per prompt.
Model
Per Query
Per Session (15 prompts)
Monthly (20 sessions)
DeepSeek V4 Flash
$0.00041
$0.0062
$0.12
GLM-5
$0.00403
$0.0605
$1.21
Kimi K2.6
$0.00339
$0.0508
$1.02
GPT-4o (reference)
$0.00750
$0.1125
$2.25
Formula: (1000/1M x input_price) + (500/1M x output_price) per query, x15 prompts, x20 sessions.
At the live AIWave rates above, a month of 20 terminal sessions with DeepSeek V4 Flash is about $0.12. A $1 credit covers roughly 160 sessions at the stated assumptions — about eight months at 20 sessions per month.
Practical Usage
# Code generation
opencode "Add input validation to parse_config in config.py"# Analyze logs
cat error.log | opencode "What caused this error and how to fix it?"# Code review
git diff main | opencode "Review this diff for bugs"
Troubleshooting
Connection refused: Verify base URL ends with /v1 (no trailing slash). Test with curl first:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
OpenCode + Chinese AI Models: Setup Guide for DeepSeek, GLM & Kimi
OpenCode is a terminal-native AI coding assistant — no IDE required. You interact with it entirely through your shell, making it ideal for SSH sessions, headless servers, and developers who live in the terminal.
Chinese AI models from DeepSeek, Zhipu (GLM), and Moonshot (Kimi) are serious contenders for coding tasks at a fraction of the cost of GPT-4o or Claude. This guide covers the full setup.
Why OpenCode for Chinese Models?
OpenCode works with any OpenAI-compatible API. Since AIWave exposes Chinese models through a standard endpoint, the integration is straightforward — set a base URL and API key, then pick your model.
Practical advantages of the terminal-first approach:
Installation
Or without Go:
curl -fsSL https://opencode.ai/install | bashVerify:
opencode --versionConfiguration
Create
~/.config/opencode/config.json:{ "provider": "openai", "base_url": "https://aiwave.live/v1", "api_key": "***", "model": "deepseek-chat" }Switch models with flags:
Or define multiple in config:
{ "provider": "openai", "base_url": "https://aiwave.live/v1", "api_key": "***", "models": { "fast": "deepseek-chat", "reasoning": "glm-5", "balanced": "kimi-k2.6" }, "default_model": "fast" }Then use
opencode --model reasoningoropencode --model balanced.Model Comparison
Prices from AIWave pricing.
Cost Estimates
Terminal sessions use shorter contexts than IDE workflows. Assumptions: 15 prompts per session, 1K input + 500 output tokens per prompt.
Formula: (1000/1M x input_price) + (500/1M x output_price) per query, x15 prompts, x20 sessions.
At the live AIWave rates above, a month of 20 terminal sessions with DeepSeek V4 Flash is about $0.12. A $1 credit covers roughly 160 sessions at the stated assumptions — about eight months at 20 sessions per month.
Practical Usage
Troubleshooting
Connection refused: Verify base URL ends with
/v1(no trailing slash). Test with curl first:**Mode
Read full article on AIWave blog.
AIWave - 48 AI models, one API key. $1 free credit.
Resources
All reactions