AI API - Words for what a picture shows (image_clip)

AI API: Vectors, Images & LLM

Turns a picture into words by what it shows: a list of labels with their scores, and one text to search with. It does not read the text printed in the picture.

Endpointhttps://api.opensolr.com/solr_manager/api/image_clip
MethodPOST: multipart, form fields or a JSON body
Authemail and api_key of your account, as GET or POST parameters: Authentication.

01 · Parameters

index_nameRequired

Your index. Its owner's AI allowance is used.

imageOne of the two

One picture: a multipart file, or its base64 (a data: prefix is fine). At most 20 MB.

imagesOne of the two

Up to 10 pictures, as a JSON array of base64 strings.

top_kOptional

How many labels, 1 to 50. Default 15.

02 · Example

curl -s -X POST "https://api.opensolr.com/solr_manager/api/image_clip" \
  -F "email=YOUR_EMAIL" -F "api_key=YOUR_API_KEY" -F "index_name=my_index" \
  -F "top_k=5" -F "image=@photo.jpg"

03 · Answer

{
    "status": true,
    "text": "red bicycle, street, city",
    "labels": [
        {
            "label": "red bicycle",
            "score": 0.31
        },
        {
            "label": "street",
            "score": 0.22
        }
    ],
    "model": "..."
}

With images: {"status": true, "results": [...], "charged": N}, one answer like the one above per picture, in the same order. A bad picture fails alone, with its own msg. Values shown are an example.

Only pictures the model reads count against the AI allowance; a picture read before costs nothing. Every plan includes a monthly allowance of AI requests: API Quota, Pricing. The allowance used is the one of the account that owns the index.

04 · Errors

INVALID_IMAGEHTTP 400

No picture, or not clean base64.

UPLOAD_FAILEDHTTP 400

The multipart upload did not arrive whole.

IMAGE_TOO_LARGE_MAX_20_MBHTTP 413

The picture is larger than 20 MB.

UNSUPPORTED_IMAGE_TYPE_...HTTP 415

Not a JPEG, PNG, WebP, GIF, BMP, TIFF, JPEG 2000, HEIC, HEIF or AVIF picture. The type is read from the bytes, not from the name.

IMAGES_MUST_BE_A_NON_EMPTY_ARRAYHTTP 400

images is empty or not a list.

MAX_10_IMAGES_PER_CALLHTTP 400

More than 10 pictures.

ERROR_NOT_CORE_OWNERHTTP 404

The index is not yours.

VECTOR_NOT_ALLOWEDHTTP 403

AI is switched off on the plan of the index owner.

ERROR_AI_MONTHLY_QUOTA_EXCEEDEDHTTP 429

The monthly AI allowance is used up.

IMAGE_CLIP_FAILEDHTTP 200

The picture could not be read. Retry.

WRONG_API_HOSTHTTP 404

Called on opensolr.com.

ERROR_AUTHENTICATION_FAILEDHTTP 403

The email and API key do not match.

05 · Related

Words and their vector in one call: image_index. Words plus the text in the picture: image_to_text.

Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.