Watermark & AIGC Labeling

Add Image Watermark

0calls
5 credits / call

Want to brand your original images without spoiling how they look, or trace AIGC-generated images later on? This endpoint quietly tucks a marker of your choosing inside the image.

POST
uapis.cn
/api/v1/watermark/embed
Body
file
file

The image file to watermark. PNG, JPEG, and WebP are supported.

Drag a file here, orclick to upload

The image file to watermark. PNG, JPEG, and WebP are supported.

url
string

An image link that's publicly reachable.

image_base64
string

The image as Base64; the data: prefix is optional.

payload
string
required

The marker to write into the image; what goes in is up to you.

out_format
string

Output image format. Leave empty to match the input.

jpeg_quality
integer

Image quality for JPEG output, 1 to 100.

ecc
string
Error-correction level. It sets how much damage the watermark can survive and how many characters fit: stronger correction survives compression and cropping better but fits fewer characters. Defaults to `BCH_4`.
model_type
string
Watermark profile that trades robustness against image quality. Defaults to `B`.
strength
number

Watermark strength, defaults to 1.0. Higher survives compression and reposting better but is more likely to be visible; lower is more discreet but less robust.

Overview

You upload an image and give it a marker, and the endpoint embeds that text invisibly into the image's pixels. The result looks no different to the eye, yet it holds up against common resizing, cropping, social-platform compression, and re-forwarding. It's a good fit for marking where an image came from, tracking distribution channels, or quietly asserting copyright.

Notes

Capacity: by the nature of invisible watermarking, only a limited number of characters fit in an image (usually a short code). Store just a short provenance ID or signature, and keep the full mapping in your own database.

Parameters: provide the image one of three ways (file / url / image_base64); unless you have a specific need, leave the other advanced parameters empty to use the best-practice defaults.

Request body

Image source and watermark content. Both multipart/form-data and application/json are supported.

file
fileoptional

The image file to watermark. PNG, JPEG, and WebP are supported.

url
stringoptional

An image link that's publicly reachable.

image_base64
stringoptional

The image as Base64; the data: prefix is optional.

payload
stringrequired

The marker to write into the image; what goes in is up to you.

out_format
stringoptional

Output image format. Leave empty to match the input.

jpeg_quality
integeroptional

Image quality for JPEG output, 1 to 100.

ecc
stringoptional
Error-correction level. It sets how much damage the watermark can survive and how many characters fit: stronger correction survives compression and cropping better but fits fewer characters. Defaults to `BCH_4`.
model_type
stringoptional
Watermark profile that trades robustness against image quality. Defaults to `B`.
strength
numberoptional

Watermark strength, defaults to 1.0. Higher survives compression and reposting better but is more likely to be visible; lower is more discreet but less robust.

Response

200 / OK

Embedded successfully; returns the watermarked image (Base64).

JSON
{
  // Base64-encoded watermarked image.
  "image_base64": "string",
  // Image file name (present only if provided on input).
  "image_name": "string",
  // Output image format.
  "format": "png",
  // The marker actually embedded, matching the request.
  "payload": "a1B2c3D",
  // Maximum marker length embeddable under the current settings.
  "capacity_chars": 7,
  // Embed time, in milliseconds.
  "embed_ms": 118.4
}

400 / Bad Request

Bad request, e.g. missing image source or missing payload.

JSON
{
  "code": "INVALID_PARAMETER",
  "message": "an image source is required"
}

413 /

Image too large, exceeding the server limit.

JSON
{
  "code": "FILE_TOO_LARGE",
  "message": "the uploaded image is too large"
}

503 / Service Unavailable

The watermark service is temporarily unavailable.

JSON
{
  "code": "SERVICE_TEMPORARILY_UNAVAILABLE",
  "message": "the watermark service is temporarily unavailable"
}