Skip to content

Enhance: Gemini API returns 404 for gemini-2.5-flash (deprecated for new API keys) #144

Description

Description

Clicking Enhance immediately fails with a Gemini API 404. The model ID
gemini-2.5-flash appears to be hardcoded and is now blocked by Google
for newly created API keys.

Environment

  • Platform: macOS (Apple Silicon, Apple M5 Pro, 48GB unified memory)
  • LTX Desktop version: 1.1.0
  • Base Model: 1.1 (active)
  • Generation mode: local (MPS), Enhance via Gemini API
  • Gemini API key: freshly generated at Google AI Studio, shows "Key configured" in Settings

Steps to reproduce

  1. Configure a fresh Gemini API key in Settings > API Keys
  2. Enter a prompt in Gen Space
  3. Click Enhance
  4. Error appears immediately

Log excerpt

```
2026-08-05 23:38:44,254 - INFO - [Backend] INFO:handlers.generation_handler:Generation a6d1b772 started (api)
2026-08-05 23:38:44,255 - INFO - [Backend] INFO:handlers.prompt_enhancement_handler:Enhancing prompt via Gemini API
2026-08-05 23:38:44,510 - INFO - [Backend] ERROR:handlers.generation_handler:Generation a6d1b772 failed: Gemini API error: {
"error": {
"code": 404,
"message": "This model models/gemini-2.5-flash is no longer available to new users. Please update your code to use a newer model for the latest features and improvements.",
"status": "NOT_FOUND"
}
}
2026-08-05 23:38:44,511 - INFO - [Backend] WARNING:logging_policy:HTTP error on POST /api/enhance-prompt: [404] Gemini API error: ...
```

Suggested fix

gemini-2.5-flash is deprecated for new API keys (Google is enforcing this
ahead of the official Oct 16, 2026 shutdown). Suggest updating the hardcoded
model ID in handlers/prompt_enhancement_handler to a current model, e.g.
gemini-3.6-flash or gemini-2.5-flash-lite, ideally made configurable so
future Google deprecations don't require an app update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions