Repository navigation
fix(vision): prefer free-tier voice key for describe_screen (Option B) - #697
Merged
Merged
Conversation
…ck to paid key describe_screen calls in src/browser-tools.ts and src/recording-tools.ts hit REST generateContent with VISION_MODEL (default gemini-3.1-flash-lite-preview). That model + surface is free-tier eligible on AI Studio (verified HTTP 200 with voice key 2026-05-14). Routing vision through GEMINI_VOICE_API_KEY first means users with the free-tier voice key isolation pattern (PR #452) get vision at $0 instead of paying out of the main GEMINI_API_KEY quota. Fallback preserves existing behavior for users who haven't set GEMINI_VOICE_API_KEY. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
liususan091219
pushed a commit
to liususan091219/sutando-fork
that referenced
this pull request
May 28, 2026
…ck to paid key (sonichi#697) describe_screen calls in src/browser-tools.ts and src/recording-tools.ts hit REST generateContent with VISION_MODEL (default gemini-3.1-flash-lite-preview). That model + surface is free-tier eligible on AI Studio (verified HTTP 200 with voice key 2026-05-14). Routing vision through GEMINI_VOICE_API_KEY first means users with the free-tier voice key isolation pattern (PR sonichi#452) get vision at $0 instead of paying out of the main GEMINI_API_KEY quota. Fallback preserves existing behavior for users who haven't set GEMINI_VOICE_API_KEY. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
describeScreenshot()in bothsrc/browser-tools.tsandsrc/recording-tools.tsnow readsGEMINI_VOICE_API_KEYfirst, falling back toGEMINI_API_KEY.generateContentongemini-3.1-flash-lite-preview) is free-tier eligible — routes vision off the paid key by default.Why
Users following the PR #452 voice-key isolation pattern now get vision at $0 instead of metering it on their main key.
Empirical check
curl :generateContent?key=\$GEMINI_VOICE_API_KEYwithgemini-3.1-flash-lite-preview→ HTTP 200,serviceTier: standard(2026-05-14).send_client_content+Part(inline_data=Blob)— separate finding, not part of this PR.Caveats not addressed in this PR
describeScreenshot()is duplicated verbatim across the two files — DRY refactor deferred.src/voice-agent.tsheader comment (line 14) still callsGEMINI_API_KEYthe "vision" key..env.example(5-16) still implies vision = paid. Doc cleanup deferred to a separate PR.Test plan
GEMINI_VOICE_API_KEYset: voice-agentdescribe_screenreturns a valid caption.GEMINI_API_KEYset: behavior unchanged (fallback).🤖 Generated with Claude Code