Claude Code

Configure Claude Code to use Large Language Models hosted by Kimchi for AI-assisted coding.

This tutorial walks you through using the Kimchi Inference API with Claude Code, Anthropic's agentic coding tool. You'll route Claude Code through Kimchi to use open-source LLMs like Kimi K2.7 and MiniMax M3 as drop-in replacements.

Overview

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

  • Point Claude Code at Kimchi as its model provider
  • Use Kimi K2.7 for agentic coding tasks via Claude Code's interface
  • Switch between supported open-source models on demand
πŸ“˜

Kimchi exposes an Anthropic-compatible endpoint for Claude Code, so the same API key and base URL work with any tool that speaks the Anthropic Messages API.

Prerequisites

  1. A Kimchi API key β€” Go to Kimchi β†’ API Keys and click Create API key. Copy the key and store it securely.
  2. Node.js 18 or higher β€” Check your version with node --version
  3. Claude Code installed:
npm install -g @anthropic-ai/claude-code
claude --version

Configure Claude Code

Configure Claude Code

Claude Code reads its provider configuration from environment variables. Set the following in your shell profile (~/.zshrc, ~/.bashrc) to point Claude Code at Kimchi:

export ANTHROPIC_BASE_URL="https://llm.kimchi.dev/anthropic"
export ANTHROPIC_AUTH_TOKEN="YOUR_KIMCHI_API_KEY"
export ANTHROPIC_MODEL="kimi-k2.7"
export ANTHROPIC_SMALL_FAST_MODEL="minimax-m3"
VariablePurpose
ANTHROPIC_BASE_URLRoutes Claude Code traffic to Kimchi's Anthropic-compatible endpoint
ANTHROPIC_AUTH_TOKENAuthenticates requests with your Kimchi API key
ANTHROPIC_MODELDefault model used for primary reasoning and agent tasks
ANTHROPIC_SMALL_FAST_MODELLightweight model used for background and quick operations

Reload your shell (source ~/.zshrc) so the variables take effect.

Verify the connection

Navigate to a project directory and start Claude Code:

cd ~/your-project
claude

In the interactive prompt, ask a simple question:

> Explain what this project does in one paragraph

If the response streams back, Claude Code is successfully routing through Kimchi. You can confirm usage in the Kimchi console.

Switching Models

To swap the active model, update ANTHROPIC_MODEL and restart Claude Code. Common pairings:

ModelBest for
kimi-k2.7Agentic coding, image analysis (latest)
minimax-m3Fast code execution and edits

IDE Integration

Claude Code's VS Code and JetBrains extensions inherit the same environment variables when launched from a shell where they're set. If you launch your IDE from the macOS Dock or Windows Start menu, configure the variables at the OS level so they're picked up by GUI applications.

πŸ“˜

On macOS, use launchctl setenv ANTHROPIC_BASE_URL https://llm.kimchi.dev/anthropic (and similar for the other variables) to make environment variables visible to GUI apps.

Next steps



Did this page help you?