Forum Discussion
Azure Open AI
Hi Team, I have been trying to use gpt-4o capability on azure open-ai to pass base64 encoded image. But I m getting this response:
{"requestPayload":null,"meta":{"blocking":true},"status":"completed","planId":"38334edf2b3242102d79fa97ce91bf37","capabilities":{"35070ec3fbb68e5007e5f69605efdc04":{"provider":"Azure OpenAI","response":"The provided JSON contains a structure with two main elements: a text prompt and an image URL. The text prompt asks, \"What’s in this image?\" and the image URL is encoded in base64 format. However, the base64 string for the image is incomplete and appears to be corrupted or truncated.\n\nTo properly analyze the image, the complete base64 string is required. If you can provide the full base64 string, I can help you decode and analyze the image. Alternatively, you can upload the image to a file-sharing service and provide the link.","logId":"7b40eb2b3b32c210f27a3c8c24e45ae1","status":"success"}},"startedAt":"2024-06-21 03:38:59","completedAt":"2024-06-21 03:39:07","transactionId":"e5564919-b644-43fb-b0ba-a2bc60016513","message":null}I have ensured the image URL is correct and contains correct base64 value but still its not working. What could be the issue?
2 Replies
When using Azure OpenAI GPT‑4o with image input, the service does not accept raw base64 strings directly in the image_url field. The error you are seeing (Error creating dev tunnel / “base64 string incomplete or corrupted”) typically occurs because the payload format does not match the expected schema.
https://learn.microsoft.com/en-us/azure/foundry/openai/reference
Don’t pass the raw base64 string by itself. Pass it as an image data URI, for example data:image/png;base64,<your_base64_here>, inside the image input field. Also make sure the base64 is complete, not truncated by logging or payload size, and that the deployment/model supports vision input.