Agents
Setup guide

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.

Updated
FormatOpenAI Chat Completions
Endpoint/chat/completions
Configured inopencode.json
Switch with/models and ctrl+t
Context1,048,576

Which model to use in OpenCode

Change the top-level model line to start on a model other than DeepSeek V4.1 Flash 1017.

ModelUse it forModel id
Kimi K3.1 ProHard multi-file and security workkimi-k3.1-pro-uncensored
DeepSeek V4.1 FlashEveryday work, and the default heredeepseek-v4.1-flash-1017-uncensored
GLM-5.3A second opinion, text onlyglm-5.3-uncensored
GLM-5.3 FlashBulk edits and many subagentsglm-5.3-flash-uncensored

Set it up

  1. Install OpenCode
    Shell
    curl -fsSL https://opencode.ai/install | bash
    Shell
    npm install -g opencode-ai
  2. Set your API key

    Create a key at Silk Compute, export it, and add the line to ~/.zshrc or ~/.bashrc.

    Shell
    export SILK_API_KEY="sk-..."
  3. Add the provider

    Save this as ~/.config/opencode/opencode.json for every project, or as opencode.json in one. If the file exists, add the silkcompute provider 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" }
              }
            }
          }
        }
      }
    }
  4. Run it
    Shell
    opencode

    Switch the model with /models and the effort with ctrl+t.

  5. Check the key

    A list of models means the key works, and a 401 means SILK_API_KEY is empty or wrong.

    Shell
    curl -s https://api.silkcompute.com/models -H "Authorization: Bearer $SILK_API_KEY"

What the config sets

  • npm names OpenCode's OpenAI-compatible provider package.
  • options holds the base URL and reads the key from SILK_API_KEY.
  • interleaved tells OpenCode where the reasoning text arrives.
  • limit sets 1,048,576 tokens of context and each model's output cap.
  • cost sets prices per 1M tokens for input, output and cached input.
  • variants adds one entry per effort level, none, low, high and max, which ctrl+t cycles 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.

Silk Compute's own guide is at silkcompute.com/docs/opencode.