EN ▾
Get API key

NSFW Roleplay: Quickstart Guide: Uncensored LLM API

Deploy an uncensored LLM API for nsfw roleplay with this quickstart guide. Integrate text generation into your chatbot using standard OpenAI-compatible endpoints and transparent token billing.

Authentication: API Key header

Access the uncensored llm api by including your unique API key in the Authorization header of every request. This key is generated immediately upon signup via Google or email on the Get API key page. The system supports only one active key per account; generating a new key invalidates the previous one. If you receive a 401 Unauthorized error, verify that your key is correct and has not been replaced. Unlike competitors, we do not require a phone number or credit card for the initial trial credit of $0.50, which is valid for 7 days. Claim this credit with one click on your API key page.

Base URL and Endpoints

All requests must target the base URL https://api.nsfwroleplay.top/v1. This endpoint is fully compatible with official OpenAI SDKs and any OpenAI-compatible client. We provide two primary endpoints: POST /v1/chat/completions for text generation and GET /v1/models to verify connectivity. We do not offer embeddings, image, audio, or video generation. The model identifier to use in your requests is uncensored, which runs on our own servers and is tuned to answer without content refusals for lawful adult use. It is not GPT, Claude, or any other vendor model.

Sending a Chat Completion Request

Start by sending a standard chat completion request. The uncensored api accepts text input and returns text output. You can control the response style using parameters like temperature, top_p, and stop. The model has a context window of 100,000 tokens for the combined prompt and completion. Below is a basic example using curl to send your first message.

curl https://api.nsfwroleplay.top/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 request body includes the model field set to uncensored. If you do not specify max_tokens, the response can run to the end of the window. This direct approach avoids the overhead of subscription management, allowing you to pay only for what you use.

Python SDK Integration

For Python developers, using the official openai library is the most efficient way to integrate. Configure the client with the correct base_url and your API key. The following snippet demonstrates how to initialize the client and send a simple chat completion request. This method ensures compatibility with the standard SDK ecosystem while leveraging our uncensored model capabilities.

from openai import OpenAI

client = OpenAI(base_url="https://api.nsfwroleplay.top/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)

The library handles the JSON serialization and HTTP requests automatically. You can access the response text via response.choices[0].message.content. Remember that errors and refusals are free, so you do not need to worry about token costs for failed requests.

Node SDK Integration

Node.js developers can use the official openai package with similar configuration. Set the baseURL to our API endpoint and provide your key. The following example shows how to make a request and handle the response in an asynchronous function.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.nsfwroleplay.top/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);

This approach allows you to integrate the nsfw chatbot api directly into your Express or Fastify applications. The SDK manages the connection pool and error handling, letting you focus on your application logic. Ensure you handle potential network errors and API rate limits gracefully in your production environment.

Streaming Responses with SSE

For real-time user experiences, enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE), allowing you to process tokens as they are generated. This reduces perceived latency for users in your nsfw roleplay applications. The final chunk of the stream contains the total token usage, which is essential for accurate billing.

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)

Parse the SSE stream to extract the content deltas. This method is ideal for chat interfaces where you want to display text as it is generated. Keep in mind that streaming does not change the underlying token billing; you are still charged based on the total input and output tokens used.

Capabilities and limits

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.nsfwroleplay.top/v1
AuthenticationBearer token in the Authorization header
Model IDuncensored
JSON modeJSON object mode via response_format json_object
Completion lengthup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Function callingSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Other parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
StreamingSupported (stream: true), usage included at the end
Max context100,000 tokens (prompt + completion together)
Parallel requests8 requests at the same time per key
Max bodyup to 8 MB per request
Rate limit300/min per key
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Volume bonus+5% on $50+, +10% on $100+, +15% on $200+
Credit expirypaid credit never expires, no subscription
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Trial credit$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Priceinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Contentuncensored for adults; the only hard rule: no sexual content involving minors
AccountGoogle or e-mail and password
Key managementone active key per account; a new key replaces the old one

When a request fails

The type field is stable, the message is for humans. Errors cost nothing.

CodeTypeMeaning
400bad_requestmalformed request or too long for the context window
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditbalance is empty — top up, requests resume at once
403content_blockedrefused by the content policy
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largebody over 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busytemporary overload, retry shortly

Questions and answers

How are tokens billed and when is credit charged?

Credit is charged by real token usage, not per request. Errors and refusals are free. You pay $0.15 per 1M input tokens and $0.50 per 1M output tokens. Credit never expires, so you can top up when needed without worrying about monthly fees.

What are the rate limits and request constraints?

You are limited to 300 requests per minute and 8 simultaneous requests per key. The maximum request body size is 8 MB. These limits ensure fair usage and stability. If you exceed the rate limit, you will receive a 429 error.

Is the uncensored model truly free from refusals?

The model is tuned to answer without content refusals for lawful adult use, including fictional, security-research, or controversial topics. However, a hard content limit always applies: sexual content involving minors is refused. This is the only strict block enforced by the API.

Your key is one form away

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

Get API keyRead the docs