Analyze an image and return a caption, image metadata, and scores for the requested features (see the features enum).

Requires an Enterprise plan: requests authenticated with a non-Enterprise API key receive a 403 with a link to contact our sales team.

post/v2/visual-qa

Request

  • Base URL
    https://image-api.photoroom.com
  • URL
    https://image-api.photoroom.com/v2/visual-qa
  • Auth
    API key in header x-api-key

Request body multipart/form-data

imageFilestring binary

Image to analyze, as a binary file. Provide exactly one of imageFile or imageUrl.

imageUrlstring uri

URL of the image to analyze. Provide exactly one of imageFile or imageUrl.

referenceImageFilestring binary

Reference image (binary) to compare against, required when features includes fashionFidelity or foodFidelity. Provide exactly one of referenceImageFile or referenceImageUrl.

referenceImageUrlstring uri

URL of the reference image to compare against, required when features includes fashionFidelity or foodFidelity. Provide exactly one of referenceImageFile or referenceImageUrl.

featuresstring[]

Features to run, as an array or a comma-separated string (e.g. "aiGenerated,text"). If omitted, you still receive the caption and metadata.

clothingItemDetectionboolean

Detect distinct clothing/footwear/accessory items in the image.

Example request

{
  "imageUrl": "https://example.com/image.jpg",
  "referenceImageUrl": "https://example.com/reference.jpg",
  "features": [
    "aiGenerated",
    "text"
  ]
}

Response

OK

captionstring

A generated caption describing the image. Omitted if no caption could be produced.

Example response

{
  "caption": "Three gold rings with blue stones on a marble surface."
}

Changes