Save this as ~/.config/opencode/opencode.json for every project, or as opencode.json in one project folder (project and global files are merged, and the project file wins where both set the same key). You can also point the OPENCODE_CONFIG variable at it.
opencode.json{
"$schema": "https://opencode.ai/config.json",
"provider": {
"unleashed": {
"npm": "@ai-sdk/openai-compatible",
"name": "UnleashedAPI",
"options": {
"baseURL": "https://api.unleashedapi.com/v1",
"apiKey": "{env:UNLEASHED_API_KEY}"
},
"models": {
"deepseek-v4.1-flash-fast": {
"name": "DeepSeek V4.1 Flash Fast",
"limit": { "context": 131072, "output": 8192 }
},
"deepseek-v4.1-flash-abliterated": {
"name": "DeepSeek V4.1 Flash Uncensored",
"limit": { "context": 131072, "output": 8192 }
},
"glm-5.3-flash-abliterated": {
"name": "GLM 5.3 Flash Uncensored",
"limit": { "context": 131072, "output": 8192 }
}
}
}
},
"model": "unleashed/deepseek-v4.1-flash-fast",
"small_model": "unleashed/deepseek-v4.1-flash-fast"
}
unleashed is the provider ID. It can be any name, but it must match the prefix in model.
npm is @ai-sdk/openai-compatible, the package OpenCode's docs name for /v1/chat/completions endpoints.
models lists what appears in the model picker. OpenCode only shows models you declare here, so add every ID you want to switch to.
limit.context is where OpenCode starts summarising the session. Every model accepts up to 1,048,576 tokens, but an agent resends its whole context on each step, so 131072 keeps each step far cheaper. Raise it for a task that really needs more.
small_model keeps OpenCode's short title request on UnleashedAPI too.