Upload a photo and ask questions about it. The AI will describe, analyze, and explain anything in your image.
Single endpoint. CORS enabled for all origins. No authentication required.
/api/imgchat.
Use GET as a health check, and POST with an image
(base64 image or public url) plus a userPrompt
to get an AI answer. Pass messages to keep multi-turn context.
Health check — confirms the service is up and returns basic status JSON.
Send an image and a question. The AI analyzes the image and returns a natural language response. Supports OCR, object detection, text extraction, and multi-turn conversations.
| Field | Type | Status | Description |
|---|---|---|---|
| userPrompt | string | required | The question or instruction about the image |
| image | string | optional | Base64 data URL — data:image/jpeg;base64,... (use this or url) |
| url | string | optional | Public image URL (use this or image) |
| messages | array | optional | Previous turns for multi-turn chat. Each item: { type: "user"|"ai", content: "..." } |
{ "success": true, "response": "The image shows a golden retriever..." }
// File input → base64 data URL
function fileToBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve(reader.result);
reader.onerror = reject;
reader.readAsDataURL(file);
});
}
// Usage
const file = document.querySelector('input[type=file]').files[0];
const dataUrl = await fileToBase64(file);
// dataUrl === "data:image/jpeg;base64,/9j/4AAQ..."
image (a data:image/... base64 data URL) or url (a public image link).messages history on every request, in order.