AI Providers
Magic Shell supports two AI providers, each with their own strengths.
OpenCode Zen (Recommended)
Section titled “OpenCode Zen (Recommended)”OpenCode Zen provides curated models optimized for coding tasks. It’s the default provider and offers several free models.
Free Models
Section titled “Free Models”| Model | Description |
|---|---|
grok-code | xAI’s Grok Code Fast 1 - fast and capable |
glm-4.7 | GLM 4.7 - good general purpose |
minimax-m2.1-free | MiniMax M2.1 - efficient |
big-pickle | Stealth model - experimental |
Premium Models
Section titled “Premium Models”| Model | Description |
|---|---|
claude-sonnet-4-5 | Anthropic’s hybrid reasoning model |
claude-opus-4-5 | Anthropic’s most capable model |
kimi-k2 | Moonshot’s Kimi K2 |
kimi-k2-thinking | Kimi K2 with extended reasoning |
qwen3-coder | Alibaba’s massive coding model |
glm-4.6 | Zhipu AI’s capable model |
Get an API Key
Section titled “Get an API Key”- Visit opencode.ai/auth
- Sign up or log in
- Copy your API key
- Run
msh --setupand paste it
OpenRouter
Section titled “OpenRouter”OpenRouter provides access to models from many providers through a single API.
Free Models
Section titled “Free Models”| Model | Description |
|---|---|
mimo-v2-flash | MiMo V2 Flash |
deepseek-v3 | DeepSeek V3 |
Premium Models
Section titled “Premium Models”| Model | Description |
|---|---|
claude-sonnet-4.5 | Anthropic Claude Sonnet 4.5 |
claude-opus-4.5 | Anthropic Claude Opus 4.5 |
deepseek-r1 | DeepSeek R1 reasoning model |
glm-4.7 | Zhipu AI’s capable model |
Get an API Key
Section titled “Get an API Key”- Visit openrouter.ai/keys
- Create an account
- Generate a new API key
- Run
msh --setupand select OpenRouter
Switching Providers
Section titled “Switching Providers”Via CLI
Section titled “Via CLI”# Switch to OpenRoutermsh --provider openrouter
# Switch back to OpenCode Zenmsh --provider opencode-zenVia TUI
Section titled “Via TUI”Press Ctrl+X S to open the provider switcher.
Switching Models
Section titled “Switching Models”Via CLI
Section titled “Via CLI”# List available modelsmsh --models
# Set default modelmsh --model big-pickleVia TUI
Section titled “Via TUI”Press Ctrl+X M to open the model picker.
Model Recommendations
Section titled “Model Recommendations”| Use Case | Recommended Model |
|---|---|
| Quick commands | big-pickle (free) |
| Complex git operations | claude-sonnet-4.5 |
| System administration | grok-code or glm-4.7 |
| Multi-step tasks | claude-opus-4.5 or kimi-k2-thinking |
| Learning/experimenting | Any free model |
Environment Variables
Section titled “Environment Variables”Set your API keys via environment variables:
# OpenCode Zenexport OPENCODE_ZEN_API_KEY="your-key"
# OpenRouterexport OPENROUTER_API_KEY="your-key"Keys stored in the system keychain (via msh --setup) take precedence over environment variables.