OpenCode

This tutorial walks you through using Kimchi's Serverless Endpoints with OpenCode, an agentic coding tool. You'll configure OpenCode to use MiniMax M2.7 for coding, Kimi K2.5 for image analysis, and Kimi K2.6 for planning, giving you a cost-effective setup for AI-assisted development.

Overview

By the end of this tutorial, you'll be able to:

  • Configure OpenCode to recognize Kimchi as a model provider
  • Use Kimi K2.6 for planning and deep reasoning tasks
  • Use Kimi K2.5 for image analysis
  • Use MiniMax M2.7 for code generation and execution tasks
  • Set up a multi-model workflow that uses different models for different tasks

This tutorial is intended for developers familiar with command-line tools and JSON configuration files.

Prerequisites

  1. A Kimchi API key from app.kimchi.dev/settings
  2. OpenCode installed from opencode.ai or via:
curl -fsSL https://opencode.ai/install | bash
New to terminal and config files? Start here.

OpenCode stores its configuration in a JSON file at a specific location on your system. If this is your first time using OpenCode, neither the folder nor the file will exist yet — you need to create both manually.

1. Create the config directory

mkdir -p ~/.config/opencode

2. Create the config file

touch ~/.config/opencode/opencode.json

3. Open the file for editing

nano ~/.config/opencode/opencode.json

Or open in VS Code:

open -a "Visual Studio Code" ~/.config/opencode/opencode.json

4. Verify the file exists

ls ~/.config/opencode

You should see opencode.json listed.

Configure OpenCode

Advanced: Multi-agent orchestration with GSD

For more complex workflows, you can use the Get Shit Done (GSD) framework to orchestrate multiple agents with different models assigned to each task type.

Install GSD:

npx gsd-opencode

Then update your opencode.json to include agent-specific model assignments:

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "*": "ask"
  },
  "compaction": {
    "auto": true,
    "prune": true
  },
  "model": "kimchi/minimax-m2.7",
  "mode": {
    "plan": {
      "model": "kimchi/kimi-k2.6"
    },
    "build": {
      "model": "kimchi/minimax-m2.7"
    }
  },
  "provider": {
    "kimchi": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Kimchi",
      "options": {
        "baseURL": "https://llm.kimchi.dev/openai/v1",
        "litellmProxy": true,
        "apiKey": "$KIMCHI_API_KEY"
      },
      "models": {
        "kimi-k2.6": {
          "id": "kimi-k2.6",
          "tool_call": true,
          "reasoning": false,
          "modalities": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 262144,
            "output": 32768
          }
        },
        "kimi-k2.5": {
          "id": "kimi-k2.5",
          "tool_call": true,
          "reasoning": false,
          "modalities": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 262144,
            "output": 32768
          }
        },
        "minimax-m2.7": {
          "name": "minimax-m2.7",
          "tool_call": true,
          "reasoning": false,
          "limit": {
            "context": 196608,
            "output": 32768
          }
        }
      }
    }
  },
  "agent": {
    "gsd-planner": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-plan-checker": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-phase-researcher": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-roadmapper": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-project-researcher": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-research-synthesizer": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-codebase-mapper": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-executor": {
      "model": "kimchi/minimax-m2.7"
    },
    "gsd-debugger": {
      "model": "kimchi/minimax-m2.7"
    },
    "gsd-verifier": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-integration-checker": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-set-profile": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-settings": {
      "model": "kimchi/kimi-k2.6"
    },
    "gsd-set-model": {
      "model": "kimchi/kimi-k2.6"
    }
  }
}

This configuration uses Kimi K2.6 for planning, research, and verification tasks, while MiniMax M2.7 handles actual code execution and debugging. You can also configure GSD interactively by running /gsd-settings within OpenCode.

Advanced: GSD 2.0

GSD 2.0 no longer integrates with the OpenCode TUI — it comes bundled with its own TUI via the PI harness.

Run gsd config to generate a basic configuration. Then create the following files:

.gsd/agent/models.json

{
  "providers": {
    "kimchi": {
      "baseUrl": "https://llm.kimchi.dev/openai/v1",
      "api": "openai-completions",
      "apiKey": "$KIMCHI_API_KEY",
      "models": [
        {
          "id": "kimi-k2.6",
          "name": "Kimi K2.6",
          "reasoning": false,
          "input": ["text", "image"],
          "contextWindow": 262144,
          "maxTokens": 32768,
          "cost": { "input": 1, "output": 3.2, "cacheRead": 0, "cacheWrite": 0 }
        },
        {
          "id": "kimi-k2.5",
          "name": "Kimi K2.5",
          "reasoning": false,
          "input": ["text", "image"],
          "contextWindow": 262144,
          "maxTokens": 32768,
          "cost": { "input": 1, "output": 3.2, "cacheRead": 0, "cacheWrite": 0 }
        },
        {
          "id": "minimax-m2.7",
          "name": "MiniMax M2.7",
          "reasoning": true,
          "input": ["text"],
          "contextWindow": 196608,
          "maxTokens": 32768,
          "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
        }
      ]
    }
  }
}

.gsd/preferences.md

---
version: 1
models:
  research: kimi-k2.6
  planning: kimi-k2.6
  execution: minimax-m2.7
  completion: minimax-m2.7
auto_supervisor:
  model: kimi-k2.6
  soft_timeout_minutes: 20
  idle_timeout_minutes: 10
  hard_timeout_minutes: 30
token_profile: quality
budget_ceiling: 500.00
budget_enforcement: warn
git:
  auto_push: false
  merge_strategy: squash
  isolation: branch
  commit_docs: false
skill_discovery: suggest
notifications:
  on_complete: false
  on_milestone: true
  on_attention: true
auto_visualize: true
---

Replace $KIMCHI_API_KEY with your own key.

Advanced: Superpowers

Superpowers is a lightweight skills-based workflow framework. Unlike GSD, it adds no extra processes or config — it's a set of prompt skills that guide your existing agent, with lower token overhead and less setup friction.

Add the plugin to your ~/.config/opencode/opencode.json alongside the existing provider config:

{
  "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
}

Restart OpenCode. Verify by asking: Tell me about your superpowers

Superpowers provides skills for brainstorming, writing plans, test-driven development, parallel subagent dispatch, systematic debugging, and branch completion workflows. Skills trigger automatically based on what you're doing — no slash commands needed.

Next steps