NSFW Model API Quickstart
Get started with our uncensored LLM API in minutes. Use standard OpenAI-compatible endpoints to generate text without content filters.
Authentication & Base URL
Use the provided API key with the standard base URL for all requests. We support any OpenAI-compatible client by simply changing the base_url parameter. Your key grants access to a single uncensored model optimized for adult content without refusals.
Include your key in the Authorization header as a Bearer token. This ensures secure access to our hosted endpoints. You can generate a new key immediately after signing up via Google or email.
Keep your key private. It identifies your prepaid account and tracks token usage accurately.
Sending Your First Completion
Send a POST request to /v1/chat/completions with your model name and messages array. The API returns text completions based on your prompt context. You must set the model ID to "uncensored" for consistent results.
Input tokens cost $0.15 per million, while output tokens cost $0.50 per million. Charges apply only to successful completions, not errors.
- Set the model to "uncensored".
- Provide a messages array with role and content.
- Include your API key in the headers.
This straightforward setup works for roleplay, creative writing, or data processing tasks.
curl https://api.modelnsfw.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Return 400 status code"}]
}'
Using Python & Node SDKs
Install the official OpenAI Python or Node SDKs and point them to our base URL. This allows you to use familiar methods like .chat.completions.create() without rewriting your logic.
Pass your API key as the api_key argument. Set the base_url to HTTPS://api.modelnsfw.cc/v1 to route requests correctly. This approach simplifies integration for existing projects.
Both SDKs handle JSON serialization and retry logic automatically. You can adjust parameters like temperature or top_p to control creativity.
Errors are returned as standard HTTP status codes. You can catch exceptions and handle them in your application logic.
from openai import OpenAI
client = OpenAI(base_url="https://api.modelnsfw.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)
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.modelnsfw.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);
Streaming Responses & Token Usage
Enable streaming by setting stream to true in your request body. The API returns chunks via Server-Sent Events (SSE) for real-time output. This reduces perceived latency for long responses.
Token usage details appear in the final chunk of the stream. You can parse this data to track costs accurately without waiting for the full response.
Streaming works well for chat interfaces or live text generation. It allows users to see content as it is generated.
Set max_tokens to control the maximum output length per request. The default is 2,048 tokens if not specified.
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)
Function Calling & JSON Mode
Use the tools parameter to enable function calling for structured data extraction. Define functions in your request and let the model choose which to call. This is useful for parsing text or triggering actions.
Enable JSON mode by setting response_format to json_object. The model returns strictly valid JSON, ensuring your parser never fails. This is ideal for API integrations requiring specific data structures.
Combine both features for complex workflows. You can extract data and call functions simultaneously.
Always validate the output structure in your code. The model strives for accuracy but may occasionally produce invalid syntax.
Rate Limits & Context Window
The context window supports 100,000 tokens for prompt and completion combined. This allows for large documents or long conversations. You can send up to 16,000 tokens in a single response.
Rate limits are set to 300 requests per minute per key. You can have 8 concurrent requests at the same time. The request body must not exceed 8 MB.
Monitor HTTP status codes for errors. A 401 error means your key is invalid. A 402 error indicates insufficient prepaid credit. A 429 error signals that you have exceeded your rate limit.
Credit never expires. You can top up anytime using crypto without losing your balance.
Frequently asked questions
Is this an uncensored model?
Yes, the model is tuned to answer without content refusals for lawful adult use. It does not filter NSFW topics, making it ideal for roleplay and creative writing.
What is the context window size?
The API supports a 100,000 token context window for both prompt and completion. This allows you to process large documents or maintain long conversation histories.
How do I pay for usage?
You pay with prepaid credit topped up via crypto (USDT on TRC20 or USDC on Base). There are no monthly subscriptions or hidden fees. Credit never expires.
Get your API key in seconds
Sign up, grab your key, update the base URL. That’s all there is to it.
Get your key