Skip to main content
POST
/
base64_crop
Upload base64 image and crop
curl --request POST \
  --url https://modelslab.com/api/v3/base64_crop \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "<string>",
  "image": "<string>",
  "crop": "true"
}
'
{
  "status": "success",
  "messege": "image uploaded",
  "link": "<string>",
  "request_id": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.modelslab.com/llms.txt

Use this file to discover all available pages before exploring further.

Note that the maximum file size for upload is 5MB. and Make sure you are passing the image in base64 format.

Request

Send a POST request to below endpoint.
curl
--request POST 'https://modelslab.com/api/v3/base64_crop' \

Body

json
{  
    "key": "your_api_key",  
    "image": "data:image/png;base64,your_base_64_string",  
    "crop": "true"
}

Body

application/json
key
string
required

Your API Key used for request authorization

image
string
required

Image to be uploaded converted in base64 format

crop
enum<string>
default:true
required

A (true/false) flag for cropping the image upon uploading

Available options:
true,
false

Response

Base64 crop response

status
enum<string>
Available options:
success
messege
string
Example:

"image uploaded"

URL of the uploaded image

request_id
integer

Request ID for the uploaded image