Hi guys! I'm trying to use Anthropic Vision API with xano, but they require to send images in base64 format.
I've tried the base64_encode feature in xano, but it's not working properly.
For example let's take this image from twitter: https://pbs.twimg.com/profile_images/1437249988283621376/7Ut3lyN0_400x400.jpg
using the base64_encode function I get the following result:
aHR0cHM6Ly94OGtpLWxldGwtdHdtdC5uNy54YW5vLmlvL3ZhdWx0L25DWUpaTmVQL2swQkcySkdQN1pQN1d4LXN6TjFoVG9IRjlNWS92U1VwS1EuLi9WRnJaenBmSV80MDB4NDAwLmpwZw==
I receive an error from anthropic api saying the format isn't correct.
I've found a converter online https://base64.guru/converter/encode/image/jpg where it lets you upload a jpg to convert to base64, and I get a correct result that is accepted by anthropic API:
/9j/4AAQSkZJRgABAQAAAQABAAD/4gKgSUNDX1BST0ZJTEUAAQEAAAKQbGNtcwQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAA... [cropped as this is a huge block of text]
How can I get the same result from that tool on Xano? seems like you guys aren't encoding base64 the same way.
Thanks!
About base64_encode
6 replies