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
design setup: rejects new-format Gemini API keys ("AQ…"), only accepts "AIza…" #4239
Google AI Studio now issues Gemini API keys that start with AQ. $D setup --provider gemini rejects them:
Invalid key. A Gemini key starts with 'AIza'.
The check is in design/src/cli.ts:
constKEY_PREFIX: Record<ProviderName,string>={openai: "sk-",gemini: "AIza"};// line 95
...
if(!key||!key.startsWith(KEY_PREFIX[provider])){// line 136
The key itself is valid. Writing it straight to ~/.gstack/gemini.json ({"api_key": "AQ…"}), which auth.ts loads without a prefix check, lets Google accept it: requests go through and are billed.
Provider auto-detection has the same assumption (cli.ts:135): with no --provider, an AQ… key is classified as OpenAI and rejected for not starting with sk-.
Environment
gstack 1.98.0.0 (checkout 350d419; same code on main at f75ce6f)
Accept both prefixes for Gemini (AIza and AQ), or drop the hard prefix check when --provider is given and let the smoke test validate the key. For auto-detection, treat AIza…/AQ… as Gemini.
The setup prompt and auth.ts comments that say Gemini keys look like AIza… would need the same update.
Thanks for the report. On main, design/src/cli.ts still only accepts AIza for Gemini and auto-detects an AQ key as OpenAI, so this matches. #4283 proposes a fix, and we'll look at both together with #4238. gstack is in a tooling freeze until November 21, so it will be looked at after that.
Following up: we're taking this. New Gemini keys start with AQ, so the design tool's setup turns away every new free key it asks for. Accepting both prefixes, and detecting both as Gemini, is a small fix. #4283 proposes it; it will be rebuilt on current main with credit and linked here after November 21.
Picking this up. A maintainer agent working through a batch of fixes (our tracking thread GSTA-801) will first reproduce this on current main. If it reproduces, the agent fixes it on main and we'll close this issue with a link when the change lands. If it no longer reproduces, we'll close it and say what changed. PR #4283 is the starting point.
Fixed on main in #4684: $D setup now accepts the newer AQ. Gemini keys as well as AIza… keys, and gstack's secret redaction covers the new format too. Thanks for the report.
Activity
capy-ai commentedon Nov 10, 2026
Thanks for the report. On main, design/src/cli.ts still only accepts
AIzafor Gemini and auto-detects anAQkey as OpenAI, so this matches. #4283 proposes a fix, and we'll look at both together with #4238. gstack is in a tooling freeze until November 21, so it will be looked at after that.capy-ai commentedon Nov 16, 2026
Following up: we're taking this. New Gemini keys start with
AQ, so the design tool's setup turns away every new free key it asks for. Accepting both prefixes, and detecting both as Gemini, is a small fix. #4283 proposes it; it will be rebuilt on current main with credit and linked here after November 21.capy-ai commentedon Nov 22, 2026
Picking this up. A maintainer agent working through a batch of fixes (our tracking thread GSTA-801) will first reproduce this on current main. If it reproduces, the agent fixes it on main and we'll close this issue with a link when the change lands. If it no longer reproduces, we'll close it and say what changed. PR #4283 is the starting point.
capy-ai commentedon Nov 22, 2026
Fixed on main in #4684:
$D setupnow accepts the newerAQ.Gemini keys as well asAIza…keys, and gstack's secret redaction covers the new format too. Thanks for the report.