Guide

Kimi K3 in Kimi Code: k3 vs k3-256k, /model and config.toml

Updated

On this page

Kimi Code offers Kimi K3 under two model IDs. k3 supports up to 1M (1048576) tokens on Pro or Allegretto plans and above, or 256K on Plus and Moderato. k3-256k caps context at 256K (262144) at about half the quota. Pick K3 with /model in Kimi Code CLI, the model picker in Kimi Code Desktop or the dropdown in Kimi Code for VS Code, set kimi-code/k3 in ~/.kimi-code/config.toml, or call both IDs over the API.

Orbtile showing live coding agent sessions on a Mac panel, a Logitech MX Creative Keypad and an iPhone

Kimi K3 models in Kimi Code: k3 vs k3-256k

Kimi Code is the programming service included in Kimi membership. It comes as a Desktop app, a CLI and a VS Code extension, and its API Keys work in third-party tools. It offers six model IDs, including K3, the 2.8T-parameter previous flagship, in two variants:

Specificationk3k3-256kk3.1-prok3.1-pro-highspeedkimi-for-codingkimi-for-coding-highspeed
Version and roleK3 (2.8T, previous flagship)K3 (256K context)K3.1 Pro (3T-class, latest flagship)K3.1 Pro HighspeedK2.8 Preview (close to K3, more efficient thinking)K2.7 Code Highspeed
ContextUp to 1048576Up to 262144Up to 1048576Up to 1048576Up to 1048576Up to 262144
Speed and quotaRegular (~2x k3-256k quota)RegularRegular~2-3x speed, ~2x quotaRegular~6x speed, ~3x quota
Effortlow, high, max (default high)low, high, max (default high)low, high, max (always thinking)low, high, max (always thinking)low, high, max (default max)Thinking:ON (effort not adjustable)
New plansPlus+ (1M: Pro+)Plus+Plus+ (1M: Pro+)Pro+Plus+Pro+
Legacy plansModerato+ (1M: Allegretto+)Moderato+Moderato+ (1M: Allegretto+)Allegretto+Andante+Allegretto+
InputImage, videoImage onlyImage, videoImage, videoImage, videoImage, video

Key differences in daily work:

  • k3 suits large codebase analysis, multi-file refactoring and long documents, with up to 1M context on Pro or Allegretto plans and above.
  • k3-256k suits everyday Q&A, code completion and single-file or small-file edits.
  • k3-256k gives the same results as k3 within 256K context, at about half the quota.
  • k3-256k accepts image input but not video.

New plans drop the 7-day limit, keeping the 5-hour window and monthly quota, while legacy plans refresh every 7 days. All clients and API Keys share one quota, shown by /usage.

Switch to Kimi K3 in official clients

Members can use Kimi K3 in Kimi Code Desktop, Kimi Code CLI and Kimi Code for VS Code without managing an API Key. Kimi Code Desktop runs on macOS (Apple Silicon and Intel), Windows and Linux (AppImage, DEB and RPM). JetBrains and Zed connect through the CLI's ACP protocol.

Kimi Code CLI runs on Node.js. Install it with the official script, which needs no Node.js installed first, or npm install -g @moonshot-ai/kimi-code on Node.js 22.19.0 or later:

# macOS / Linux
curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash
# Windows (PowerShell)
irm https://code.kimi.com/kimi-code/install.ps1 | iex

Run kimi and then /login to connect your account. To select K3:

  • Desktop: use the model picker inside the Composer.
  • CLI: run /model, or run /provider refresh or /logout and /login if K3 is missing.
  • VS Code: use the dropdown in the input bar.
  • Missing in Desktop or VS Code: restart Desktop or sign in again, or restart VS Code or reinstall the extension.

From CLI v2.3.0 and Desktop v1.1.1, mid-session switches ask to start a new session, compact and continue, or continue directly. From CLI v2.5.0, /model and /effort work mid-turn for the next turn.

Context cache rules and switching between 1M and 256K

  • Changing models or thinking effort mid-session invalidates the context cache, so the next request is prefilled again and uses more tokens.
  • Reasoning chains from different models can affect each other, so start a new session when you switch.
  • Switching to K3.1 Pro inside an existing K3 session degrades output quality and reduces cache hits.
  • From 1M k3 to k3-256k: compact manually to within 256K first, though Kimi Code CLI and Claude Code can compact on their side.
  • If the conversation history includes video files, switching straight to k3-256k fails because it does not accept video, so compact first.
  • From k3-256k to 1M k3: switching keeps the cache, so near 256K you can move to k3 without compacting.

Configure Kimi K3 in ~/.kimi-code/config.toml

Kimi Code CLI creates ~/.kimi-code/config.toml on first run, beside tui.toml for terminal UI preferences, and KIMI_CODE_HOME relocates both. Field names use snake_case, and keys containing . must be quoted. Run /reload while idle to apply edits, and /status to check the active model.

