google / google/generative-ai-docs

Persistent 401 error on Gemini API image generation (PRO account)

Open
#620 0 comments 0 reactions 0 assignees View on GitHub
type:bug
Dominant language
Jupyter Notebook
Stars
2.3k
Forks
735
PR merge metrics
No merged PRs in 30d

Description

### Description of the bug:

I have a PRO account but keep getting 401 errors when trying to generate images.
API key works with curl for model listing, but fails for image generation.

Timeline:
- Feb 7: Created new API key → worked temporarily
- Feb 8-13: Normal usage (150-200 images/day)
- Feb 14: 401 error appeared
- Today: Still unable to generate any images

What I've tried:
- Multiple new API keys
- Both APIs enabled
- Different models (gemini-2.5-flash-image-preview, gemini-2.0-flash-exp-image-generation)
- New project
- Checked billing (active)

Please check if my account has been mistakenly flagged.

Project ID: [你的 Project ID]

### Actual vs expected behavior:

_No response_

### Any other information you'd like to share?

_No response_

專案編號: 220810241645 專案 ID: united-helix-474107-b3

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.