OpenAI: Pages Unwritten — Build a Choose-Your-Own-Adventure
Build a playable choose-your-own-adventure visual novel with the OpenAI API. Add a storyteller, branching choices, scene backgrounds with gpt-image-1, story-arc tracking, and streaming — one exercise at a time.
View badge details
About This Course
Build a fully playable web-based visual novel powered by the OpenAI API. You'll start with a complete Flask game shell title screen, genre picker, choice rendering, page-flip UI and progressively wire up OpenAI to bring it alive. Each exercise adds a new capability: a storyteller that writes scene narration, structured-output choice branches, AI-generated scene backgrounds via gpt-image-1, plot-arc tracking with ending detection, and streaming narration with compressed long-term memory. By the end you'll have an infinitely replayable choose-your-own-adventure across five genres, plus practical experience with text generation, structured outputs, image generation, streaming, and context-window management.
Course Curriculum
3 Lessons
Pages Unwritten Lab 1 — Storyteller and Branching Choices
Wire up the OpenAI client to a working Flask visual-novel shell. In this first lab you'll build a storyteller system prompt that returns live narration, then upgrade to JSON-mode structured output so each scene returns both prose and a fresh list of branching choices.
Pages Unwritten Lab 2 — Images and Story Arc
Pick up where Lab 1 left off — the storyteller and branching choices are already wired in. In this lab you'll generate per-scene background art with gpt-image-1 and extend the JSON schema so the model tracks plot flags, three-act structure, and detects natural endings.
Pages Unwritten Lab 3 — Streaming, Memory, and Voice
Pick up the visual novel from Lab 2 with the storyteller, choices, scene art, and ending detection already in place. In this final lab you'll stream narration token-by-token with bounded memory compression, then add voiced narration with the OpenAI Speech (TTS) API mapped per genre.