Moving from the PirateDiffusion API to Not Safu API

18+ only. This site and the API are for adults. They describe and produce sexually explicit material. If you are under 18, or adult content is illegal where you are, leave now.

Not Safu API is the adult-branded HTTPS front door for the same PirateDiffusion API you already call. In most integrations you change only the host to api.notsafu.com and keep /api/v3/… paths, headers and your existing key.

URL map

PiecePirateDiffusion API (old)Not Safu API (new)
Basehttps://OLD_HOST/api/v3
Replace OLD_HOST with the API host from your onboarding email or SDK default.
https://api.notsafu.com/api/v3
Drop-in alias: https://api.notsafu.com/v1
AuthAuthorization: Bearer YOUR_KEYSame header, same key
Content-Type / Acceptapplication/vnd.api+jsonSame
WebSocketwss://OLD_HOST/render-events/{hash}?token=YOUR_KEYwss://api.notsafu.com/v1/render-events/{hash} (Bearer preferred; ?token= still works). Bare /render-events/{hash} is also accepted.
MethodOld pathNew pathPurpose
POSThttps://OLD_HOST/api/v3/renderhttps://api.notsafu.com/api/v3/render
or https://api.notsafu.com/v1/render
Create a render
GEThttps://OLD_HOST/api/v3/render/{hash}https://api.notsafu.com/api/v3/render/{hash}
or https://api.notsafu.com/v1/render/{hash}
Get a render
GEThttps://OLD_HOST/api/v3/render/from-url/{url}https://api.notsafu.com/api/v3/render/from-url/{url}
or https://api.notsafu.com/v1/render/from-url/{url}
Look up a render from an image URL
POSThttps://OLD_HOST/api/v3/chathttps://api.notsafu.com/api/v3/chat
or https://api.notsafu.com/v1/chat
Chat
GEThttps://OLD_HOST/api/v3/bot/{slug}https://api.notsafu.com/api/v3/bot/{slug}
or https://api.notsafu.com/v1/bot/{slug}
Get a persona
GEThttps://OLD_HOST/api/v3/conceptshttps://api.notsafu.com/api/v3/concepts
or https://api.notsafu.com/v1/concepts
List concepts
GEThttps://OLD_HOST/api/v3/workflowshttps://api.notsafu.com/api/v3/workflows
or https://api.notsafu.com/v1/workflows
List workflows
POSThttps://OLD_HOST/api/v3/knowledgehttps://api.notsafu.com/api/v3/knowledge
or https://api.notsafu.com/v1/knowledge
Create a knowledge base
POSThttps://OLD_HOST/api/v3/knowledge/{domain}/searchhttps://api.notsafu.com/api/v3/knowledge/{domain}/search
or https://api.notsafu.com/v1/knowledge/{domain}/search
Search a knowledge base
POSThttps://OLD_HOST/api/v3/knowledge/{domain}/chathttps://api.notsafu.com/api/v3/knowledge/{domain}/chat
or https://api.notsafu.com/v1/knowledge/{domain}/chat
Chat with a knowledge base
POSThttps://OLD_HOST/api/v3/knowledge/{domain}/crawlhttps://api.notsafu.com/api/v3/knowledge/{domain}/crawl
or https://api.notsafu.com/v1/knowledge/{domain}/crawl
Crawl into a knowledge base
POSThttps://OLD_HOST/api/v3/knowledge/{domain}/facthttps://api.notsafu.com/api/v3/knowledge/{domain}/fact
or https://api.notsafu.com/v1/knowledge/{domain}/fact
Add a fact
GET/POST/PATCH/DELETEhttps://OLD_HOST/api/v3/skillshttps://api.notsafu.com/api/v3/skills
or https://api.notsafu.com/v1/skills
Skills list/get/create/update/delete/select/invoke/auto
POST/GEThttps://OLD_HOST/api/v3/virtualuser/https://api.notsafu.com/api/v3/virtualuser/
or https://api.notsafu.com/v1/virtualuser/
Virtual users (login/otp stay blocked)

Your API key stays the same

Not Safu is a relay: it forwards your Authorization header unchanged to the rendering backend. The key you already use for the PirateDiffusion API keeps working. There is no re-issue step on this site. If a key is compromised, reply to your access email right away.

Before / after

Only the host changes in these samples. Keep the same env var name you already use, or rename it to NOTSAFU_API_KEY for clarity.

curl — before

curl -sS -X POST "https://OLD_HOST/api/v3/render" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -d '{"prompt":"/images:1 lingerie editorial, soft window light","callback_url":"https://your-app.example/webhooks/render"}'

curl — after

curl -sS -X POST "https://api.notsafu.com/api/v3/render" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -d '{"prompt":"/images:1 lingerie editorial, soft window light","callback_url":"https://your-app.example/webhooks/render"}'

Python — before

import os, requests
BASE = "https://OLD_HOST/api/v3"
r = requests.post(
    f"{BASE}/render",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
        "Content-Type": "application/vnd.api+json",
        "Accept": "application/vnd.api+json",
    },
    json={"prompt": "/images:1 lingerie editorial, soft window light",
          "callback_url": "https://your-app.example/webhooks/render"},
    timeout=120,
)
print(r.json())

Python — after

import os, requests
BASE = "https://api.notsafu.com/api/v3"  # or "https://api.notsafu.com/v1"
r = requests.post(
    f"{BASE}/render",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
        "Content-Type": "application/vnd.api+json",
        "Accept": "application/vnd.api+json",
    },
    json={"prompt": "/images:1 lingerie editorial, soft window light",
          "callback_url": "https://your-app.example/webhooks/render"},
    timeout=120,
)
print(r.json())

JavaScript — before

const res = await fetch("https://OLD_HOST/api/v3/render", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    "Content-Type": "application/vnd.api+json",
    Accept: "application/vnd.api+json",
  },
  body: JSON.stringify({
    prompt: "/images:1 lingerie editorial, soft window light",
    callback_url: "https://your-app.example/webhooks/render",
  }),
});
console.log(await res.json());

JavaScript — after

const res = await fetch("https://api.notsafu.com/api/v3/render", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    "Content-Type": "application/vnd.api+json",
    Accept: "application/vnd.api+json",
  },
  body: JSON.stringify({
    prompt: "/images:1 lingerie editorial, soft window light",
    callback_url: "https://your-app.example/webhooks/render",
  }),
});
console.log(await res.json());

What is different

Checklist

  1. Point the base URL at https://api.notsafu.com/api/v3 (or https://api.notsafu.com/v1).
  2. Keep Authorization: Bearer and your existing key.
  3. Keep Content-Type / Accept: application/vnd.api+json.
  4. Update any hardcoded media host allowlists to accept https://api.notsafu.com/v1/assets/.
  5. Update WebSocket clients to wss://api.notsafu.com/v1/render-events/….
  6. Smoke-test: GET https://api.notsafu.com/api/v3/concepts with your key; start one render with a webhook you control.
  7. Read the acceptable use policy (18+, legal and consensual, no real or realistic-looking minors).

Support and abuse

Product / access questions: reply to the email that issued your key.

Abuse reports and takedown requests: legal@notsafu.com. See Abuse and takedown.

Full endpoint reference: Developer guide.