---
title: "Kimi K3 in Claude Code — for a whole team · Selan"
description: "Kimi K3 runs in Claude Code through any endpoint that speaks Anthropic's API. Run it for a team on OpenRouter or an Ollama Cloud plan, with no key on a laptop."
url: https://selan.ai/guides/kimi-in-claude-code
updated: 2026-10-18T06:51:32+00:00
---

Guide · Other models in Claude Code

# How do you run Kimi K3 in Claude Code?

Point Claude Code at an endpoint that serves Kimi K3 in Anthropic's API format, then name the model. Moonshot AI publishes one such endpoint, and OpenRouter and Ollama Cloud are two more. Through Selan, an owner connects the company's OpenRouter key or Ollama Cloud plan once. Each developer then runs `selan claude --model openrouter:moonshotai/kimi-k3`.

## Why does Kimi K3 work in Claude Code at all?

Claude Code sends every request in Anthropic's Messages format. It reaches another server when `ANTHROPIC_BASE_URL` is set to that server's address.

Moonshot AI serves Kimi K3 in that same format, at `https://api.moonshot.ai/anthropic`. OpenRouter and Ollama Cloud answer in it too.

So unlike GPT, Kimi K3 needs no translation in the middle. What it needs is the right model names, the right window and a key. How GPT differs is in [running GPT in Claude Code](https://selan.ai/guides/gpt-in-claude-code).

## How do you set up Kimi K3 in Claude Code by hand?

Moonshot's own guide puts ten variables in the `env` block of `~/.claude/settings.json`:

-   the base URL above, and your Moonshot API key as `ANTHROPIC_AUTH_TOKEN`
-   `kimi-k3[1m]` as the main model, and as the Opus, Sonnet, Fable and subagent model
-   `kimi-k2.7-code` as the Haiku model
-   `CLAUDE_CODE_AUTO_COMPACT_WINDOW` at `1000000`, and the effort level at `max`

Moonshot warns that subagent work fails or degrades noticeably without the subagent variable. It also warns that the file now holds your API key in plain text, so keep it out of git.

That works for one person. On a team, it is one Moonshot key and one settings file per laptop, and no shared view of what Kimi costs. Why a key on every laptop is the expensive part is in [keeping API keys off laptops](https://selan.ai/guides/claude-code-without-api-keys).

## How do you run Kimi K3 in Claude Code through Selan?

An owner connects an OpenRouter key or an Ollama Cloud plan in Selan. Kimi K3 is a model Selan lists, so an owner also switches it on at OpenRouter under [Settings → Models](https://control.selan.ai/settings/models).

Developers install the `selan` CLI, sign in as themselves and name the model:

```bash
selan claude --model openrouter:moonshotai/kimi-k3
```

The part before the first colon is the provider. Everything after it is that provider's own model id, passed through as it is.

With `--model`, Selan tells Claude Code the model's real context window. Selan lists Kimi K3's window as 1,048,576 tokens, so a session compacts there and not at 200K. If an owner set a lower context limit for your company, it compacts at that instead.

Kimi K3 starts at `max` effort, the level Moonshot recommends. Selan offers `low`, `high` and `max` for it.

To skip the flag, an owner adds Kimi K3 to Claude Code's picker under [Settings → Model pickers](https://control.selan.ai/settings/pickers). It then appears in `/model`. The details are in [Run any model](https://selan.ai/docs#any-model).

## Which account does a Kimi turn run on?

| Route | How it bills | Name it as |
| --- | --- | --- |
| An OpenRouter key | Per token, on your OpenRouter invoice | `openrouter:moonshotai/kimi-k3` |
| An Ollama Cloud plan | One flat monthly price, no per-token bill | `ollama:` and the Kimi id Ollama lists |

A Kimi turn runs on the provider its name points at, and on no other.

If that account is out of quota, the request fails rather than moving to the other one.

Ollama answers only when you name one of its models. A request that names no model never lands on it. All of this is on [Providers and models](https://selan.ai/docs/providers).

## What does a team get beyond the model?

-   **One usage record.** Kimi turns land beside Claude turns, per person and per repository. [Usage per developer](https://selan.ai/guides/claude-code-usage-per-developer) shows what an owner sees.
-   **One spend limit.** An OpenRouter turn is metered, so it counts against a member's limit. A turn on an Ollama flat plan does not. See [spend limits](https://selan.ai/solutions/spend).
-   **No Moonshot or OpenRouter key on a laptop.** Keys stay on the gateway. A developer holds a Selan session you can revoke.
-   **Codex on the same accounts.** `selan codex --model openrouter:moonshotai/kimi-k3` uses the same route. See [Codex](https://selan.ai/docs/codex).

## What should you check before switching a team to Kimi K3?

-   **Effort and spend.** Kimi K3 thinks before it answers, and Selan starts it at `max`. On OpenRouter, the thinking is metered too.
-   **The model must be switched on.** A model your company cannot use is refused before Claude Code starts, not at the first request.

**Good to know:** Anthropic doesn't support routing Claude Code to non-Claude models through any gateway, Selan included. A Kimi session is the gateway's to answer for, not Anthropic's.

[Start for free](https://selan.ai/pricing)

Free for up to three seats, and the Free plan needs no card.

### The short version

-   Kimi K3 is served in Anthropic's API format, so Claude Code reaches it with no translation.
-   By hand, that is ten settings and a Moonshot key on every laptop.
-   Through Selan, a developer runs `selan claude --model openrouter:moonshotai/kimi-k3`, at Kimi K3's own window.
-   Kimi runs on your OpenRouter key or Ollama Cloud plan, with one usage record and no key on a laptop.

The manual setup is Moonshot AI's guide to using Kimi in Claude Code, and Anthropic's position is its LLM gateway docs, both as read on 18 October 2026. What Selan does is its model list, its CLI and its providers, Codex and getting-started docs as they stood on the same day.
