Kimi K3 in Claude Code
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
- K3 thinks before it acts. The first token can take one to a few seconds on a large repository; later tokens stream normally.
- Prompt caching is on by default. Repeated context in long sessions bills at $0.30 per million instead of $2.10.
- Claude Code's 1M-context mode works: K3 has a native 1M window.
If something goes wrong
| Symptom | Cause | Fix |
|---|---|---|
| 401 Invalid token | Key copied with a space, or key from another site | Re-copy from Token Management on microquickjs.com |
| 403 quota / insufficient balance | Wallet at zero or plan quota used up | Top up in Wallet, or wait for the weekly plan reset |
| 404 model not found | Model ID typed differently | Use exactly Kimi-K3 |
| 429 | Rate limit for your tier | Reduce concurrency; limits rise with spend, or ask for a committed plan |
| Tool calls never happen | Tool calling disabled in the client, or thinking blocks stripped | Keep 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.