You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add billing/cost warnings for Gemini Live API and implement session auto-kill / length cap #161
The system currently relies on Gemini Live API for interactive audio streaming. While the configured model (gemini-3-flash-live / gemini-3.1-flash-lite) is cost-effective for typical use, the continuous WebSocket audio/video stream consumes substantial Tokens unexpectedly fast (Audio Output Tokens + Context accumulation).
In my testing, a short session consumed over NT$500+ (~$16 USD) in API credits, quickly depleting prepaid balances. Since users might assume Flash/Lite models incur negligible costs, running an interview without cost awareness or automatic safeguards can lead to unexpected financial charges.
Observed Behavior
Unexpected High API Billing: Audio input/output tokens accumulate rapidly. Long sessions keep history context in memory, escalating token usage linearly.
Lack of Cost/Usage Safety Thresholds: There is no warning about real-time audio token costs before starting, nor an explicit auto-cleanup for idle/run-away background connections.
Unclosed or long-running WebSocket audio sessions can exhaust a small credit balance within an hour of active streaming.
Real-world Terminal Logs / Evidence
evidence: at=16:29.948 phase=coding accepted=true room=interview-mx7wt7we
interim review skipped: Gemini request rejected (status=402)
...
Gemini refused to resume (Gemini closed before setupComplete: code=1011 reason=Your prepayment credits are depleted...); starting a fresh session instead
...
Gemini could not be reached; ending interview room=interview-mx7wt7we
Suggested Behavior & Improvement Proposals
(Note: Excluded error messaging handling as it overlaps with #159 and #177. Focusing on cost warnings and bounds.)
Pre-session Cost Warning: Display a clear notice in the setup screen informing candidates/interviewers that Gemini Live API consumes audio tokens continuously and requires an active paid API key / sufficient quota.
Session Duration Cap & Auto-Disconnect: Implement a hard limit on the Live API session duration to prevent runaway costs. (The specific duration bounds and fallback behavior should be designed based on the existing contract in docs/provider-cost-and-degradation.md).
Text-Only Modality Toggle: Provide an option to disable Audio Output and rely on TEXT modality instead, which serves as a cost-saving or fallback mechanism. This toggle should also align with the degradation guidelines in docs/provider-cost-and-degradation.md.
changed the title [-][Feature / Safety] Add billing/cost warnings for Gemini Live API and implement session auto-kill / length cap[/-][+]Add billing/cost warnings for Gemini Live API and implement session auto-kill / length cap[/+]on Sep 28, 2026
Item 4 here overlaps #159, which asks for the same thing: an actionable quota and billing message in the browser, and an end to the reconnect loop once the provider has reported a billing failure. #177 then proposes the concrete mechanism for showing it, carrying the reason on the existing interviewer_state message.
Suggest narrowing this issue to what is unique to it and has no other thread: the pre-session cost warning, the maximum session duration with auto-disconnect, and the text-only modality toggle. The error messaging can then be settled once in #159 and #177 instead of three times.
What an interview may spend and what bounds a misbehaving provider are owned by docs/provider-cost-and-degradation.md. A duration cap and a modality toggle are changes to that contract, so the proposal should start from what the document already says rather than from a number chosen here.
@AchlysChang A pull request for the pre-session cost warning alone is welcome. Base its wording on what docs/provider-cost-and-degradation.md already says rather than on a number chosen in the PR, and end it with Refs #161, since the duration cap and the text-only toggle stay open here. No assignment is needed.
@AchlysChang The pre-session cost warning was accepted on 2026-10-12, and no pull request has appeared since. Is it still coming? If there is no reply by 2026-10-27, the assignment is removed and the issue stays open for anyone else to take, with Refs #161.
Thanks for checking in! I'm actively working on this feature in my local branch and finalizing the implementation based on docs/provider-cost-and-degradation.md.
I will submit the PR in the next few days. Please keep the assignment with me. Thank you for your patience!
#436 implements the pre-session cost warning and ends with Refs #161, so its merge leaves this issue open for the session length cap with auto-disconnect and the text-only toggle.
Activity
[-][Feature / Safety] Add billing/cost warnings for Gemini Live API and implement session auto-kill / length cap[/-][+]Add billing/cost warnings for Gemini Live API and implement session auto-kill / length cap[/+]jserv commentedon Sep 28, 2026
Do not add
[Feature / Safety]or similar labels to the subject, as maintainers can classify them on demand.jserv commentedon Sep 29, 2026
Item 4 here overlaps #159, which asks for the same thing: an actionable quota and billing message in the browser, and an end to the reconnect loop once the provider has reported a billing failure. #177 then proposes the concrete mechanism for showing it, carrying the reason on the existing
interviewer_statemessage.Suggest narrowing this issue to what is unique to it and has no other thread: the pre-session cost warning, the maximum session duration with auto-disconnect, and the text-only modality toggle. The error messaging can then be settled once in #159 and #177 instead of three times.
What an interview may spend and what bounds a misbehaving provider are owned by
docs/provider-cost-and-degradation.md. A duration cap and a modality toggle are changes to that contract, so the proposal should start from what the document already says rather than from a number chosen here.AchlysChang commentedon Oct 12, 2026
Thanks @jserv for the guidance.
I will start by addressing the first part of this issue in a separate, small Pull Request: implementing the pre-session cost warning notification.
I have reviewed
docs/provider-cost-and-degradation.mdto ensure the warning limits and logic align with the repository guidelines.I am currently working on a topic branch for this feature. Could you please assign this issue to me?
jserv commentedon Oct 12, 2026
@AchlysChang A pull request for the pre-session cost warning alone is welcome. Base its wording on what
docs/provider-cost-and-degradation.mdalready says rather than on a number chosen in the PR, and end it withRefs #161, since the duration cap and the text-only toggle stay open here. No assignment is needed.jserv commentedon Oct 20, 2026
@AchlysChang The pre-session cost warning was accepted on 2026-10-12, and no pull request has appeared since. Is it still coming? If there is no reply by 2026-10-27, the assignment is removed and the issue stays open for anyone else to take, with
Refs #161.AchlysChang commentedon Oct 22, 2026
Hi @jserv,
Thanks for checking in! I'm actively working on this feature in my local branch and finalizing the implementation based on
docs/provider-cost-and-degradation.md.I will submit the PR in the next few days. Please keep the assignment with me. Thank you for your patience!
jserv commentedon Oct 22, 2026
Do reply in time, as effective collaboration.
Warn about Gemini billing before an interview
jserv commentedon Oct 23, 2026
#436 implements the pre-session cost warning and ends with
Refs #161, so its merge leaves this issue open for the session length cap with auto-disconnect and the text-only toggle.Warn about Gemini billing before an interview
Warn about Gemini billing before an interview
Warn about Gemini billing before an interview
Warn about Gemini billing before an interview
Warn about Gemini billing before an interview
Warn about Gemini billing before an interview