🍌 🍑 đŸ”Ĩ 🔞 🍌 🍑 đŸ”Ĩ 🍌 🔞 🍑 đŸ”Ĩ 🍌 🍑 🔞 đŸ”Ĩ 🍌 🍑 đŸ”Ĩ

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.

â„šī¸
Base URL: https://nudify-app.com/api/v1
All endpoints accept and return JSON.

How it works

  1. Send a generation request with your image and/or prompt
  2. Receive a generation ID immediately
  3. Poll the status endpoint every 2-3 seconds
  4. 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.

Header
Authorization: Bearer YOUR_API_KEY

You receive your API key after purchasing API credits. It is visible on your Profile page.

⚠️
Keep your API key secret. Do not expose it in client-side code, public repositories, or share it. Rotate it from your profile if compromised.

Generate Image

POST /api/v1/generate

Submit a new image generation request. Costs 1 API credit per call.

Request Body

ParameterTypeDescription
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
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
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
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

JSON — 200 OK
{
  "generation_id": 42,
  "api_id": "a1b2c3d4e5f6",
  "status": "queued"
}

Check Status

GET /api/v1/status/{api_id}

Poll the status of a generation. Call every 2-3 seconds until completed or failed.

Path Parameters

ParameterTypeDescription
api_id string required The api_id returned from the generate endpoint

Example

cURL
curl https://nudify-app.com/api/v1/status/a1b2c3d4e5f6 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response — Processing

JSON — 200
{
  "status": "processing",
  "output_url": null,
  "error_message": null
}

Response — Completed

JSON — 200
{
  "status": "completed",
  "output_url": "/uploads/generations/12/output_8f3a9b2c.png",
  "error_message": null
}
â„šī¸
The output_url is a relative path. Prepend the base URL to download: https://nudify-app.com{output_url}

Status Values

queued Request received, waiting for processing
processing AI is generating the image
completed Done — output_url is available
failed Error — see error_message

Generation History

GET /api/v1/generations

Retrieve your past generations, most recent first.

Query Parameters

ParameterTypeDescription
limit integer optional Number of results (1-50, default: 20)
offset integer optional Pagination offset (default: 0)

Example

cURL
curl https://nudify-app.com/api/v1/generations?limit=5 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

JSON — 200
{
  "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

GET /api/v1/balance

Check your remaining API credits.

Example

cURL
curl https://nudify-app.com/api/v1/balance \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

JSON — 200
{
  "api_credits": 2847
}

Available Styles

Use these slugs in the styles array (img2img) or style field (txt2img). You can combine multiple styles for img2img.

Little breast Medium breast Big breast Hairy 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:

Generated Prompt
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 Response
{
  "error": "No credits remaining. Please subscribe."
}

HTTP Status Codes

200 Success
400 Bad request — missing or invalid parameters
401 Unauthorized — invalid or missing API key
403 Forbidden — no credits or feature not available
404 Not found — generation ID does not exist
429 Rate limited — too many requests, retry after delay
500 Server error — try again later

Rate Limits

To ensure fair usage, the API enforces the following limits:

EndpointLimitWindow
POST /generate10 requests60 seconds
GET /statusNo limit—
GET /generationsNo limit—
GET /balanceNo limit—

When rate limited, you receive a 429 response with a retry_after field (seconds).

Full Examples

Python

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)

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
<?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;
    }
}