2025-05-21 18:59:09 +00:00
---
title: Models
---
2025-05-22 19:10:08 +00:00
OpenCode uses the [AI SDK](https://ai-sdk.dev/) to have the support for **all the AI models**.
2025-05-21 18:59:09 +00:00
2025-05-22 19:10:08 +00:00
Start by setting the [keys for the providers](/docs/config) you want to use in your OpenCode config.
2025-05-21 19:01:12 +00:00
2025-05-22 19:10:08 +00:00
## Model select
2025-05-21 19:01:12 +00:00
2025-05-22 19:10:08 +00:00
You can now select the model you want from the menu by hitting `Ctrl+O`.
2025-05-21 19:01:12 +00:00
2025-05-22 19:10:08 +00:00
## Multiple models
2025-05-21 19:01:12 +00:00
2025-05-22 19:10:08 +00:00
You can also use specific models for specific tasks. For example, you can use a smaller model to generate the title of the conversation or to run a sub task.
2025-05-21 19:01:12 +00:00
2025-05-22 19:10:08 +00:00
```json title=".opencode.json"
2025-05-21 19:01:12 +00:00
{
"agents": {
"primary": {
2025-05-22 19:10:08 +00:00
"model": "gpt-4",
"maxTokens": 5000
2025-05-21 19:01:12 +00:00
},
"task": {
2025-05-22 19:10:08 +00:00
"model": "gpt-3.5-turbo",
"maxTokens": 5000
2025-05-21 19:01:12 +00:00
},
"title": {
2025-05-22 19:10:08 +00:00
"model": "gpt-3.5-turbo",
"maxTokens": 80
2025-05-21 19:01:12 +00:00
}
2025-05-22 19:10:08 +00:00
}
2025-05-21 19:01:12 +00:00
}
```