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.
Send an image and a question. The AI analyzes the image and returns a natural language response. Supports multi-turn conversations by passing previous messages.
| Field | Type | Status | Description |
|---|---|---|---|
| image | string | required | Base64 data URL — data:image/jpeg;base64,... |
| userPrompt | string | required | The question or instruction about the 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..."
data:image/... base64 data URL — not a raw URL or blob URL.messages history on every request.messages array should contain all previous turns in order.
/api/imgchatjson/api/imgchatjsonSend an image + question, get an AI answer. Supports OCR, object detection, text extraction, multi-turn chat.
| Param | Type | Description | |
|---|---|---|---|
| userPrompt | string | required | Your question about the image. |
| image | string | optional | Base64 image data (use this OR url). |
| url | string | optional | Public image URL (use this OR image). |
| messages | array | optional | Prior turns for multi-turn chat. |
curl -X POST {ORIGIN}/api/imgchat \
-H "Content-Type: application/json" \
-d '{"url":"https://picsum.photos/400","userPrompt":"What is in this image?"}'fetch() in code.