Every Model, One CLI
Use any LLM from any provider. Switch models mid-session without losing context. All via litellm.
Switch Models Mid-Session
/model gpt-4oSwitch in-session
/modelsList all models
apex --model gpt-4o "prompt"Specify on launch
claude-sonnet-4.6anthropic/claude-sonnet-4-6Claude Sonnet 4.6 — 1M context, extended thinking
Best for: General coding, debugging, refactoring
claude-opus-4.7anthropic/claude-opus-4-7Claude Opus 4.7 — 1M context, most capable
Best for: Complex architecture, multi-file refactoring
claude-sonnet-4.5anthropic/claude-sonnet-4-5Claude Sonnet 4.5 — latest reasoning
Best for: Advanced coding, complex reasoning
claude-opus-4.5anthropic/claude-opus-4-5Claude Opus 4.5 — premium reasoning
Best for: Complex tasks, deep analysis
claude-haiku-4.5anthropic/claude-haiku-4-5Claude Haiku 4.5 — fast & affordable
Best for: Quick edits, simple queries, chat
claude-3.7-sonnetanthropic/claude-3-7-sonnet-20250219Claude 3.7 Sonnet — enhanced coding
Best for: Advanced coding, complex reasoning
claude-3.5-haikuanthropic/claude-3-5-haiku-20241022Claude 3.5 Haiku — fastest Claude
Best for: Quick edits, simple queries, cost-effective
Cost Comparison
Approximate pricing per 1M tokens. Prices vary by provider and may change.
| Model | Input/1M | Output/1M | Speed | Best For |
|---|---|---|---|---|
| GPT-5 | $1.25 | $10.00 | Fast | General coding |
| GPT-5 Mini | $0.25 | $2.00 | Very Fast | Budget coding |
| GPT-5 Nano | $0.05 | $0.40 | Very Fast | Ultra-budget |
| GPT-4o | $2.50 | $10.00 | Fast | General coding |
| GPT-4o Mini | $0.15 | $0.60 | Very Fast | Budget coding |
| Claude Sonnet 4.6 | $3.00 | $15.00 | Fast | Code quality |
| Claude Opus 4.7 | $5.00 | $25.00 | Medium | Complex tasks |
| Claude Haiku 4.5 | $1.00 | $5.00 | Very Fast | Quick edits |
| Gemini 2.5 Pro | $1.25 | $10.00 | Fast | Long context |
| Gemini 2.5 Flash | $0.30 | $2.50 | Very Fast | Fast coding |
| DeepSeek V4 Flash | $0.14 | $0.28 | Fast | Best value |
| DeepSeek V4 Pro | $1.74 | $3.48 | Medium | Reasoning |
| Grok 4 Fast | $0.20 | $0.50 | Very Fast | Fast reasoning |
| Mistral Large 3 | $0.50 | $1.50 | Fast | Balanced coding |
| Qwen3 Coder Plus | $1.00 | $5.00 | Fast | Code specialist |
| Command A | $2.50 | $10.00 | Fast | Enterprise RAG |
| Ollama (Local) | Free | Free | Varies | Privacy/offline |
Performance Optimization
Use Fast Models for Edits
Switch to gpt-4o-mini or claude-3.5-haiku for quick edits and simple queries. Save expensive models for complex tasks.
Clear Context Regularly
Use /clear to free up context window. Long conversations consume tokens even for small requests.
Use Streaming Mode
Enable streaming with apex --stream for real-time output. Reduces perceived latency significantly.
Leverage Local Models
Use Ollama for privacy-sensitive code or when offline. Zero cost, zero data leaving your machine.
Monitor Costs
Use /cost to check token usage and estimated costs in real-time. Set budget alerts in your config.
Choose the Right Model
Reasoning tasks → o1/deepseek-r1. Code gen → gpt-4o/claude-sonnet. Budget → gpt-4o-mini/deepseek-chat.