Inspiration
WriteAIBook started with a problem I kept seeing in raw AI chats: chapter one sounded promising, but later chapters forgot names, contradicted earlier events, or drifted into a completely different story.
Generating another paragraph was easy. Keeping an entire book connected to one coherent plan was the real challenge.
WriteAIBook existed before Build Week. This submission focuses specifically on the production extension built after July 13: GPT‑5.6 Terra integration, durable generation, continuity-aware expansion, safer recovery, and artifact-level feedback.
What it does
An author enters a premise, genre, language, and desired length. WriteAIBook creates a story bible and chapter plan, then generates prose against that shared state.
During the Build Week journey:
- The author receives a free Pro chapter after signing in.
- Their complete book setup survives authentication.
- Generation continues server-side if the page closes.
- The manuscript, story bible, plan, and job state persist together.
- “Continue” resumes the same book instead of opening a disconnected chat.
- Only newly requested chapters are billed.
- The result is delivered as an editable Word document.
- Ratings remain attached to the exact generated book.
The goal is simple: one premise in, one connected and editable manuscript out.
How I built it
WriteAIBook is a Python 3.12 application built with Quart, SQLAlchemy, SQLite, vanilla JavaScript, server-side generation jobs, Stripe billing, and S3-compatible artifact storage.
Pro generation now uses gpt-5.6-terra through the official OpenAI API. If that route is unavailable, OpenRouter provides the same model rather than silently downgrading the author to a cheaper quality tier.
The continuation workflow crosses the entire stack. It preserves:
- The original manuscript
- Story-bible and character canon
- Chapter plans
- Genre, language, premise, and quality tier
- Authentication return state
- Generation progress and recovery state
- Delta-only billing for additional chapters
I used Codex throughout the qualifying work to trace the existing asynchronous pipeline, implement the model transition, reproduce production failures, review edge cases, and create deterministic unit, integration, and browser tests.
I made the core product decisions—same-model failover, no hidden downgrade, strict safety boundaries, and delta-only billing—then used Codex to apply those invariants consistently across the codebase.
Challenges
The hardest part was not calling a new model. It was changing a live book-generation system without losing manuscripts, charging twice, or producing a first chapter that could not be continued.
GPT‑5.6 Terra also rejected legacy sampling parameters accepted by the previous model. Instead of adding a fragile special case, I introduced capability-aware request construction and regression tests.
Quality recovery created another difficult tradeoff. A small length miss should not erase an otherwise usable twelve-chapter manuscript. WriteAIBook now allows bounded repair and can preserve clean prose after a minor quality-target miss. Refusals, unsafe content, exhausted providers, and unusable files still fail hard.
Authentication and checkout introduced subtle browser races as well. I added delayed-response tests that reproduce stale requests and verify that the author’s book configuration survives every transition.
What I learned
A strong model is only one part of a trustworthy creative system. Persistence, continuity, recovery, billing correctness, and honest interface state matter just as much as prose quality.
I also learned that agent collaboration works best when the requirements are expressed as concrete invariants:
- This state must survive authentication.
- This model may fail over, but never downgrade.
- This output may receive one bounded repair.
- This failure must stop generation.
- Continuation must bill only the difference.
Those rules gave Codex enough structure to make useful changes across a large production codebase without losing the product’s intent.
What I’m proud of
- GPT‑5.6 Terra powers the complete Pro generation path.
- Failover preserves the same model and quality promise.
- Authors can continue the same manuscript with its canon intact.
- Generation survives page closure and browser refreshes.
- Minor quality misses no longer discard usable books.
- Feedback is tied to the exact generated artifact.
- Production failures became reproducible regression tests.
- The Build Week work runs in the real product rather than a separate demo shell.
What’s next
Next, I want to use per-book feedback to compare quality across genres and generation strategies. I also want to make story bibles, character histories, and series continuity easier for authors to inspect before spending credits.
The long-term goal is fewer discarded drafts, fewer continuity surprises, and a clearer path from one idea to a book an author is genuinely excited to edit.
Built With
- codex
- css
- github-actions
- gpt-5.6-terra
- html
- javascript
- nginx
- openai-api
- openrouter
- playwright
- pytest
- python
- quart
- rest-api
- s3
- sqlalchemy
- sqlite
- stripe
Log in or sign up for Devpost to join the conversation.