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
Name | Type | Required | Max | Description |
---|---|---|---|---|
image | file | Yes | - | The image file to upload and process |
Response
Name | Type | Description |
---|---|---|
data | object | The response data object |
data.file | string | The key to access the processed image file from cache |
metadata | object | Metadata about the request |
metadata.cost | number | The cost of the request |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | Occurs when no image file is found in the request. |
400 | FILE_TOO_LARGE | The uploaded file exceeds the maximum size limit of 5MB. |
400 | UTILS_UPLOAD_IMAGE_ERROR | An error occurred while processing the image. |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
401 | UNAUTHORIZED | The token is invalid. |
429 | TOO_MANY_REQUESTS | The request limit has been reached. |