Configuration file path:
1、Configuration file (must be created manually after initial installation) ~/.config/opencode/opencode.json
The Base URL must end with /v1, otherwise an error will occur.
The following baseURL, apiKey, and models need to be replaced with the actual API Key data obtained from the NL system.
{
"$schema": "https://opencode.ai/config.json",
"model": "ailink/claude-opus-4.5",
"provider": {
"ailink": {
"npm": "@ai-sdk/anthropic",
"name": "ailink",
"options": {
"baseURL": "https://ailink.nativex.com/v1",
"apiKey": "sk-xxx"
},
"models": {
"claude-opus-4.5": {
"name": "Claude Opus 4.5",
"limit": {"context": 200000, "output": 32768}
},
"gemini-2.5-flash": {
"name": "gemini-2.5-flash",
"limit": {"context": 1000000, "output": 65536}
},
"gpt-5.3-chat-2": {
"name": "gpt-5.3-chat-2",
"limit": {"context": 200000, "output": 32768}
}
}
}
}
}
2、Configuration file (must be created manually after initial installation): ~/.local/share/opencode/auth.json
{
"ailink": {
"apiKey": "sk-xxx"
}
}
After saving, restart OpenCode, type /models, search for litellm, and select the model.
