Client setup
OpenCode setup
OpenCode requires an explicit custom provider. Create an OpenAI-compatible API configuration and export:
export LUMOSWITCH_API_KEY="your-lumoswitch-access-key"Add this to user-level ~/.config/opencode/opencode.json or project-level opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"lumoswitch": {
"npm": "@ai-sdk/openai-compatible",
"name": "Lumoswitch",
"options": {
"baseURL": "https://api.lumoswitch.com/v1",
"apiKey": "{env:LUMOSWITCH_API_KEY}"
},
"models": {
"your-client-facing-model-name": {
"name": "Lumoswitch model"
}
}
}
},
"model": "lumoswitch/your-client-facing-model-name"
}Start opencode, verify basic output, and then test file and tool access.
Troubleshooting
- Select the model as
lumoswitch/client-facing-model-name. - For a Responses output,
@ai-sdk/openaimay be used; Chat Completions uses@ai-sdk/openai-compatible. - For tool failures, confirm model capability and remove provider-specific options from the first test.
Reference: OpenCode provider documentation.