AI Tutor Sessions

Starting, managing, and paying for AI tutoring sessions.

POST /++clear_ai_session_project_state Clear ai session project state Admin action - clears only the saved work, keeps the session and its usage history intact. Distinct from DeleteAISessionHistory (which removes everything). POST /++create_ai_session_checkout Create ai session checkout POST: {"hours": <positive integer>, "existing_token": "..." (optional, for topup)} Returns {"checkout_url": ..., "token": ...} - the token is available immediately, before payment completes, so the frontend can store it and poll for activation once Stripe redirects back. POST /++delete_ai_session_history Delete ai session history Permanent - removes a session's entire record, including usage history a refund would otherwise preserve. Only for freeing storage on old, no-longer-relevant sessions. GET /++get_ai_session_pricing_info Get ai session pricing info Public - the pricing page needs this without requiring login. Fetches the live Stripe price (same cached lookup already used by the usage report), not a hardcoded figure, so changing the price in Stripe is reflected here automatically. GET /++get_ai_session_status Get ai session status Returns the current status of an AI tutoring session for the given token - whether it's active, whether payment is confirmed, and how much time remains. GET /++load_ai_project_state Load ai project state Retrieves the previously saved project state for an AI tutoring session, given its token. POST /++pause_ai_session Pause ai session Pauses a running AI tutoring session, stopping its countdown timer, given the session's token. POST /++resume_ai_session Resume ai session Resumes a paused AI tutoring session and restarts its countdown timer; fails if no time remains on the session. POST /++save_ai_project_state Save ai project state Saves the current in-progress project state for an AI tutoring session, so it can be restored later.