Signing in with /login provisions a kimi-code/k3 entry under the managed:kimi-code provider. The docs' full example looks like this:

default_model = "kimi-code/k3"
default_permission_mode = "manual"
default_plan_mode = false

[providers."managed:kimi-code"]
type = "kimi"
base_url = "https://api.kimi.com/coding/v1"
api_key = ""

[models."kimi-code/k3"]
provider = "managed:kimi-code"
model = "k3"
max_context_size = 1048576
capabilities = [ "thinking", "always_thinking", "image_in", "video_in", "tool_use" ]
display_name = "K3"
support_efforts = [ "low", "high", "max" ]
default_effort = "max"

[thinking]
enabled = true
effort = "high"
keep = "all"

This example sets default_effort = "max", while elsewhere the same page says the /login default for kimi-code/k3 is high.

Table and fieldType and defaultWhat it controls
default_modelstring (none)Default CLI model alias matching a key in [models]
[models."<alias>"].providerstring (required)Key in [providers], for example "managed:kimi-code"
[models."<alias>"].modelstring (required)Model ID sent to the API, for example "k3"
[models."<alias>"].max_context_sizeinteger (required)Max context tokens (1048576 for k3, minimum 1)
[models."<alias>"].capabilitiesarray<string>Tags such as "thinking", "always_thinking", "image_in", "video_in" and "tool_use"
[models."<alias>"].support_effortsarray<string>Allowed efforts ([ "low", "high", "max" ] for k3)
[models."<alias>"].default_effortstringModel default effort, which managed refreshes may rewrite
[thinking].enabledboolean (true)Turns thinking on by default (false forces it off)
[thinking].effortstring (none)Global effort (low, medium, high, xhigh, max), falling back to the model default
[thinking].keepstring ("all")Preserved thinking passthrough, overridden by KIMI_MODEL_THINKING_KEEP

Pinning model settings with overrides

  • Put custom values under [models."<alias>".overrides] so they survive provider refreshes, which may rewrite support_efforts and default_effort.
  • Overrides accept max_context_size, max_input_size, max_output_size, capabilities, display_name, reasoning_key, adaptive_thinking, support_efforts, default_effort and off_effort.
  • Overrides do not accept provider, model, protocol, beta_api, base_url or upgrade.
  • KIMI_MODEL_* environment variables create a temporary provider in memory that is gone after a restart.

For desktop alerts, Notification hooks, and NotifyUser, see Kimi Code notifications: hooks, NotifyUser and TUI settings.

Assign Kimi K3 and custom effort variants to subagents

Subagents use the caller's model unless [secondary_model] is set in ~/.kimi-code/config.toml. Run /secondary-model (alias /subagent-model) in the TUI to pick its default_model. New subagents use the change straight away, with no restart.

When the pool in [secondary_model.models] lists two or more aliases, the main agent gets a model parameter when it spawns a subagent. You can register a k3-max variant next to kimi-code/k3:

[models.k3-max]
provider = "managed:kimi-code"
model = "k3"
max_context_size = 1048576
capabilities = [ "thinking", "always_thinking", "image_in", "video_in", "tool_use" ]
support_efforts = [ "low", "high", "max" ]

[models.k3-max.overrides]
default_effort = "max"

[secondary_model]
default_model = "kimi-code/k3"
[secondary_model.models]
"kimi-code/k3" = "Default high effort. Good for most implementation, analysis, and multi-turn interaction tasks."
k3-max = "The same model at max thinking effort. Good for the hardest subtasks."

Subagent variant rules:

  • Under managed:kimi-code, only the k3 family currently declares effort levels.
  • A variant does not inherit fields, so copy capabilities, support_efforts and other metadata in full.
  • The variant's default_effort must be one of its support_efforts.
  • For the main agent, the global [thinking].effort overrides the variant's default_effort.
  • For subagents, the variant's default_effort wins over [thinking].effort, and only [secondary_model].default_effort outranks it.
  • A broken alias in [secondary_model] makes session startup fail with an error that names the alias.

Use Kimi K3 in third-party tools over the Kimi Code API

