Kimi K3 in Claude Code

Anthropic-compatible endpoint · 1M context · works with tools, subagents and thinking · about 3 minutes

Before you start. Create an account (you get $2 to try), then open Token Management → Create token and copy the key. The key starts with sk-. Endpoints: OpenAI-compatible https://microquickjs.com/v1, Anthropic-compatible https://microquickjs.com. Model ID: Kimi-K3.

Why it works

Claude Code talks the Anthropic Messages protocol. ainetcafe serves Kimi K3 on that same protocol, so you only redirect the base URL and name the model. Nothing else in your setup changes.

Option A: environment variables (per shell)

export ANTHROPIC_BASE_URL=https://microquickjs.com
export ANTHROPIC_API_KEY=$AINETCAFE_API_KEY
export ANTHROPIC_MODEL=Kimi-K3
export ANTHROPIC_SMALL_FAST_MODEL=Kimi-K3
claude

If Claude Code asks "Do you want to use this API key?", answer yes.

Option B: settings file (persistent)

Edit ~/.claude/settings.json (macOS and Linux) or %USERPROFILE%\.claude\settings.json (Windows). Merge the env block; keep any other keys you already have.

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://microquickjs.com",
    "ANTHROPIC_API_KEY": "sk-your-ainetcafe-key",
    "ANTHROPIC_MODEL": "Kimi-K3",
    "ANTHROPIC_SMALL_FAST_MODEL": "Kimi-K3",
    "API_TIMEOUT_MS": "600000",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Option C: Claude Code Router (one click)

If you already route Claude Code through Claude Code Router, this link imports ainetcafe as a provider with the right protocol and model prefilled; you only paste your key. The same definition is published as a manifest at https://ainetcafe.com/k3/.well-known/ccr-provider.json.

Add ainetcafe to Claude Code Router

Switching back and forth

Keep two shell aliases so you can flip between Anthropic's own service and ainetcafe without editing files:

alias claude-k3='ANTHROPIC_BASE_URL=https://microquickjs.com ANTHROPIC_API_KEY=$AINETCAFE_API_KEY ANTHROPIC_MODEL=Kimi-K3 claude'
alias claude-anthropic='claude'

Verify the key first

Thirty seconds now saves an hour of guessing later. Run this in a terminal; you should see a short reply and a usage block.

curl https://microquickjs.com/v1/messages \
  -H "x-api-key: $AINETCAFE_API_KEY" -H "anthropic-version: 2023-06-01" -H "Content-Type: application/json" \
  -d '{"model":"Kimi-K3","max_tokens":20,"messages":[{"role":"user","content":"Say OK"}]}'

What to expect

If something goes wrong

SymptomCauseFix
401 Invalid tokenKey copied with a space, or key from another siteRe-copy from Token Management on microquickjs.com
403 quota / insufficient balanceWallet at zero or plan quota used upTop up in Wallet, or wait for the weekly plan reset
404 model not foundModel ID typed differentlyUse exactly Kimi-K3
429Rate limit for your tierReduce concurrency; limits rise with spend, or ask for a committed plan
Tool calls never happenTool calling disabled in the client, or thinking blocks strippedKeep the client's default tool settings; K3 returns a thinking block before tool_use, do not filter it out

Still stuck? Email [email protected] with the request ID from the error body.