OpenCode with an uncensored model
To use an uncensored model in OpenCode, add an OpenAI-compatible provider to opencode.json with the API's base URL and the abliterated model ids.
Which model to use in OpenCode
Change the top-level model line to start on a model other than DeepSeek V4.1 Flash 1017.
| Model | Use it for | Model id |
|---|---|---|
| Kimi K3.1 Pro | Hard multi-file and security work | kimi-k3.1-pro-uncensored |
| DeepSeek V4.1 Flash | Everyday work, and the default here | deepseek-v4.1-flash-1017-uncensored |
| GLM-5.3 | A second opinion, text only | glm-5.3-uncensored |
| GLM-5.3 Flash | Bulk edits and many subagents | glm-5.3-flash-uncensored |
Set it up
- Install OpenCode
Shell curl -fsSL https://opencode.ai/install | bashShell npm install -g opencode-ai - Set your API key
Create a key at Silk Compute, export it, and add the line to
~/.zshrcor~/.bashrc.Shell export SILK_API_KEY="sk-..." - Add the provider
Save this as
~/.config/opencode/opencode.jsonfor every project, or asopencode.jsonin one. If the file exists, add thesilkcomputeprovider to it.opencode.json { "$schema": "https://opencode.ai/config.json", "model": "silkcompute/deepseek-v4.1-flash-1017-uncensored", "provider": { "silkcompute": { "npm": "@ai-sdk/openai-compatible", "name": "Silk Compute", "options": { "baseURL": "https://api.silkcompute.com", "apiKey": "{env:SILK_API_KEY}" }, "models": { "kimi-k3.1-pro-uncensored": { "name": "Kimi K3.1 Pro", "tool_call": true, "interleaved": { "field": "reasoning_content" }, "modalities": { "input": ["text", "image", "video"], "output": ["text"] }, "limit": { "context": 1048576, "output": 943718 }, "cost": { "input": 3, "output": 8, "cache_read": 0.3 }, "variants": { "none": { "reasoningEffort": "none" }, "low": { "reasoningEffort": "low" }, "high": { "reasoningEffort": "high" }, "max": { "reasoningEffort": "max" } } }, "deepseek-v4.1-flash-1017-uncensored": { "name": "DeepSeek V4.1 Flash 1017", "tool_call": true, "interleaved": { "field": "reasoning_content" }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "limit": { "context": 1048576, "output": 131072 }, "cost": { "input": 0.24, "output": 0.9, "cache_read": 0.038 }, "variants": { "none": { "reasoningEffort": "none" }, "low": { "reasoningEffort": "low" }, "high": { "reasoningEffort": "high" }, "max": { "reasoningEffort": "max" } } }, "deepseek-v4.1-flash-1017-fast-uncensored": { "name": "DeepSeek V4.1 Flash 1017 Fast", "tool_call": true, "interleaved": { "field": "reasoning_content" }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "limit": { "context": 1048576, "output": 131072 }, "cost": { "input": 0.24, "output": 0.9, "cache_read": 0.05 }, "variants": { "none": { "reasoningEffort": "none" }, "low": { "reasoningEffort": "low" }, "high": { "reasoningEffort": "high" }, "max": { "reasoningEffort": "max" } } }, "glm-5.3-uncensored": { "name": "GLM-5.3", "tool_call": true, "interleaved": { "field": "reasoning_content" }, "modalities": { "input": ["text"], "output": ["text"] }, "limit": { "context": 1048576, "output": 131072 }, "cost": { "input": 2, "output": 4, "cache_read": 0.3 }, "variants": { "none": { "reasoningEffort": "none" }, "low": { "reasoningEffort": "low" }, "high": { "reasoningEffort": "high" }, "max": { "reasoningEffort": "max" } } }, "glm-5.3-flash-uncensored": { "name": "GLM-5.3 Flash", "tool_call": true, "interleaved": { "field": "reasoning_content" }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "limit": { "context": 1048576, "output": 131072 }, "cost": { "input": 0.24, "output": 1, "cache_read": 0.06 }, "variants": { "none": { "reasoningEffort": "none" }, "low": { "reasoningEffort": "low" }, "high": { "reasoningEffort": "high" }, "max": { "reasoningEffort": "max" } } }, "hy4-uncensored": { "name": "Hy4", "tool_call": true, "interleaved": { "field": "reasoning_content" }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "limit": { "context": 1048576, "output": 65536 }, "cost": { "input": 1.6, "output": 3.2, "cache_read": 0.3 }, "variants": { "none": { "reasoningEffort": "none" }, "low": { "reasoningEffort": "low" }, "high": { "reasoningEffort": "high" }, "max": { "reasoningEffort": "max" } } } } } } } - Run it
Shell opencodeSwitch the model with
/modelsand the effort withctrl+t. - Check the key
A list of models means the key works, and a
401meansSILK_API_KEYis empty or wrong.Shell curl -s https://api.silkcompute.com/models -H "Authorization: Bearer $SILK_API_KEY"
What the config sets
npmnames OpenCode's OpenAI-compatible provider package.optionsholds the base URL and reads the key fromSILK_API_KEY.interleavedtells OpenCode where the reasoning text arrives.limitsets 1,048,576 tokens of context and each model's output cap.costsets prices per 1M tokens for input, output and cached input.variantsadds one entry per effort level, none, low, high and max, whichctrl+tcycles through.
Other APIs that work with OpenCode
All seven APIs for coding agents connect, but only three have the 1M-token context long sessions need.
With a local model
Point a second provider's baseURL at a local Chat Completions server such as Ollama or LM Studio, and list one of the local models under models.
Related
Silk Compute's own guide is at silkcompute.com/docs/opencode.