Members can create up to 5 API Keys in the Kimi Code Console, and each key is shown only once. Use them in tools such as Claude Code, OpenCode and Codex. Kimi Code is a membership subscription with rate limits. The Kimi Platform (https://api.moonshot.cn/v1 or https://api.moonshot.ai/v1) is pay-as-you-go instead.

ProtocolChina Base URLOverseas Base URL
OpenAI compatible (Responses and Chat Completions)https://api.kimi.com/coding/v1https://api.kimi.ai/coding/v1
Anthropic compatiblehttps://api.kimi.com/coding/https://api.kimi.ai/coding/

Some tools, such as Claude Code, need only the Base URL and add the rest of the path themselves. Others, such as Trae, need the full address, for example https://api.kimi.com/coding/v1/chat/completions or https://api.kimi.com/coding/v1/responses. Tools that support the Responses API should use the native Responses format.

Model IDs, User-Agent policy, and effort mapping

  • Pass the exact model ID, k3 or k3-256k, because a display name or a typo silently falls back to K2.8 Preview without thinking.
  • Keep the tool's real User-Agent header, because changing it is a violation that may suspend membership benefits.
  • In Kimi Code CLI, providers do not read shell variables, so set api_key, api_key_env or env in config.toml.
Third-party tool inputResulting behaviour on k3 and k3-256k
No valueModel default (high)
ultra, max, xhighMapped to max
high, mediumMapped to high
low, minimum, lightMapped to low
off, none, disabledServed by K2.8 Preview without thinking (rejected on K3.1 Pro)
Any other valueRejected with HTTP 400

Common K3 context and model errors:

  • HTTP 403 on k3: Plus and Moderato return Your current plan supports only k3 up to 256K context above 256K, and lower tiers lack k3.
  • 256K cap on k3-256k: exceeding 256K returns k3-256k supports only 256K context or HTTP 400 Your request exceeded model token limit: 262144.
  • HTTP 400 on format or effort: unrecognised efforts or Claude Code's env-only k3[1m] form in API calls return HTTP 400.

Watch Kimi Code sessions on a keypad or phone with Orbtile

Orbtile shows Kimi Code, Claude Code and Codex sessions on a Logitech MX Creative Keypad, or on an iPhone (iOS 17+) or Android phone (8.0+) with Orbtile Mobile. It runs on a computer with macOS 14.0 Sonoma or later on Apple silicon, or a Windows 11 PC (x64), with Kimi Code supported on both.

  • With nothing installed, Orbtile reads Kimi Code session files in ~/.kimi-code, or %USERPROFILE%\.kimi-code on Windows, overridden by KIMI_CODE_HOME.
  • Each key shows the session name, state and live text, and working Kimi Code sessions glow magenta.
  • During Starting, the key shows the model name when it is available.
  • Hold a session key for 0.6 seconds to open Focus mode, which shows the session name and model on key 1.
  • In Focus mode, key 2 shows the subagent count and opens a view with one subagent on each of keys 1 to 8.
  • Waiting sessions turn terracotta and move to the front, and a tap on key 9 focuses the first waiting session.
  • A tap on a session key brings its terminal or Kimi window to the front.
  • Optional Kimi Code hooks, chosen in Settings > Agents, add a Compacting state and never approve or deny anything.

To answer from the keypad on a Mac or a Windows PC, run the session in Kimi's own server with kimi web or kimi rc, or type /rc in a Kimi terminal session.

  • Press Deny on key 7 to decline a permission request, or hold Allow on key 9 for 0.6 seconds to approve.
  • Permission answers work for up to 2 minutes, or Kimi Code's shorter limit, before the key shows Answer on computer.
  • For a question with listed options, pick options on keys 1, 2, 3 and 7, then hold Send on key 9.
  • Kimi's server API is experimental: if a Kimi update changes it, keypad answers stop until Orbtile catches up, and sessions still show.
  • Other Kimi Code sessions, other questions and written answers stay on your computer.

See Kimi Code web UI: kimi web, /web, tokens and LAN setup and Kimi Code vs Claude Code: run both and see which needs you.

FAQ

What is the difference between k3 and k3-256k in Kimi Code?

In Kimi Code, k3 is the 2.8T-parameter K3 model with up to 1M context on Pro or Allegretto plans and above, or 256K on Plus and Moderato. It accepts image and video input. The k3-256k model ID caps context at 262144 tokens, accepts images only, matches k3 within 256K and uses about half the quota.

How do I switch to Kimi K3 in Kimi Code CLI, Desktop and VS Code?

In Kimi Code CLI, run /model, or run /provider refresh or /logout and /login if K3 is missing. In Kimi Code Desktop, use the model picker inside the Composer. In Kimi Code for VS Code, use the dropdown in the input bar.

Why does switching from k3 to k3-256k fail or lose cache hits?

Switching models or thinking effort mid-session invalidates the context cache and triggers a new prefill. Compact to within 256K before moving from 1M k3 to k3-256k. Direct switches also fail when history includes video, because k3-256k accepts images only.

What happens if I mistype the k3 model ID or disable thinking in a third-party tool?

If you pass a display name such as K3 or mistype the model ID in a third-party tool, the Kimi Code API falls back to K2.8 Preview without thinking. Passing off, none or disabled as the thinking effort on K3 also sends the request to K2.8 Preview without thinking.