Logo

anthropic

#10498

input_validation_error

The input for 'messages.0.content.2.image.source.media_type' is invalid. Acceptable media types are 'image/jpeg', 'image/png', 'image/gif', or 'image/webp'.

This error has been identified and solved.

Reason

The 400 status error you are encountering, specifically the message messages.0.content.2.image.source.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp', indicates that the media type of the image you are trying to send does not match one of the accepted formats. The Anthropic API only accepts images in the formats image/jpeg, image/png, image/gif, or image/webp, and your current image does not comply with these requirements.

Solution

To fix the 400 status error, you need to ensure that the image you are sending is in one of the supported formats. Here are the steps to resolve the issue:

Ensure the image is in one of the following formats:

  • image/jpeg

  • image/png

  • image/gif

  • image/webp

Check and correct the media_type field in your API request to match the actual format of the image.

Verify that the image is properly encoded in base64 and included in the request as specified by the API documentation.

Original Error Message

Raw

The input for 'messages.0.content.2.image.source.media_type' is invalid. Acceptable media types are 'image/jpeg', 'image/png', 'image/gif', or 'image/webp'.

Original Error Message

Raw

The input for 'messages.0.content.2.image.source.media_type' is invalid. Acceptable media types are 'image/jpeg', 'image/png', 'image/gif', or 'image/webp'.

© 2024 Portkey, Inc. All rights reserved

HIPAA

COMPLIANT

GDPR

Transform Your AI app prototypes to be production-ready

Talk to us →