🖼️✨
Chat with any image

Upload a photo and ask questions about it. The AI will describe, analyze, and explain anything in your image.

1
Upload an image from the sidebar or below
2
Type any question about the image
3
Continue the conversation with follow-ups
image.jpg
Base URL

Single endpoint. CORS enabled for all origins. No authentication required.

Overview
The VisionChat API exposes a single endpoint: /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.
Endpoints
GET/api/imgchat

Health check — confirms the service is up and returns basic status JSON.

Try it — click Open to see the live response
Open
POST/api/imgchat

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.

FieldTypeStatusDescription
userPromptstringrequiredThe question or instruction about the image
imagestringoptionalBase64 data URL — data:image/jpeg;base64,... (use this or url)
urlstringoptionalPublic image URL (use this or image)
messagesarrayoptionalPrevious turns for multi-turn chat. Each item: { type: "user"|"ai", content: "..." }
Full request URL
CURL — image URL

          
JAVASCRIPT

          
RESPONSE
{ "success": true, "response": "The image shows a golden retriever..." }
Multi-turn example
JAVASCRIPT

      
Image encoding helper
JAVASCRIPT
// 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..."
Error codes
400
Missing image/url or userPrompt, or invalid image format
413
Image too large for the AI service
429
Rate limited — wait and retry
502
Upstream AI service error
405
Method not allowed — use GET or POST only
Notes
• Provide either image (a data:image/... base64 data URL) or url (a public image link).
• Supported types: JPEG, PNG, WEBP, GIF.
• Max recommended image size: ~10MB before encoding.
• For multi-turn chat, pass the full messages history on every request, in order.