Enable OpenAI for AI grading
QuizMachine can use OpenAI's Chat Completions API to suggest grades for free-text and code answers, and to review question wording. An administrator still reviews every suggested score before applying it.
Step 1 — Create an API key
- Sign in to the OpenAI API key page.
- Create a project API key for QuizMachine and copy it immediately.
- Ensure the project has billing, permissions, and model access for the model you intend to use.
Step 2 — Choose endpoint and model
Leave the endpoint blank to use the documented default:
| Setting | Value |
|---|---|
| Endpoint | https://api.openai.com/v1/chat/completions |
| Default model | gpt-4.1-mini |
You can enter another Chat Completions-compatible model available to your API project. Verify availability in OpenAI's model list before saving. Codex and gpt-3.5-turbo are model selections, not separate providers; use them only when the project lists them and they support this API contract.
Step 3 — Add it in QuizMachine
- Open the quiz Configure tab, or your personal AI settings page.
- Choose OpenAI for a fallback priority.
- Enter the model, optional endpoint, and API key.
- Use Test configuration, then save the fallback profiles.
Troubleshooting
- HTTP 401 — the key is invalid, revoked, or lacks project access.
- HTTP 429 — the project has reached a rate or usage limit.
- HTTP 400 — check the model name and custom endpoint.
- Manual review — the request or provider response failed safely; no AI score was applied.
Rotate or remove a key
Create a replacement key in OpenAI first, update and test the affected QuizMachine profile, then revoke the old key in OpenAI. Disable or remove the profile in QuizMachine when it should no longer receive answer data.
Reference: OpenAI Chat Completions API reference.