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
    📘
    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:
    shell
    npm install -g @anthropic-ai/claude-code
    shell
    claude --version

    Step 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:

    shell
    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"
    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.

    Step 2: Verify the Connection

    Navigate to a project directory and start Claude Code:

    shell
    cd ~/your-project
    shell
    claude

    In the interactive prompt, ask a simple question:

    text
    > 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.5Agentic coding, long-context reasoning
    glm-5-fp8Planning, analysis, complex refactors
    minimax-m2.5Fast 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.