Documentation
Login to create your API key
Updates
30.12.2024: Added link to beta version of API documentation
27.12.2024: Added Face Swap Videos API
10.12.2024: Added version field to FaceSwap API
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.ai/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.ai/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.ai/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"}
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.ai/api/v1/face_swaps \
-H "Authorization: Bearer <your_api_key>" \
-H "Content-Type: application/json" \
-d '{"image": "<base64_encoded_image>", "face": "<base64_encoded_face>", "version": "v1"}'
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.ai/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"}
Face Swap Videos API
Payment Requirement: Face swap videos API is only available to users who have completed payments of $100 or more.
HTTP status code: 402
{"error": "PAYMENT_REQUIRED", "message": "Face swap video API requires a completed payment of $100 or more"}
Analyze Video
Calculate the price for processing a video based on its duration
Example request:
curl -X POST https://nodress.ai/api/v1/face_swap_videos/analyze \
-H "Authorization: Bearer <your_api_key>" \
-H "Content-Type: application/json" \
-d '{"video_url": "https://example.com/video.mp4", "preview": false, "version": "v2"}'
The API returns a JSON object with the price calculation or error message. Example responses:
HTTP status code: 200
{"price": 4.0, "duration": 20 }
HTTP status code: 400
{"error": "INVALID_VIDEO_URL", "details": ["must be a valid URL", "must use HTTPS"]}
Create Face Swap Video
Create a new face swap video job using URL
Example request with URLs:
curl -X POST https://nodress.ai/api/v1/face_swap_videos \
-H "Authorization: Bearer <your_api_key>" \
-H "Content-Type: application/json" \
-d '{"video_url": "https://example.com/video.mp4", "face_url": "https://example.com/face.jpg", "preview": false, "version": "v2"}'
The API returns a JSON object with the job details or error message. Example responses:
HTTP status code: 201
{"id": "69d280ab-42c5-4f49-9881-51076afb1747", "status": "created", "message": "Face swap video creation started"}
HTTP status code: 400
{"error": "VALIDATION_ERROR", "details": ["Video is required"]}
Get Face Swap Video Status
Check the status of a face swap video job and get the result URL when completed
Example request:
curl https://nodress.ai/api/v1/face_swap_videos/<identifier> \
-H "Authorization: Bearer <your_api_key>" \
-H "Content-Type: application/json"
The API returns a JSON object with the current status and details. Example responses:
HTTP status code: 200 (Processing)
{
"id": "69d280ab-42c5-4f49-9881-51076afb1747",
"status": "processing",
"progress": 45.5,
"step": "working",
"result_url": null,
"error_details": null
}
HTTP status code: 200 (Completed)
{
"id": "69d280ab-42c5-4f49-9881-51076afb1747",
"status": "completed",
"progress": 100.0,
"step": "uploading",
"result_url": "https://assets.nodress.ai/videos/result.mp4",
"error_details": null
}
HTTP status code: 404
{"error": "NOT_FOUND"}