Skip to main content

Build with nocensor.ai

REST API for image generation, video, face swap, enhance, and multi-stage pipelines. Scoped API key auth, async job polling, webhooks — same credit system as the UI.

API key auth

Bearer token with per-key rate limits. Max 5 keys per account.

Async jobs

202 Accepted + polling. No blocking requests. Signed URLs when complete.

Same credit system

Credits deducted on submission. Failed jobs auto-refunded by cron.

Prompt safety

Same content filter as the UI. CSAM blocked at all tiers.

Authentication

All endpoints (except /api/v1/health) require a Bearer token:

Authorization: Bearer nc_live_<your_key>

API keys are generated in Settings → API Keys. Keys are shown once at creation — store them securely.

Each key carries one or more scopes. Using a key on an endpoint outside its scope returns 403 INSUFFICIENT_SCOPE.

ScopeGrants access to
generationPOST /generate, /video, /face-swap, /enhance, /pipelines
mgmtGET /jobs, /account, /credits, /payments, /models, /characters
webhooksAll /webhooks/* endpoints

API Reference

Full OpenAPI 3.1 spec available at /openapi.yaml.

Generation

POST/api/v1/generate

Generate an image

Submit a prompt (and optional source image for img2img) to generate an SDXL image.

POST/api/v1/video

Generate a video (txt2video or img2video)

POST/api/v1/undress

Undress an image (requires biometric consent)

POST/api/v1/face-swap

Face-swap an image (requires biometric consent)

POST/api/v1/enhance

Enhance an image

Run a single enhancement op (upscale, face-restore, bg-replace, attach-object).

Pipelines

POST/api/v1/pipelines

Run a multi-stage pipeline

GET/api/v1/pipelines/{id}

Get pipeline status

Jobs

GET/api/v1/jobs

List recent jobs

GET/api/v1/jobs/{id}

Get a job by ID

DELETE/api/v1/jobs/{id}

Cancel a job

Webhooks

GET/api/v1/webhooks

List webhooks

POST/api/v1/webhooks

Create a webhook

GET/api/v1/webhooks/{id}

Get a webhook

PATCH/api/v1/webhooks/{id}

Update a webhook

DELETE/api/v1/webhooks/{id}

Delete a webhook

GET/api/v1/webhooks/{id}/deliveries

List webhook deliveries

POST/api/v1/webhooks/{id}/test

Send a test event to a webhook

Account

GET/api/v1/account

Get current account

GET/api/v1/credits

Get remaining credits

GET/api/v1/characters

List available characters

Returns unlockable character LoRAs with unlock status and progress for the authenticated user.

GET/api/v1/payments

List recent payments

System

GET/api/v1/health

Health check

GET/api/v1/models

List available models

Quick start

Submit an image generation job and poll for the result:

1. Submit a job (202 Accepted)

curl -X POST https://nocensor.ai/api/v1/generate \
  -H "Authorization: Bearer nc_live_<your_key>" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "beautiful woman, photorealistic", "model": "realistic"}'

# 202 Accepted
# {
#   "data": { "id": "job_...", "status": "pending" },
#   "meta": { "poll_url": "/api/v1/jobs/job_...", "credits_remaining": 490 }
# }

2. Poll until complete

curl https://nocensor.ai/api/v1/jobs/<job_id> \
  -H "Authorization: Bearer nc_live_<your_key>"

# 200 OK — when done:
# {
#   "data": {
#     "id": "job_...", "status": "completed",
#     "outputs": [{ "url": "https://...", "media_type": "image", "expires_at": "..." }]
#   }
# }

Rate limits

LimitValueScope
Generation10 rpmPOST /generate, /video, /face-swap, /enhance, /pipelines
Management60 rpmGET /jobs, /account, /credits, /payments, /models, /characters
Webhooks10 rpmAll /webhooks/* endpoints
Active keys5 maxPer account

All responses include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. Rate-limited responses include a Retry-After header.

Error codes

CodeHTTPTrigger
UNAUTHORIZED401Missing, invalid, or revoked API key
FORBIDDEN403Account suspended or key missing required scope
INSUFFICIENT_CREDITS402Not enough credits for the workflow
RATE_LIMITED429Per-key or per-user rate limit exceeded
VALIDATION_ERROR422Malformed request body
PROMPT_BLOCKED400Content policy filter triggered
CONSENT_REQUIRED400Face swap submitted without biometricConsent: true
PAYLOAD_TOO_LARGE413Image exceeds 3.4MB
GPU_UNAVAILABLE503All GPU workers throttled — retry shortly
NOT_FOUND404Job does not exist or not owned by caller
INSUFFICIENT_SCOPE403API key lacks the required scope for this endpoint
CHARACTER_LOCKED403Character has not been unlocked by this account

Ready to build?

Create an account, get your API key, and start generating.

Get started free