Check your version and required capabilities first
Run opencode --version before editing your configuration. The native v1 and v2 provider formats differ, so use the matching example below in your project's opencode.json. Merge the relevant provider into an existing file rather than overwriting your other settings.
These examples configure access to chat completions. The featured uncensored model's Kearnix catalog entry does not currently confirm tool-calling support. OpenCode's ability to select a model does not establish that the model can execute a complete coding-agent workflow. Validate tools and streaming on the exact variant before relying on automated edits.
OpenCode v1 configuration
Set KEARNIX_API_KEY in the terminal where you launch OpenCode. Version 1 uses provider, npm and options. The API key is resolved from the environment; never paste a usable key into this file.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"kearnix": {
"name": "Kearnix",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://kearnix.com/v1",
"apiKey": "{env:KEARNIX_API_KEY}"
},
"models": {
"z-ai/glm-5.3-flash-uncensored": { "name": "GLM Flash - Kearnix Cloud" }
}
}
}
}OpenCode v2 native configuration
Version 2's native format uses providers, package and settings. Its env list supplies the credential. Use this version of the example for a native v2 configuration; the runtime package differs from the v1 AI SDK package.
{
"$schema": "https://opencode.ai/config.json",
"providers": {
"kearnix": {
"name": "Kearnix",
"env": ["KEARNIX_API_KEY"],
"package": "@opencode/ai/providers/openai-compatible",
"settings": { "baseURL": "https://kearnix.com/v1" },
"models": {
"z-ai/glm-5.3-flash-uncensored": { "name": "GLM Flash - Kearnix Cloud" }
}
}
}
}Select and evaluate the configured model
Start OpenCode from the configured project and use /models to choose GLM Flash - Kearnix Cloud. Its full OpenCode reference is kearnix/z-ai/glm-5.3-flash-uncensored: kearnix is the custom provider ID and the remaining value is the exact Kearnix model ID. You can add another catalog ID under models without changing the endpoint.
If the provider is missing, check the file location, version and JSON syntax. If authentication fails, verify that the environment variable reaches the OpenCode process. If tools or streaming fail, check the model capabilities before changing request parameters. This configuration follows the official provider documentation; an end-to-end OpenCode agent run against these uncensored variants has not been verified. References: https://opencode.ai/docs/providers/ and https://opencode.ai/v2/docs/providers/.