Kimi K3 in OpenCode
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.
Configuration
Create or edit ~/.config/opencode/opencode.json (global) or opencode.json in the project root (per project):
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ainetcafe": {
"npm": "@ai-sdk/openai-compatible",
"name": "ainetcafe",
"options": {
"baseURL": "https://microquickjs.com/v1",
"apiKey": "{env:AINETCAFE_API_KEY}"
},
"models": {
"Kimi-K3": {
"name": "Kimi K3",
"limit": { "context": 262144, "output": 32768 },
"tool_call": true,
"attachment": true
}
}
}
},
"model": "ainetcafe/Kimi-K3"
}
Export the key in your shell profile so the env: reference resolves:
export AINETCAFE_API_KEY=sk-your-ainetcafe-key
Run opencode, then /models to confirm ainetcafe/Kimi K3 is selected.
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/chat/completions \
-H "Authorization: Bearer $AINETCAFE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"Kimi-K3","messages":[{"role":"user","content":"Say OK"}],"max_tokens":5}'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.