---
title: OPTIMIZED_EXTERNAL_IMAGE_REQUEST_UNAUTHORIZED
product: vercel
url: /docs/errors/OPTIMIZED_EXTERNAL_IMAGE_REQUEST_UNAUTHORIZED
type: reference
prerequisites:
  []
related:
  []
summary: The external image request is unauthorized. This is a request error.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# OPTIMIZED_EXTERNAL_IMAGE_REQUEST_UNAUTHORIZED

The `OPTIMIZED_EXTERNAL_IMAGE_REQUEST_UNAUTHORIZED` error occurs when the external image request is unauthorized.

**Error Code:** `502`

**Name:** Bad Gateway

## Troubleshoot

To troubleshoot this error, follow these steps:

1. **Check permissions:** Ensure that you have the necessary permissions to access the external image
2. **Verify authentication:** Check for any authentication or authorization issues with the external source
3. **Update credentials:** Ensure that any required credentials or tokens are correctly set and not expired
4. **Remove filters**: Remove any filters that may be blocking the request, such as headers or IP restrictions


---

[View full sitemap](/docs/sitemap)
