POST
/
api
/
ai
/
images
/
v2
/
image-analysis
curl --request POST \
  --url https://api.worqhat.com/api/ai/images/v2/image-analysis \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multi-part/form-data' \
  --data '{
  "images": [
    "/path/to/image.jpg",
    "/path/to/image.jpg"
  ],
  "output_type": "text",
  "question": "What is the name of the person in the image?",
  "training_data": "You are a support for a Blind person. Please describe the image in detail.",
  "stream_data": false
}'
{
  "code": 200,
  "status": "success",
  "data": {
    "analysed_data": [
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ]
    ],
    "quality": {
      "brightness": 74.43968200683594,
      "contrast": 85.29368591308594,
      "sharpness": 44.84498977661133
    },
    "foreground": {
      "dominant_colors": [
        "Array"
      ],
      "quality": [
        "Object"
      ]
    },
    "background": {
      "dominant_colors": [
        "Array"
      ],
      "quality": [
        "Object"
      ]
    },
    "primary_colours": [
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ],
      [
        "Object"
      ]
    ]
  },
  "processing_time": 3193,
  "processing_id": "9a7cc5d3-735a-4299-8d84-1fbaab309ba4",
  "processing_count": 1
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multi-part/form-data
images
string[]

The images to be sent as input. You can pass a maximum of 10 images.

output_type
enum<string>

The type of output to be generated. You can choose between json and text. json will return the text detection results as a JSON object with the scan words marked and positional information. text will return the text detection results as a plain text string with a proper description of the image and what it contains.

Available options:
json,
text
question
string

The question to be answered by the AI or any specific command you would like the Model to take into consideration while analysing the image. This is an optional parameter. If not provided, the AI will only send a description of the image and what it contains.

training_data
string

The training data to be used for the AI. This is an optional parameter. If not provided, the AI will use the default training data. It is only applicable for Image Analysis process with Text as output_type.

stream_data
boolean
default: false

Whether to stream the data as it is being generated. If set to true, the response will be streamed as the data is being generated. This is useful when you want to generate a lot of content and want to save the data as it is being generated. You need to handle Server Sent Events for this use case.

Response

200 - application/json
code
integer

The HTTP status code.

status
string

Status indicating the success of the response.

data
object

The response data.

processing_time
integer

The time taken to process the request, in milliseconds.

processing_id
string

A universally unique identifier for the request. This can be used to track the request in the logs.

processing_count
integer

The number of times the request has been processed.