DeepAnima
Kouri AiApp Integration

OpenCode

OpenCode is an open-source command-line AI coding assistant that supports multiple AI providers to help you write code, debug, and manage projects.

About OpenCode

OpenCode is an open-source command-line AI coding assistant. It supports multiple AI providers (including OpenAI, Anthropic, Google, etc.) and can be used directly in your terminal to help you write code, debug issues, understand codebases, and perform various development tasks.

Installation

Using Go

go install github.com/opencode-ai/opencode@latest

Using Homebrew (macOS/Linux)

brew install opencode-ai/tap/opencode

Using Install Script

curl -fsSL https://opencode.ai/install.sh | bash

Configuration Steps

OpenCode supports configuration through config files or environment variables.

Create an opencode.json file in your project root or ~/.config/opencode/ directory:

{
  "provider": "anthropic",
  "providers": {
    "anthropic": {
      "apiKey": "your_kouri_token",
      "baseURL": "https://api.kourichat.com"
    }
  },
  "model": "claude-sonnet-4-5-20250929"
}

You can also use OpenAI compatible mode:

{
  "provider": "openai",
  "providers": {
    "openai": {
      "apiKey": "your_kouri_token",
      "baseURL": "https://api.kourichat.com/v1"
    }
  },
  "model": "gpt-4o"
}

Method 2: Using Environment Variables

For Anthropic mode:

export ANTHROPIC_API_KEY="your_kouri_token"
export ANTHROPIC_BASE_URL="https://api.kourichat.com"

For OpenAI compatible mode:

export OPENAI_API_KEY="your_kouri_token"
export OPENAI_BASE_URL="https://api.kourichat.com/v1"

Add the above commands to your shell configuration file (~/.zshrc or ~/.bashrc) to make them permanent.

Start Using

After configuration, run the following command in your terminal to start OpenCode:

opencode

Common commands:

# View help
opencode --help

# Ask a question directly
opencode "How to implement quicksort in Python?"

# Specify model
opencode --model claude-sonnet-4-5-20250929 "Explain this code"

# Start an interactive session in the current directory
opencode

Configuration Options

OptionDescription
providerAI provider, options include openai, anthropic, google, etc.
baseURLAPI base URL, set to https://api.kourichat.com or https://api.kourichat.com/v1
apiKeyYour Kouri Ai token
modelModel name to use

Make sure to replace your_kouri_token with your actual Kouri Ai API token.

OpenCode is an open-source project that supports multiple AI providers. When using Kouri Ai, you can choose between OpenAI compatible mode or Anthropic mode based on your needs.

More Information

For more advanced features and usage, please refer to the OpenCode GitHub Repository.

On this page