OpenCode Model Switch

Terminal-first coding agent with 75+ providers

CALCULATING...

OpenCode is an MIT-licensed terminal AI coding agent with a desktop app and IDE extension. It supports 75+ LLM providers through Models.dev, local models, and hot-swapping between providers without restarting your session.

Switching Instructions & Commands

Step 1
Install OpenCode
curl -fsSL https://opencode.ai/install | bash
Or use `npm install -g opencode-ai`. Verify with `opencode --version`.
Step 2
Authenticate DeepSeek
opencode auth login
Choose DeepSeek and paste your API key. The credential is stored locally, not in the repo.
Step 3
Start a session on DeepSeek V4.1 Flash
opencode -m deepseek/deepseek-v4.1-flash
Inside the TUI, type /models to switch interactively. The model id format is provider/model.
Step 4
Make the choice permanent
printf '{\n "$schema": "https://opencode.ai/config.json",\n "model": "deepseek/deepseek-v4.1-flash"\n}\n' > opencode.json
Commit opencode.json to the project so every teammate starts on the same model.

DeepSeek Peak Pricing Impact on OpenCode

⚠ Signal Ember Rule: Peak hours cost exactly 2x (100% price increase).

DeepSeek peak rates apply on weekdays from 01:00-04:00 and 06:00-10:00 UTC. V4.1 Flash costs $0.30/M input and $1.20/M output at peak, versus $0.15/M and $0.60/M off-peak. A 5M-input / 500K-output coding day costs $1.80 at peak and $1.05 off-peak. Weekends are entirely off-peak.

Data verified from https://opencode.ai/docs/models/ on 2026-10-17.