Images

Endpoint: Upload Image

This endpoint allows developers to upload an image file. The endpoint performs various checks and operations on the uploaded image and returns the processed data.

Headers

The request should include the following header:

X-API-KEY: <Your API Key>

Request Method: POST

https://embed.axv.ai/api/image/upload

Request Body Parameters:

Parameter
Type
Description

file

File

The image file to be uploaded.

user_id

String

The ID of the user/organization associated with the image.

_id

String

Associated _id of file used to identify it.

Response:

The response returns JSON data with the following structure:

{
  "isSuccess": true,
  "data": {
    "file_url": "<file_url>",
    "extra_vision": [
      {
        "description": "<description_1>"
      },
      {
        "description": "<description_2>"
      },
      ...
    ]
  },
  "compute": "<remaining_compute>"
}
Field
Type
Description

isSuccess

Boolean

Indicates whether the request was successful or not.

data

Object

Contains the processed data of the uploaded image.

data.file_url

String

The URL/path of the uploaded file.

data.extra_vision

Array

An array of objects representing additional vision information about the image. Each object contains a "description" field.

compute

Number

The remaining compute value of the organization after processing the image.

Error Responses:

If an error occurs during the request, the response will contain an error message with the appropriate status code.

Status Code
Error Message
Description

400

{ "isSuccess": false, "msgError": "file is required" }

The file parameter is missing in the request.

404

{ "isSuccess": false, "message": "Organization not found" }

The organization associated with the user_id was not found.

403

{ "isSuccess": false, "message": "Insufficient compute available" }

The compute reduction exceeds the available compute.

Example Usage:

Last updated