NudifyAPI

Documentation

Getting started guide and reference for the NudifyAPI REST API.

Getting started

Follow these steps to process your first image: 1. Create an account at /register (or sign in). 2. Open the dashboard and copy your API key (starts with napi_). 3. Add credits from the pricing page — each image costs $0.10. 4. Host an input image at a public URL, then call POST /v1/process. Credits are only deducted after a successful generation. Failed requests do not charge your balance. Your dashboard "Total processed" count (totalUsage) increments once per successful image. We do not store results. The PNG is returned once as base64 in the JSON body — save it on your side or it is gone.

Quick start

curl -X POST https://nudifyapi.vercel.app/v1/process \
  -H "Authorization: Bearer napi_your_key" \
  -H "Content-Type: application/json" \
  -d '{"image_url": "https://example.com/photo.jpg"}'

Response

{
  "id": "req_a1b2c3d4e5f67890",
  "status": "completed",
  "content_type": "image/png",
  "result_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
  "credits_used": 1,
  "processing_time_ms": 18420
}

Introduction

NudifyAPI is a pay-per-image REST API for image editing. You send a publicly reachable image URL; we run a GPU img2img pipeline and return the PNG inline as base64. Base URL (this deployment): https://nudifyapi.vercel.app All v1 endpoints speak JSON. Authenticate with your dashboard API key. Results are ephemeral — we do not host or CDN your output files.

Authentication

Every processing request must include your API key as a Bearer token. Keys are created automatically on signup and can be rotated from the dashboard. Never expose your key in client-side browser code or public repos. Call the API from your backend.

Header

Authorization: Bearer napi_your_api_key_here

Credits & billing

Pricing is $0.10 per successful image (1 credit unit in the response). • Before processing, we check that your balance is at least $0.10. • After the image is generated successfully, we deduct $0.10 and increment totalUsage by 1. • If generation fails, nothing is deducted. Insufficient balance returns HTTP 402. Top up from /pricing, then retry.

POST /v1/process

Process a single image from a public URL. Request body (JSON): image_url — required. Must be fetchable by our servers (http/https). Response fields: result_base64 — PNG bytes, base64-encoded (save immediately; not retained server-side) content_type — always image/png id, status, credits_used, processing_time_ms The edit prompt is fixed server-side for now (not configurable via the API). Cold starts on the GPU worker can take up to ~1 minute; allow a long client timeout (several minutes). maxDuration on this route is 300 seconds.

Request

curl -X POST https://nudifyapi.vercel.app/v1/process \
  -H "Authorization: Bearer napi_your_key" \
  -H "Content-Type: application/json" \
  -d '{"image_url": "https://example.com/image.jpg"}'

Response

{
  "id": "req_abc123",
  "status": "completed",
  "content_type": "image/png",
  "result_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
  "credits_used": 1,
  "processing_time_ms": 18420
}

JavaScript example

Minimal Node example — decode and write the PNG yourself:

Example

import fs from "fs";

const res = await fetch("https://nudifyapi.vercel.app/v1/process", {
  method: "POST",
  headers: {
    Authorization: "Bearer napi_your_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    image_url: "https://example.com/photo.jpg",
  }),
});

if (!res.ok) {
  const err = await res.json();
  throw new Error(err.error || res.statusText);
}

const data = await res.json();
fs.writeFileSync("out.png", Buffer.from(data.result_base64, "base64"));
console.log("saved out.png", data.id);

Error codes

Errors return JSON: { "error": "message" }. 400 Bad request — missing/invalid JSON, missing image_url, or image download failed 401 Unauthorized — missing or invalid API key 402 Payment required — insufficient credits 502 Upstream GPU / processing failure Always check res.ok and read the error field before assuming success.

Limits & latency

• GPU concurrency is limited (one active job per worker). Parallel requests may queue or wait. • First request after idle can cold-start (~30–60+ seconds). • Input images are downloaded with a 30s timeout. • Batch processing (POST /v1/batch) is not available yet. If you need higher throughput or webhooks, contact us for an enterprise plan.