Rakesh Vision API
Image Description API Endpoint

This application provides an API endpoint for generating image descriptions using AI. Provide an image URL and get back a description. Access is protected by an API key.

API Endpoint:

POST /api/describe

Headers:

Content-Type: application/json
X-API-Key: <YOUR_SECRET_API_KEY>

Request Body (JSON):

{
  "photoUrl": "https://example.com/path/to/your/image.jpg"
}

Example Usage (cURL):

curl -X POST \
  [YOUR_API_URL]/api/describe \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_SECRET_KEY' \
  -d '{
    "photoUrl": "https://picsum.photos/seed/picsum/800/600"
  }'

Replace [YOUR_API_URL] with the actual base URL of your deployed application and $YOUR_SECRET_KEY with your assigned secret key.

Success Response (200 OK - JSON):

{
  "description": "A detailed description of the image..."
}

Error Responses (JSON):

// 400 Bad Request (Invalid Input)
{
  "error": "Invalid request body",
  "details": { /* Zod validation error details */ }
}

// 401 Unauthorized (Missing or Invalid API Key)
{
  "error": "Unauthorized"
}

// 500 Internal Server Error (Generic/AI Error)
{
  "error": "Error message detailing the issue"
}