Endpoints
Image Description Tool
Generate detailed descriptions, captions, and alt text for images using AI
Image Description
Automatically generate detailed descriptions, captions, and alt text for your images using CoreViz's advanced vision models. This API endpoint uses AI to analyze images and produce human-readable descriptions.
Interactive Demo
Try it out ↓
Endpoint
POST /api/ai/describeHeaders
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
x-api-key | Your API key | Yes |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
image | string | Yes | URL of the image to describe |
Example Request
curl -X POST https://lab.coreviz.io/api/ai/describe \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"image": "https://example.com/input.jpg"
}'Response
Status Code: 200 OK
Response Body:
{
"description": "A detailed description of the image content...",
}Response Fields
| Field | Type | Description |
|---|---|---|
description | string | Detailed, comprehensive description of the image content |
Error Responses
401 Unauthorized
Invalid or missing API key:
{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}400 Bad Request
Invalid request parameters:
{
"error": "Bad Request",
"message": "Invalid image URL or missing required fields"
}422 Unprocessable Entity
Image could not be processed:
{
"error": "Unprocessable Entity",
"message": "Unable to process the provided image"
}Example Usage
JavaScript/TypeScript
const apiKey = 'YOUR_API_KEY';
const imageUrl = 'https://example.com/input.jpg';
const response = await fetch('https://lab.coreviz.io/api/ai/describe', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey,
},
body: JSON.stringify({
image: imageUrl,
}),
});
const data = await response.json();
console.log('Description:', data.description);Python
import requests
api_key = 'YOUR_API_KEY'
image_url = 'https://example.com/input.jpg'
response = requests.post(
'https://lab.coreviz.io/api/ai/describe',
headers={
'Content-Type': 'application/json',
'x-api-key': api_key,
},
json={
'image': image_url,
}
)
data = response.json()
print('Description:', data['description'])Node.js
const fetch = require('node-fetch');
const apiKey = 'YOUR_API_KEY';
const imageUrl = 'https://example.com/input.jpg';
fetch('https://lab.coreviz.io/api/ai/describe', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey,
},
body: JSON.stringify({
image: imageUrl,
}),
})
.then((res) => res.json())
.then((data) => {
console.log('Description:', data.description);
});Use Cases
Accessibility
Generate alt text for images to improve website accessibility and SEO:
// Generate alt text for an image
const result = await describeImage(imageUrl);
document.querySelector('img').alt = result.altText;Content Management
Automatically create descriptions and captions for uploaded images:
// When a user uploads an image
const uploadResult = await uploadImage(file);
const description = await describeImage(uploadResult.url);
// Save description to your database
await saveImageMetadata(uploadResult.id, description);Social Media
Generate captions for social media posts:
const result = await describeImage(imageUrl);
// Use the caption for Instagram, Twitter, etc.
postToSocialMedia(imageUrl, result.description);Supported Image Formats
The API supports common image formats:
- JPEG (.jpg, .jpeg)
- PNG (.png)
- WebP (.webp)
- GIF (.gif)
Image URL Requirements
- The image URL must be publicly accessible
- HTTPS URLs are recommended
- The image must be a valid image file
- Maximum file size limits may apply (check your plan)
Notes
- The API uses advanced vision models to analyze image content
- Descriptions are generated in natural language
- Processing time varies based on image complexity
- Results are optimized for different use cases (detailed descriptions, captions, alt text)
- The same image may produce slightly different descriptions on subsequent requests due to AI model variations
Learn More
- Try the Image Description Tool to test the API interactively
- Explore other Vision SDK Tools for additional AI capabilities
- Check out CoreViz Studio for bulk processing of thousands of images