Enable Kimi (Moonshot AI) for AI grading
QuizMachine can grade free-text answers with either the newer Kimi Code API or the legacy Moonshot Platform API. This guide explains how to get a key, choose an endpoint, and enter the settings.
Step 1 — Create an account and API key
Pick whichever generation you have (or want) a key for:
- For Kimi Code keys starting with sk-kimi-, go to the Kimi Code console, sign in, create a key, and copy it immediately because it is shown only once.
- For legacy Moonshot keys starting with sk- but not sk-kimi-, go to platform.moonshot.cn, register or sign in, complete any required verification and billing setup, create an API key in the console, and copy it immediately.
Step 2 — Endpoint and model
Both generations use an OpenAI-compatible chat-completion endpoint. QuizMachine chooses the matching default from the key prefix when the endpoint is blank:
| Key prefix | Default endpoint | Default model |
|---|---|---|
sk-kimi-… |
https://api.kimi.com/coding/v1/chat/completions |
kimi-for-coding |
sk-… (legacy) |
https://api.moonshot.cn/v1/chat/completions |
kimi-k3 |
Some Kimi models, including kimi-k3, accept only one sampling temperature. QuizMachine detects those and sends the value they require, so there is nothing for you to configure.
Other Kimi Code models are documented at kimi.com/code/docs. The catalog includes k3 and kimi-for-coding-highspeed; legacy Moonshot alternatives include moonshot-v1-32k and moonshot-v1-128k.
Diagram Upload questions
For Diagram Upload questions, QuizMachine uses Moonshot's vision-capable model and sends the uploaded image, any author reference diagram, the question text, and the model answer for visual grading.
moonshot-v1-8k-vision-preview
If diagram grading returns low-confidence text-only results, verify that your API key has access to the vision model.
Step 3 — Enter the settings in QuizMachine
- Open your quiz, go to the Configure tab, and find AI evaluation for free-text questions.
- Set AI provider to Kimi (Moonshot).
- Leave API endpoint URL blank to use the default matching your key's prefix, or paste a custom endpoint (e.g. to pin a specific generation regardless of key prefix).
- Paste your API key into API key.
- Click Test configuration to verify connectivity — a green message confirms the key works.
- Click Save AI settings.
On a free-text question, enable Grade this question with AI and provide a model answer. Submitted answers are graded automatically and queued for admin review.
Troubleshooting
- HTTP 401 Unauthorized — the API key is wrong, expired, or hasn't been activated yet.
- HTTP 429 Too Many Requests — you've exceeded your rate or token quota; check usage in the relevant console.
- HTTP 400 Bad Request usually means a malformed request or key/endpoint mismatch. Leave the endpoint blank for automatic matching, or verify the custom endpoint against the table above.
- Answers show "Manual review" — grading failed. Use Test configuration to see the exact error.
Reference: Kimi Code documentation and legacy Moonshot Platform documentation.