Multi-model support and anti-locking strategies
OpenCode is vendor-neutral by the following design:
- Standardized interface design: Abstraction of differences across vendors through a unified API, profile support
openai:///anthropic://Multiple protocol headers such as - thermal cutover mechanism: The runtime can be accessed through the
/model switchCommand to instantly switch between models of different suppliers - Cost Comparison Function: Built-in
/statsCommand to display the actual token and fee consumed by each model
Configuration example: in~/.opencode/config.yamlMultiple model endpoints can be configured at the same time in the
models:
claude: anthropic://API_KEY@v1
gpt4: openai://API_KEY@gpt-4
gemini: google://API_KEY@v1beta
To use it, you can add--model geminiparameter to specify the model, or set theDEFAULT_MODEL=claudeEnvironment variables.
This answer comes from the articleOpenCode: AI Programming Intelligence Running in a Terminal EnvironmentThe
































