multipart/form-data, and interpreting the results.
Object detection performs segmentation only - it does not classify whether the image is AI-generated. To detect AI-generated content, see the AI Image Detection guide.
Get started
1
Before you begin
Before you start, ensure you have the following:- An active Copyleaks account. If you don’t have one, sign up for free.
- You can find your API key on the API Dashboard.
2
Login
To perform a scan, we first need to generate an access token. For that, we will use the login endpoint. The API key can be found on the Copyleaks API Dashboard.Upon successful authentication, you will receive a token that must be attached to subsequent API calls via theAuthorization: Bearer <TOKEN> header.
This token remains valid for 48 hours.Response
Save this token. It is valid for 48 hours and can be reused for subsequent API calls.
3
Submit for analysis
Use the Object Detection Endpoint to send an image for analysis. We suggest you provide a uniquescanId for each submission.Provide the objects to locate in the objectDetection field as a JSON-encoded array of objects, for example [{"object":"face"},{"object":"hand"}].Image Requirements
- Size: Minimum 512x512px, maximum 6000x4500px (27 megapixels)
- File size: Less than 32MB
- Formats: PNG, JPG, JPEG, BMP, WebP, HEIC/HEIF
Object Detection Requirements
- At least one entry, maximum 3 entries.
- Each entry’s
objectvalue must be a non-empty string of at most 32 characters.
4
Interpreting the response
The API response contains:imageInfowith the image dimensions, used to decode the masks.detectedObjects- one entry per object located in the image, each with anobjectname and a Run-Length Encoded (RLE)mask.scannedImagewith scan details including credits used.
detectedObjects, so look entries up by object rather than by position.Understanding the RLE Mask
Run-Length Encoding (RLE) represents each object’s region efficiently as arrays ofstarts positions and lengths over a flattened 1D version of the image. Decode it into a binary mask to visualize the object’s region:Python
5
Summary
You have successfully submitted an image for object detection. You can now use the per-object masks in your application, for example to crop, blur, or highlight the detected regions.Frequently asked questions
Is the Object Detection API synchronous?
Is the Object Detection API synchronous?
Yes. You send the image to the check endpoint and receive the results in the same API call, with no webhook required.
How many objects can I request?
How many objects can I request?
Between 1 and 3 objects per request. Each object’s name must be a non-empty string of at most 32 characters.
Does it tell me if the image is AI-generated?
Does it tell me if the image is AI-generated?
No. Object detection performs segmentation only. Use the AI Image Detection API to detect AI-generated content.
What happens if an object is not found?
What happens if an object is not found?
Objects that are not found are omitted from the
detectedObjects array. Look entries up by their object name rather than by position.Next steps
API Reference
Explore the full API reference for the Object Detection endpoint.
Object Detection Response
Explore the full response structure for Object Detection.

