Documentation

AI Image Description API

Describe image content using AI technology

The AI Image Description API allows you to use advanced AI technology to describe image content. This endpoint processes images and returns detailed text descriptions. Experience the powerful AI image description feature of AI Describe Picture.

Endpoint

POST /api/api-call/describe-picture

Authentication

Requires a valid API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Request

Headers

HeaderRequiredDescription
Content-TypeYesMust be application/json
AuthorizationYesYour API key in format Bearer YOUR_API_KEY

Body Parameters

ParameterTypeRequiredDescription
imageUrlstringYesURL of the image to describe (must be publicly accessible)
promptstringNoCustom prompt (optional)

Request Example

{
  "imageUrl": "https://example.com/image.jpg",
  "prompt": "Describe all elements, colors, and composition in this image in detail"
}

Response

Success Response (200)

API returns a JSON object containing image descriptions with a choices array.

{
  "choices": [
    {
      "logprobs": null,
      "finish_reason": "stop",
      "native_finish_reason": "STOP",
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The image depicts a close-up of a red fox facing the camera. The fox has fluffy orange and white fur, with erect ears and bright brown eyes. The background is blurred, possibly in a snowy field or bright environment.",
        "refusal": null,
        "reasoning": null
      }
    }
  ]
}

Description:

  • choices array contains AI-generated description content, each choice contains a complete message object
  • message.content field contains the actual image description text
  • Response format is compatible with OpenAI API

Error Responses

400 Bad Request

{
  "message": "Invalid input"
}

401 Unauthorized

{
  "message": "Invalid or expired API key"
}

402 Payment Required

{
  "message": "Insufficient credits"
}

500 Internal Server Error

{
  "message": "Service error"
}

Usage Limits

  • Credit consumption: 1 credit per description
  • Image requirements: Supports JPG, PNG, WebP formats, maximum 5MB

Usage Examples

JavaScript/Node.js

async function describeImage(imageUrl, apiKey, prompt = null) {
  try {
    const response = await fetch('https://aidescribepicture.com/api/api-call/describe-picture', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${apiKey}`
      },
      body: JSON.stringify({
        imageUrl: imageUrl,
        prompt: prompt
      })
    });
 
    if (!response.ok) {
      const error = await response.text();
      throw new Error(`API Error: ${response.status} - ${error}`);
    }
 
    const result = await response.json();
    
    // Extract description content
    const description = result.choices[0].message.content;
    return description;
  } catch (error) {
    console.error('Error describing image:', error);
    throw error;
  }
}
 
// Usage example
const description = await describeImage(
  'https://example.com/image.jpg',
  'your-api-key-here',
  'Describe this image in detail'
);
console.log('Image description:', description);

cURL

curl -X POST https://aidescribepicture.com/api/api-call/describe-picture \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "imageUrl": "https://example.com/image.jpg",
    "prompt": "Describe all elements, colors, and composition in this image in detail"
  }'

Image Requirements

  • Format: JPG, PNG, WebP
  • Size: Maximum 5MB
  • Accessibility: Image URL must be publicly accessible
  • Content: Must be a valid image file

Processing Time

  • Typical: 10-30 seconds
  • Large images: May take up to 60 seconds

Credits

  • Cost: 1 credit per description
  • Deduction: Credits are deducted upon successful processing

Best Practices

  1. Image quality: Use high-quality images for better results
  2. Error handling: Always implement proper error handling
  3. Credit management: Monitor your credit balance regularly
  4. Prompts: Use specific prompts for more precise descriptions

Troubleshooting

Common Issues

401 Unauthorized

  • Check that your API key is correct
  • Ensure the API key is active and not expired

402 Payment Required

  • Add credits to your account
  • Check your current credit balance

400 Bad Request

  • Verify the imageUrl is a valid, accessible URL
  • Ensure the image format is supported

500 Internal Server Error

  • Server internal error, please try again later
  • Check if the image URL is accessible

Support

If you encounter issues not covered here, please contact our support team.