Serverless Image Upload & Processing

Streamlined image upload service that automatically optimizes images. This API handles all optimization processes, including compression, resizing, and format conversion. Simply upload your original image and receive a fully optimized version ready for use in any image processing task.

Endpoint

This API is MULTIPART, you need to send the image file in the body of the request. Image expires in 24 hours.

POSThttps://api.xtartapp.com/utils/upload-image

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
imagefileYes-The image file to upload and process

Response

NameTypeDescription
dataobjectThe response data object
data.filestringThe key to access the processed image file from cache
metadataobjectMetadata about the request
metadata.costnumberThe cost of the request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when no image file is found in the request.
400FILE_TOO_LARGEThe uploaded file exceeds the maximum size limit of 5MB.
400UTILS_UPLOAD_IMAGE_ERRORAn error occurred while processing the image.
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDThe token is invalid.
429TOO_MANY_REQUESTSThe request limit has been reached.