Skip to main content
You can connect Kimi K3 directly to Claude Code with the Anthropic-compatible setup. Use your BetterToken API Key, the Base URL https://bettertoken.ai, and map kimi-k3 for the Haiku, Sonnet, and Opus roles.

Key settings

Prerequisites

Configure Claude Code CLI

Open ~/.claude/settings.json on macOS/Linux or %USERPROFILE%\\.claude\\settings.json on Windows. Add or update the env object:
Replace YOUR_API_KEY with your BetterToken API Key. If the file already contains env, add these fields to the existing object instead of creating a second one.

Configure the Claude Code VS Code extension

Open VS Code user settings.json and add:
Run Developer: Reload Window or fully restart VS Code.

Verify the connection

Run this command in your project:
Send a short prompt. A response without authentication, connection, or model errors confirms that Kimi K3 is connected. Fully restart Claude Code after every settings.json change.

Common errors

Technical details

Claude Code requests Haiku, Sonnet, and Opus roles. Map kimi-k3 to all three variables so the same available Model ID is used for each role. Claude Code appends the Anthropic Messages path itself, so do not add /v1 to the Base URL.