EN ▾
Get API key

NSFW LLM: API Quickstart Guide

This guide shows developers how to integrate our uncensored LLM API using standard OpenAI SDKs, covering authentication, request structures, and streaming.

Authentication

To use the nsfw llm API, you need an API key from your dashboard. Pass this key in the Authorization header as a Bearer token. The base URL for all requests is https://api.nsfwllm.top/v1. You can generate a key via Google sign-in or email on the Get API key page. Keep your key secure, as it grants access to your prepaid credit.

Basic Completion Request

Send a POST request to /v1/chat/completions with your prompt. The model ID is always uncensored. Below is a basic cURL example:

curl https://api.nsfwllm.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."}]
  }'

This returns a standard JSON response containing the generated text. You can adjust parameters like temperature or max_tokens to control creativity and output length. The model supports a 100k context window, allowing for extensive conversations or document processing.

Python SDK Integration

Use the official OpenAI Python client with a custom base URL. Initialize the client with your API key and the base_url pointing to our service. This approach ensures compatibility with existing codebases that already use OpenAI structures. The following Python snippet demonstrates a simple chat completion:

from openai import OpenAI

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

This method is ideal for backend services or scripts where you need programmatic control over the generation process without handling raw HTTP requests manually.

Node.js SDK Usage

For JavaScript environments, use the openai npm package. Configure it with your key and the correct base URL. This allows you to integrate the uncensored model into Node.js applications, web servers, or browser-based tools. Here is how to make a request:

import OpenAI from "openai";

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

The response follows the standard OpenAI format, making it easy to parse and display in your application's UI or process further in your logic.

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream, delivering tokens as they are generated. This provides a better user experience for chat interfaces. Use this example for streaming:

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)

Token usage statistics are included in the final chunk of the stream, allowing you to track costs accurately. Streaming is supported across all SDKs and direct HTTP requests.

Limits, Errors, and Context

The API enforces a limit of 300 requests per minute and 8 concurrent requests per key. If you exceed these, you receive a 429 error. Authentication failures return 401, and insufficient credit returns 402. The context window is 100,000 tokens total, and output can run to the end of the window. Errors do not consume credit, and prepaid credits never expire. For more details on pricing, visit the pricing page.

API specifications

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

ParameterDetails
API formatOpenAI Chat Completions schema; official openai SDKs work unchanged
Base URLhttps://api.nsfwllm.top/v1
MethodsPOST /v1/chat/completions · GET /v1/models
API keyBearer token in the Authorization header
Modeluncensored
JSON modeJSON object mode via response_format json_object
Sampling parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Tools / tool callsSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Max context100,000 tokens, input and output combined
Completion lengthup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
SSE streamingYes — server-sent events; the last chunk carries token usage
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Rate limit300/min per key
Concurrencyup to 8 in parallel per key
Max body8 MB request body
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
Credit expirypaid credit never expires, no subscription
Token prices$0.15 per 1M input tokens · $0.50 per 1M output tokens
Billingprepaid credit, charged by real token usage; errors and refusals are free
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Sign-insign in with Google or with e-mail + password
Content policyadult content allowed; sexual content involving minors is refused
Keysone active key per account; a new key replaces the old one

Error reference

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

HTTPTypeWhat to do
400bad_requestmalformed request or too long for the context window
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_busytemporary overload, retry shortly

Questions and answers

What is the difference between this and OpenAI's API?

We host a single uncensored model tuned for fewer refusals on adult or controversial topics, whereas OpenAI offers multiple models with different content policies. Our billing is prepaid crypto-only, with no monthly subscriptions or hidden fees.

Does the uncensored model support function calling?

Yes, the model supports function calling (tools), JSON mode, and standard parameters like temperature and top_p. It is compatible with any OpenAI-compatible client that uses the chat-completions endpoint.

How is billing calculated?

You pay per token: $0.15 per 1M input tokens and $0.50 per 1M output tokens. Credits are prepaid via crypto, never expire, and errors are free. You can top up from $20 to $500.

Your key is one form away

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

Get API key