API Documentation
Integrate image generation into your applications with our RESTful API.
Overview
The Nudify API lets you generate AI-transformed images programmatically. You can perform image-to-image transformations with preset styles or custom prompts, and generate images from text descriptions.
https://nudify-app.com/api/v1All endpoints accept and return JSON.
How it works
- Send a generation request with your image and/or prompt
- Receive a generation ID immediately
- Poll the status endpoint every 2-3 seconds
- When status is
completed, download your result image
Pricing
Each generation costs $0.04 (1 API credit). Purchase credits from the Pricing page. Volume discount: -10% above 3,000 credits.
Authentication
All requests require an API key sent via the Authorization header using the Bearer scheme.
Authorization: Bearer YOUR_API_KEY
You receive your API key after purchasing API credits. It is visible on your Profile page.
Generate Image
Submit a new image generation request. Costs 1 API credit per call.
Request Body
| Parameter | Type | Description | |
|---|---|---|---|
type |
string | required | Generation type: img2img, img2img_custom, or txt2img |
image_base64 |
string | required* | Base64-encoded source image (required for img2img and img2img_custom) |
prompt |
string | required* | Free-text prompt (required for img2img_custom and txt2img) |
styles |
string[] | required* | Array of style slugs (required for img2img). Can combine multiple. See Available Styles. |
style |
string | optional | Single style slug to append (for txt2img only) |
is_public |
boolean | optional | If true, the result is visible in the Discover feed. Default: false |
Example Request â img2img
curl -X POST https://nudify-app.com/api/v1/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "img2img", "image_base64": "/9j/4AAQSkZJRg...", "styles": ["anime", "cyberpunk"] }'
Example Request â img2img_custom
curl -X POST https://nudify-app.com/api/v1/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "img2img_custom", "image_base64": "/9j/4AAQSkZJRg...", "prompt": "Transform into a rainy night scene, neon reflections, cinematic mood" }'
Example Request â txt2img
curl -X POST https://nudify-app.com/api/v1/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "txt2img", "prompt": "A futuristic city skyline at sunset, neon lights, ultra detailed, 8k", "style": "cyberpunk" }'
Response
{
"generation_id": 42,
"api_id": "a1b2c3d4e5f6",
"status": "queued"
}
Check Status
Poll the status of a generation. Call every 2-3 seconds until completed or failed.
Path Parameters
| Parameter | Type | Description | |
|---|---|---|---|
api_id |
string | required | The api_id returned from the generate endpoint |
Example
curl https://nudify-app.com/api/v1/status/a1b2c3d4e5f6 \
-H "Authorization: Bearer YOUR_API_KEY"
Response â Processing
{
"status": "processing",
"output_url": null,
"error_message": null
}
Response â Completed
{
"status": "completed",
"output_url": "/uploads/generations/12/output_8f3a9b2c.png",
"error_message": null
}
output_url is a relative path. Prepend the base URL to download: https://nudify-app.com{output_url}Status Values
output_url is availableerror_messageGeneration History
Retrieve your past generations, most recent first.
Query Parameters
| Parameter | Type | Description | |
|---|---|---|---|
limit |
integer | optional | Number of results (1-50, default: 20) |
offset |
integer | optional | Pagination offset (default: 0) |
Example
curl https://nudify-app.com/api/v1/generations?limit=5 \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"items": [
{
"id": 42,
"api_id": "a1b2c3d4e5f6",
"type": "img2img",
"prompt": "Transform this photo into anime style...",
"status": "completed",
"is_public": false,
"input_url": "/uploads/generations/12/input_4e7f.png",
"output_url": "/uploads/generations/12/output_8f3a.png",
"created_at": "2026-04-01 14:32:10"
}
]
}
Credits & Balance
Check your remaining API credits.
Example
curl https://nudify-app.com/api/v1/balance \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"api_credits": 2847
}
Available Styles
Use these slugs in the styles array (img2img) or style field (txt2img). You can combine multiple styles for img2img.
undress
bikini
spread-pussy
Combining styles
When you pass multiple styles in the styles array, they are combined in the prompt with "and". For example, ["anime", "cyberpunk"] produces a prompt like:
Transform this photo into anime style and cyberpunk style, high quality, detailed
Error Handling
All errors return a JSON object with an error field.
{
"error": "No credits remaining. Please subscribe."
}
HTTP Status Codes
Rate Limits
To ensure fair usage, the API enforces the following limits:
| Endpoint | Limit | Window |
|---|---|---|
POST /generate | 10 requests | 60 seconds |
GET /status | No limit | â |
GET /generations | No limit | â |
GET /balance | No limit | â |
When rate limited, you receive a 429 response with a retry_after field (seconds).
Full Examples
Python
import requests, base64, time API_KEY = "YOUR_API_KEY" BASE = "https://nudify-app.com/api/v1" headers = {"Authorization": f"Bearer {API_KEY}"} # 1. Read image and encode to base64 with open("photo.jpg", "rb") as f: image_b64 = base64.b64encode(f.read()).decode() # 2. Submit generation resp = requests.post(f"{BASE}/generate", json={ "type": "img2img", "image_base64": image_b64, "styles": ["anime", "watercolor"] }, headers=headers) data = resp.json() api_id = data["api_id"] print(f"Queued: {api_id}") # 3. Poll until completed while True: time.sleep(3) status = requests.get(f"{BASE}/status/{api_id}", headers=headers).json() print(f"Status: {status['status']}") if status["status"] == "completed": img_url = f"https://nudify-app.com{status['output_url']}" print(f"Done! Download: {img_url}") # 4. Download result img_data = requests.get(img_url).content with open("result.png", "wb") as f: f.write(img_data) break elif status["status"] == "failed": print(f"Error: {status['error_message']}") break
JavaScript (Node.js)
const fs = require('fs'); const API_KEY = 'YOUR_API_KEY'; const BASE = 'https://nudify-app.com/api/v1'; const headers = { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }; async function generate() { // 1. Encode image const imageB64 = fs.readFileSync('photo.jpg').toString('base64'); // 2. Submit const res = await fetch(`${BASE}/generate`, { method: 'POST', headers, body: JSON.stringify({ type: 'txt2img', prompt: 'A magical forest with glowing mushrooms, fantasy art, detailed', style: 'fantasy' }) }); const { api_id } = await res.json(); console.log('Queued:', api_id); // 3. Poll while (true) { await new Promise(r => setTimeout(r, 3000)); const status = await fetch(`${BASE}/status/${api_id}`, { headers }) .then(r => r.json()); console.log('Status:', status.status); if (status.status === 'completed') { console.log('Result:', `https://nudify-app.com${status.output_url}`); break; } if (status.status === 'failed') { console.error('Failed:', status.error_message); break; } } } generate();
PHP
<?php $apiKey = 'YOUR_API_KEY'; $base = 'https://nudify-app.com/api/v1'; // 1. Encode image $imageB64 = base64_encode(file_get_contents('photo.jpg')); // 2. Submit generation $ch = curl_init("$base/generate"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer $apiKey", 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'type' => 'img2img_custom', 'image_base64' => $imageB64, 'prompt' => 'Make it look like a vintage oil painting', ]), ]); $result = json_decode(curl_exec($ch), true); curl_close($ch); $apiId = $result['api_id']; echo "Queued: $apiId\n"; // 3. Poll while (true) { sleep(3); $ch = curl_init("$base/status/$apiId"); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"], ]); $status = json_decode(curl_exec($ch), true); curl_close($ch); echo "Status: {$status['status']}\n"; if ($status['status'] === 'completed') { echo "Result: https://nudify-app.com{$status['output_url']}\n"; break; } if ($status['status'] === 'failed') { echo "Error: {$status['error_message']}\n"; break; } }