Skip to content

kimi k2 reports 404 - CC Switch

Quick fix

A 404 from the connection test does not mean Kimi is unavailable. Set ANTHROPIC_BASE_URL to https://api.kimi.com/coding/ and verify by running Claude Code.

Error output
ANTHROPIC_BASE_URL=https://api.kimi.com/coding/ 但是我测试两个地址都不行
English translation

ANTHROPIC_BASE_URL=https://api.kimi.com/coding/ but neither address works when I test them

These problems all appear when Claude Code uses an Anthropic-compatible endpoint through ANTHROPIC_BASE_URL pointed at Kimi (or a Kimi model on SiliconFlow/DashScope). The CC Switch connection test health-checks the provider, but Anthropic-compatible endpoints do not agree on a health probe path. Kimi's https://api.kimi.com/coding/ may return 404 to the CC Switch connection test while real requests complete fine in Claude Code, so treating that 404 as a configuration failure is a misjudgement.

The cluster holds other environment variable variants: a "does not exist" notice when configuring SiliconFlow by hand, which can be resolved by setting ANTHROPIC_BASE_URL and ANTHROPIC_MODEL manually; people injecting ANTHROPIC_BASE_URL/ANTHROPIC_AUTH_TOKEN into the claude command through a shell function; streaming usage for kimi-k2.5 on the DashScope Anthropic endpoint not being counted by CC Switch; and the api.kimi.com/coding provider on CC Switch 3.18.0 having 262144 injected unconditionally when the context environment variables are absent, while Kimi K3 1M needs 1048576.

  1. Edit the Claude provider in CC Switch and set `ANTHROPIC_BASE_URL` to `https://api.kimi.com/coding/` (keep the trailing `/`).

  2. After saving, do not rely on the CC Switch connection test — the Kimi health check may still return 404. Run `claude` and start a conversation to verify; if Claude Code responds normally, the config works.

  3. If you use SiliconFlow as the Anthropic-compatible entry point for Kimi models, set `ANTHROPIC_BASE_URL="https://api.siliconflow.cn/"`, `ANTHROPIC_MODEL="moonshotai/Kimi-K2-Instruct-0905"`, and `ANTHROPIC_API_KEY` by hand.

ToolClaude Code
VersionUnknown
PlatformsmacOS
The CC Switch connection test returns 404. Can I still use Kimi?
Yes. The Kimi Anthropic-compatible endpoint health check may not return 200 — go by what Claude Code actually does. Set `ANTHROPIC_BASE_URL` to `https://api.kimi.com/coding/` and verify by running `claude`.
Why does a custom SiliconFlow config say it "does not exist"?
That notice is normal when a preset has not been added yet. Configure `ANTHROPIC_BASE_URL`, `ANTHROPIC_MODEL`, and `ANTHROPIC_API_KEY` by hand and it works.
Can a shell function replace the headless CLI for switching ANTHROPIC_BASE_URL?
Yes. Define `cckm()` in `~/.bashrc`, for instance, setting `ANTHROPIC_BASE_URL='https://api.kimi.com/coding'` and `ANTHROPIC_AUTH_TOKEN` inside before calling `claude --model opus "$@"`.
Why do kimi-k2.5 streaming requests on the DashScope Anthropic endpoint record 0 tokens?
Upstream returns usage in `message_start` and `message_delta`, but the CC Switch Anthropic-compatible streaming parser does not extract it, so streaming requests record 0 tokens. Non-streaming requests are fine.
Why is Kimi K3 1M treated as 256K on CC Switch 3.18.0?
Because the `api.kimi.com/coding` provider has `262144` injected unconditionally when `CLAUDE_CODE_MAX_CONTEXT_TOKENS` and `CLAUDE_CODE_AUTO_COMPACT_WINDOW` are absent, without distinguishing by model. K3 1M has to be selected with `k3[1m]` and set to `1048576`.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.