I would be happy to help. Full docs on the format are at https://docs.visionati.com/#analyze-an-image-video
There are a few things to note:
- The file must be base64 encoded or a Data URI. You can't just pass a file object!
- Authentication should send the header
Authorization: Token <YOUR_API_KEY>
- The backend and feature are the correct format, but google vision does not support descriptions! Only openai, gemini, jinaai, claude, llava and bakllava support them!
Here is a simple example in javascript. This is taken from our analyze app.
prompt = "Whatever prompt you want to use"
var data = {
feature: ['descriptions'],
backend: ['openai']
prompt: prompt
};
file_input = document.getElementById("file");
file = file_input.files[0];
if (file.size > 10000000) {
document.getElementById("apierror").innerHTML = "File too large. Max size is 10MB.";
document.getElementById("spinner").innerHTML = "";
return false;
}
data.file = await getBase64(file);
data.file_name = file.name;
xhttp.open("POST", "/api/fetch", true);
xhttp.setRequestHeader('Content-type', 'application/json;charset=utf-8');
xhttp.send(JSON.stringify(data));