Documentation

Login to create your API key

Updates

25.10.2024: Added FaceSwap API
18.10.2024: Added premium v2 style
21.09.2024: Added link to OpenAPI specification
21.09.2024: Added information about the new automatic mask generation feature
16.09.2024: Added link to pricing page
11.05.2024: Added curl usage example.
10.05.2024: Updated API documentation to be in sync with the current version of the API.

Authorization

To authorize your requests, you need to pass your API key in the header of your request.

Authorization: Bearer <your_api_key>

Undress API

Create Undress

Accepts the source image, the image mask and one of the styles (standard, premium, BDSM, nurse, etc.)

Source image should be base64 encoded image in jpeg format, mask should be base64 encoded image in png format. Mask should contain 2 colors: white for regions which should be undressed and black for rest of the image.

Available styles: standard, premium, premium_v2, nurse, bdsm, underwear_white, underwear_black, underwear_pink

Example request:

curl -X POST https://nodress.io/api/v1/undress \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{"source_image": "<base64_encoded_image>", "mask": "<base64_encoded_mask>", "style": "standard"}'

Example request with automatic mask generation:

curl -X POST https://nodress.io/api/v1/undress \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{"source_image": "<base64_encoded_image>", "automask": true, "style": "standard"}'

The API returns a JSON object with the identifier of the job or error message. Example responses:

HTTP status code: 201

{"id": "69d280ab-42c5-4f49-9881-51076afb1747"}

HTTP status code: 400

{"error": "no_credits"}

HTTP status code: 400

{"error": "invalid_params", "errors": ["Image is invalid"]}

Get Undress Result

Accepts the identifier of the job and returns the generated image and the generated mask or the generation status.

Example request:

curl https://nodress.io/api/v1/undress/<identifier> \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json"

The API returns a JSON object with the generated image or the generation status. Example responses:

HTTP status code: 200

{"status": "completed", "image": "<result image url>"}

HTTP status code: 200

{"status": "pending"}

HTTP status code: 200

{"status": "failed"}

HTTP status code: 404

{"error": "NOT_FOUND"}

curl usage example

Example of interaction with the API using curl:

SOURCE_IMAGE=$(cat img.jpeg | base64)
MASK=$(cat mask.png | base64)
curl -X POST https://nodress.io/api/v1/undress \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{"source_image": "'$SOURCE_IMAGE'", "mask":"'$MASK'", "style": "standard"}'

To check status and fetch final image

curl https://nodress.io/api/v1/undress/<id_from_response> \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json"
# {"status":"pending"}
# {"status":"completed", "image": "<result image url>"}

FaceSwap API

Create FaceSwap

Accepts the face image and the image

Face and target images should be base64 encoded images in jpeg, webp, or png format

Example request:

curl -X POST https://nodress.io/api/v1/face_swaps \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{"image": "<base64_encoded_image>", "face": "<base64_encoded_face>"}'

The API returns a JSON object with the identifier of the job or error message. Example responses:

HTTP status code: 201

{"id": "69d280ab-42c5-4f49-9881-51076afb1747"}

HTTP status code: 400

{"error": "no_credits"}

HTTP status code: 400

{"error": "invalid_params", "errors": ["Image is invalid"]}

Get FaceSwap Result

Accepts the identifier of the job and returns the generated image or the generation status.

Example request:

curl https://nodress.io/api/v1/face_swaps/<identifier> \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json"

The API returns a JSON object with the generated image or the generation status. Example responses:

HTTP status code: 200

{"status": "completed", "image": "<result image url>"}

HTTP status code: 200

{"status": "pending"}

HTTP status code: 200

{"status": "failed"}

HTTP status code: 404

{"error": "NOT_FOUND"}

curl usage example

Example of interaction with the API using curl:

IMAGE=$(cat img.jpeg | base64)
FACE=$(cat face.png | base64)
curl -X POST https://nodress.io/api/v1/face_swaps \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{"image": "'$IMAGE'", "face":"'$FACE'"}'

To check status and fetch final image

curl https://nodress.io/api/v1/face_swaps/<id_from_response> \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json"
# {"status":"pending"}
# {"status":"completed", "image": "<result image url>"}

Need a face swap API for videos?

Drop us a line at [email protected] to get started.