Generate a quiz with AI
quiz_video_generate_quizAI-generate and save a quiz from a topic. Prefer providing themeDescription or themeCustomization; when omitted, the server derives and saves a topic-based custom theme. Omit backgroundMusicId to use default YouTube-safe shared background music, or set null for silent. The response data always includes a watchUrl (the public quiz-viewer page, instantly playable). When autoRender is true, data.render also contains the queued render session so the agent can poll quiz_video_get_render for the MP4.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | Subject the AI should build the quiz around. | |
| format | No | Output aspect ratio. Defaults to "tiktok". | |
| quizType | No | Quiz mechanic to generate. | |
| template | No | Visual template id. If omitted, the saved custom theme can suggest a matching template. | |
| autoRender | No | If true, immediately queue a video render for the new quiz. The render session (sessionId, status) is returned under `data.render`; poll quiz_video_get_render with that sessionId for progress and the final videoUrl. Rendering typically takes 1-5 minutes. Quiz creation is not blocked by render-queue failures — the quiz is returned either way. | |
| difficulty | No | Target difficulty level. | |
| musicVolume | No | Background music volume from 0 (silent) to 1 (full). Default 0.15. | |
| extraDirection | No | Additional instructions to steer the AI (tone, focus areas, exclusions). | |
| countdownSeconds | No | Seconds of countdown shown before each question (3-15). | |
| progressBarStyle | No | Countdown progress indicator style. | |
| themeDescription | No | Natural-language custom visual theme prompt. Example: "golden luxury game show", "ocean glass", or "cyber neon". | |
| answerOptionCount | No | For multiple-choice quizzes, generate 3 or 4 answer options per question. Defaults to 4. | |
| backgroundMusicId | No | Background music track id from /api/v1/music. Omit to use the default YouTube-safe shared track; set null for silent. | |
| numberOfQuestions | No | How many questions to generate (1–200). | |
| themeCustomization | No | Explicit custom theme to save and apply to the generated quiz. Use themeDescription for prompt-style themes. |