AI-Assisted Coding
Serverless Inference with Claude Code
This tutorial walks you through using Kimchi's Serverless Endpoints with Claude Code, Anthropic's agentic coding tool. You'll route Claude Code through Kimchi to use open-source LLMs like Kimi K2.5, GLM 5, and MiniMax M2.5 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.5 for agentic coding tasks via Claude Code's interface
- Switch between supported open-source models on demand
Prerequisites
- A Kimchi API key — Go to Kimchi → API Keys and click Create API key. Copy the key and store it securely.
- Node.js 18 or higher — Check your version with
node --version - Claude Code installed:
npm install -g @anthropic-ai/claude-codeclaude --versionStep 1: 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.5"
export ANTHROPIC_SMALL_FAST_MODEL="minimax-m2.5"| Variable | Purpose |
|---|---|
| ANTHROPIC_BASE_URL | Routes Claude Code traffic to Kimchi's Anthropic-compatible endpoint |
| ANTHROPIC_AUTH_TOKEN | Authenticates requests with your Kimchi API key |
| ANTHROPIC_MODEL | Default model used for primary reasoning and agent tasks |
| ANTHROPIC_SMALL_FAST_MODEL | Lightweight model used for background and quick operations |
Reload your shell (source ~/.zshrc) so the variables take effect.
Step 2: Verify the Connection
Navigate to a project directory and start Claude Code:
cd ~/your-projectclaudeIn the interactive prompt, ask a simple question:
> Explain what this project does in one paragraphIf 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:
| Model | Best for |
|---|---|
| kimi-k2.5 | Agentic coding, long-context reasoning |
| glm-5-fp8 | Planning, analysis, complex refactors |
| minimax-m2.5 | Fast 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.
launchctl setenv ANTHROPIC_BASE_URL https://llm.kimchi.dev/anthropic (and similar for the other variables) to make environment variables visible to GUI apps.