EN ▾
Get API key
  1. NsfwImage Cc
  2. Quickstart: Integrate Uncensored Text into Your NSFW Image App

Quickstart: Integrate Uncensored Text into Your NSFW Image App

Integrate an uncensored LLM into your NSFW image pipeline for prompt generation and metadata handling. This guide covers the essential steps to connect your application to our text API using standard OpenAI-compatible SDKs.

Authentication & Base URL

To start using the API, you need an API key from the Get API key page. Authentication is handled via the standard Authorization header. The base URL for all requests is https://api.nsfwimage.cc/v1. You can use any OpenAI-compatible client by updating the base URL and providing your key. This setup ensures compatibility with existing tools used in NSFW image generation workflows.

Sending Requests to /v1/chat/completions

The core endpoint is POST /v1/chat/completions. Send your prompt context as a JSON object with the model field set to uncensored. This model is tuned to answer without content refusals for lawful adult use. The response returns generated text, which you can use as input for image generation tools or to extract metadata.

curl https://api.nsfwimage.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
  }'

Ensure your requests include the necessary headers and follow the standard chat-completions format for seamless integration into your pipeline.

Configuring JSON Mode for Structured Output

For automated NSFW image pipelines, structured output is critical. Use the response_format parameter set to {"type": "json_object"} to enforce JSON responses. This ensures predictable data structures for tool logic and post-processing. JSON mode works alongside other parameters like temperature and top_p to control creativity and format adherence. This feature is essential for parsing prompts or metadata programmatically.

from openai import OpenAI

client = OpenAI(base_url="https://api.nsfwimage.cc/v1", api_key="YOUR_KEY")

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)

By enforcing strict JSON output, you reduce the need for complex parsing logic in your NSFW image generation scripts.

Handling Streaming Responses (SSE)

For real-time applications, enable streaming by setting stream: true. The API returns Server-Sent Events (SSE), delivering tokens incrementally. The final chunk contains the token usage statistics for billing and monitoring. Streaming is ideal for user-facing interfaces where immediate feedback is needed during NSFW image prompt generation. It allows you to display progress without waiting for the full response.

stream = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Tell the story in second person."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Handle the stream events appropriately to update your UI or log token usage accurately.

Managing Token Limits & Context Window

The model supports a 100,000-token context window, combining prompt and completion. There is no separate output cap per request, and if max_tokens is unset, the response can run to the end of the window. This capacity is sufficient for complex NSFW image prompt engineering and metadata extraction. Monitor token usage to optimize costs, as billing is based on actual token consumption. Errors and refusals do not incur charges.

Error Handling & Token Usage

Common errors include 401 (invalid key), 402 (insufficient credit), and 429 (rate limit). The rate limit is 300 requests per minute per key. Handle these errors gracefully in your NSFW image pipeline to maintain reliability. Token usage is detailed in the final streaming chunk or response headers. Errors are free, so failed requests do not affect your prepaid credit. Use the Support page for refund issues or double charges.

Node.js

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.nsfwimage.cc/v1", apiKey: process.env.API_KEY });

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);

Questions and answers

What is the uncensored model's capability for NSFW content?

The model is tuned to answer without content refusals for lawful adult, fictional, or controversial topics. It does not block standard NSFW content, making it ideal for NSFW image pipelines. However, it always refuses sexual content involving minors.

How do I pay for the API?

Payments are crypto-only, accepting USDT (TRC20) or USDC (Base). You can top up from $20 to $500, with bonus credit for larger amounts. No credit cards or PayPal are accepted. Trial credit is available for new accounts.

Is this API suitable for generating images directly?

No, this is a text-only API. It generates text for prompts, metadata, or post-processing. It does not generate images, audio, or video. Use it to power the text engine in your NSFW image generation tool.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Technical specifications

Use this table to decide whether the API fits your project before you buy credit.

ParameterDetails
CompatibilityOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
MethodsPOST /v1/chat/completions · GET /v1/models
Base URLhttps://api.nsfwimage.cc/v1
API keyAuthorization: Bearer YOUR_KEY
Modeluncensored
Max outputprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
Max context100,000 tokens (prompt + completion together)
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
Tools / tool callsYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
JSON moderesponse_format: {"type": "json_object"}
StreamingYes — server-sent events; the last chunk carries token usage
Request size8 MB request body
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Parallel requestsup to 8 in parallel per key
Requests per minute300/min per key
PaymentUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Token pricesinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Subscriptionpaid credit never expires, no subscription
Free trial$0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Content policyadult content allowed; sexual content involving minors is refused
Sign-insign in with Google or with e-mail + password
Keysone key per account, regenerate any time (the old one stops working)

When a request fails

Errors come back as JSON with a stable type; failed and refused requests are not billed.

CodeTypeMeaning
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
402no_creditbalance is empty — top up, requests resume at once
403content_blockedsexual content involving minors — refused, not billed
404not_foundunknown endpoint
413request_too_largerequest body larger than 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busymodel busy — retry in a few seconds

Start with trial credit

Email and password, key on screen right away.