Logo

azure-openai

#10048

input_validation_error

Invalid image URL: The URL must be a valid HTTP, HTTPS, or a base64-encoded data URL.

This error has been identified and solved.

Reason

The 400 status error in the Azure OpenAI API, specifically related to an "Invalid image URL," can be caused by several factors:

Invalid URL Encoding

The image URL may contain encoded characters that are not properly handled. For example, URLs from storage services like Firebase can include encoded characters (e.g., %2F instead of /) which can make the URL invalid when processed by the API.

Incorrect URL Format

The URL provided might not be a valid HTTP or HTTPS URL, or it may not be a correct data URL with base64 encoding. The API expects a specific format, and any deviation from this can result in a 400 error.

Private Blob Access Issues

If the image is stored in a private Azure Blob, the URL might not include the necessary permissions or SAS (Shared Access Signature) token, leading to an invalid URL error when the API tries to access the image.

Malformed or Incomplete URL

The URL could be malformed or incomplete, lacking necessary components such as the protocol (http/https), the domain, or other required parameters, which would make it invalid for the API to process.

Solution

To resolve the "Invalid image URL" error in the Azure OpenAI API, you need to ensure the following:

  • Verify that the URL is a valid HTTP or HTTPS URL.

  • If using base64 encoding, ensure it is properly formatted as a data URL.

  • For images stored in Azure Blob, include the necessary SAS (Shared Access Signature) token in the URL.

  • Check that the URL does not contain malformed or encoded characters that could make it invalid.

Key steps to take:

  • Ensure the URL includes the correct protocol (http/https) and domain.

  • Use a valid data URL format if base64 encoding is used.

  • Include the necessary permissions or SAS token for private blob access.

  • Double-check the URL for any malformations or missing components.

Original Error Message

Raw

Invalid image URL: The URL must be a valid HTTP, HTTPS, or a base64-encoded data URL.

Original Error Message

Raw

Invalid image URL: The URL must be a valid HTTP, HTTPS, or a base64-encoded data URL.

© 2024 Portkey, Inc. All rights reserved

HIPAA

COMPLIANT

GDPR

Transform Your AI app prototypes to be production-ready

Talk to us →