# GenerateImage fails with 401 Unauthorized — image generation unavailable in Agent

**URL:** <https://forum.cursor.com/t/generateimage-fails-with-401-unauthorized-image-generation-unavailable-in-agent/162465>\
**Category:** Bug Reports\
**Tags:** image-gen\
**Created:** [June 4, 2026, 7:02pm UTC](https://forum.cursor.com/t/generateimage-fails-with-401-unauthorized-image-generation-unavailable-in-agent/162465 "2026-06-04T19:02:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AI\_GPT](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@AI\_GPT](https://forum.cursor.com/u/AI_GPT)\
**Post date:** [June 4, 2026, 7:02pm UTC](https://forum.cursor.com/t/generateimage-fails-with-401-unauthorized-image-generation-unavailable-in-agent/162465/1 "2026-06-04T19:02:11Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

Hi,

Image generation from the Agent (GenerateImage tool) consistently fails with:

Failed to generate image, error: Request failed with status code 401  
What I’m doing

Asking the agent to generate PNG assets (e.g. course intro / YouTube thumbnails, 16:9, simple prompts).  
The agent calls GenerateImage; every attempt returns 401 immediately (no image file is created).  
Environment

Cursor IDE (macOS)  
Agent mode with shell access  
Same failure on multiple retries over different sessions (not a one-off network blip).  
What I’ve checked

Other tools (terminal, file read/write, web) work normally.  
I haven’t found a clear setting in Cursor for “image generation API” or a dedicated key for this feature.  
Questions

Is GenerateImage tied to a specific Cursor subscription / model entitlement, or a separate API key?  
Where should image generation be enabled or authenticated (Settings → …)?  
Is 401 expected when billing/plan limits are hit, or only when auth is missing?  
Expected: Agent can generate images from text prompts (as documented for the tool).

Actual: Hard 401 on every request.

If anyone from the team sees this: happy to share exact prompt, timestamp, and Cursor version if that helps reproduce.

Thanks!

### Steps to Reproduce

Asking the agent to generate PNG assets (e.g. course intro / YouTube thumbnails, 16:9, simple prompts).  
The agent calls GenerateImage; every attempt returns 401 immediately (no image file is created).

### Operating System

MacOS

### Version Information

Version: 3.6.31 (Universal)  
VS Code Extension API: 1.105.1  
Commit: 81fcf2931d7687b4ff3f3017858d0c6dee7e2a60  
Date: 2026-05-31T17:46:29.630Z  
Layout: editor  
Build Type: Stable  
Release Track: Default  
Electron: 39.8.1  
Chromium: 142.0.7444.265  
Node.js: 22.22.1  
V8: 14.2.231.22-electron.0  
xterm.js: 6.1.0-beta.220  
OS: Darwin arm64 25.5.0

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![brasillero](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/brasillero/32/110708_2.png) [@brasillero](https://forum.cursor.com/u/brasillero)\
**Post date:** [June 4, 2026, 7:39pm UTC](https://forum.cursor.com/t/generateimage-fails-with-401-unauthorized-image-generation-unavailable-in-agent/162465/5 "2026-06-04T19:39:12Z")

</div>

Not sure if it the same root couse but my Agents at the [cursor.com/agens](http://cursor.com/agens) is also failing with 401 just now.

Edit: yes I logged out and in again

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/1/1/114b0da8dfac7e8cf0164ba2544c0f462b66aa60.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/colin/32/90452_2.png) [@Colin](https://forum.cursor.com/u/Colin)\
**Post date:** [June 4, 2026, 7:49pm UTC](https://forum.cursor.com/t/generateimage-fails-with-401-unauthorized-image-generation-unavailable-in-agent/162465/6 "2026-06-04T19:49:48Z")

</div>

Hey there!

> [@AI\_GPT](#):
>
> Image generation from the Agent (GenerateImage tool) consistently fails with:
> 
> Failed to generate image, error: Request failed with status code 401

Thanks for the report. This should be working again now, and we’ll continue to monitor.

---

<div class="post-metadata">

**Author:** ![brasillero](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/brasillero/32/110708_2.png) [@brasillero](https://forum.cursor.com/u/brasillero)\
**Post date:** [June 8, 2026, 7:50pm UTC](https://forum.cursor.com/t/generateimage-fails-with-401-unauthorized-image-generation-unavailable-in-agent/162465/8 "2026-06-08T19:50:03Z")

</div>

Not sure why, but after those errors my account vanished… Completely lost access to it (and I just got the annual plan).

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [July 16, 2026, 4:27pm UTC](https://forum.cursor.com/t/generateimage-fails-with-401-unauthorized-image-generation-unavailable-in-agent/162465/11 "2026-07-16T16:27:21Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
